UNPKG

stream-mock

Version:
16 lines 509 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const stream_1 = require("stream"); class ObjectReadableMock extends stream_1.Readable { constructor(source, options = {}) { options.objectMode = true; super(options); this.it = source[Symbol.iterator](); } _read() { const next = this.it.next(); this.push(next.done ? null : next.value); } } exports.default = ObjectReadableMock; //# sourceMappingURL=ObjectReadableMock.js.map