mapWriter = (writer, transform) => {
  const transformedWriter = harden({
    /**
     * @param {TIn} value
     */
    async next(value) {
      return writer.next(transform(value));
    },
    /**
     * @param {Error} error
     */
    async throw(error) {
      return writer.throw(error);
    },
    /**
     * @param {undefined} value
     */
    async return(value) {
      return writer.return(value);
    },
    [Symbol.asyncIterator]() {
      return transformedWriter;
    },
  });
  return transformedWriter;
}
@template TIn
@template TOut
@param {import('./types.js').Writer<TOut>} writer
@param {(value: TIn) => TOut} transform
@returns {import('./types.js').Writer<TIn>}