UNPKG

@naturalcycles/nodejs-lib

Version:
16 lines (15 loc) 464 B
import { Transform } from 'node:stream'; /** * Transform that does nothing (pass the data through). * Can be used e.g to convert "not-valid" stream (e.g one that `transformMap` is producing) * into a "valid" stream (that implements async-iteration interface). */ export function transformNoOp() { return new Transform({ objectMode: true, highWaterMark: 1, transform(chunk, _, cb) { cb(null, chunk); }, }); }