1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | extendStatics(d, b);
|
11 | function __() { this.constructor = d; }
|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13 | };
|
14 | })();
|
15 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 | var stream = require("stream");
|
17 | var StringStream = (function (_super) {
|
18 | __extends(StringStream, _super);
|
19 | function StringStream(content, fileName) {
|
20 | var _this = _super.call(this) || this;
|
21 | _this.content = content;
|
22 | _this.file = fileName;
|
23 | return _this;
|
24 | }
|
25 | StringStream.prototype._read = function (size) {
|
26 | if (!this.content) {
|
27 | this.push(null);
|
28 | }
|
29 | else {
|
30 | this.push(this.content.slice(0, size));
|
31 | this.content = this.content.slice(size);
|
32 | }
|
33 | };
|
34 | return StringStream;
|
35 | }(stream.Readable));
|
36 | exports.StringStream = StringStream;
|