UNPKG

583 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.transformNoOp = void 0;
4const stream_1 = require("stream");
5/**
6 * Transform that does nothing (pass the data through).
7 * Can be used e.g to convert "not-valid" stream (e.g one that `transformMap` is producing)
8 * into a "valid" stream (that implements async-iteration interface).
9 */
10function transformNoOp() {
11 return new stream_1.Transform({
12 objectMode: true,
13 transform(chunk, _, cb) {
14 cb(null, chunk);
15 },
16 });
17}
18exports.transformNoOp = transformNoOp;