UNPKG

@naturalcycles/nodejs-lib

Version:
19 lines (18 loc) 583 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transformNoOp = void 0; const stream_1 = require("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). */ function transformNoOp() { return new stream_1.Transform({ objectMode: true, transform(chunk, _, cb) { cb(null, chunk); }, }); } exports.transformNoOp = transformNoOp;