@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
19 lines (18 loc) • 583 B
JavaScript
;
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;