spawn-term 3.3.6 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,7 @@
1
- "use strict";
1
+ /**
2
+ * Compatibility Layer for Node.js 0.8+
3
+ * Local to this package - contains only needed functions.
4
+ */ "use strict";
2
5
  Object.defineProperty(exports, "__esModule", {
3
6
  value: true
4
7
  });
@@ -9,6 +12,18 @@ function _export(target, all) {
9
12
  });
10
13
  }
11
14
  _export(exports, {
15
+ get PassThrough () {
16
+ return PassThrough;
17
+ },
18
+ get Readable () {
19
+ return Readable;
20
+ },
21
+ get Transform () {
22
+ return Transform;
23
+ },
24
+ get Writable () {
25
+ return Writable;
26
+ },
12
27
  get arrayFind () {
13
28
  return arrayFind;
14
29
  },
@@ -16,10 +31,23 @@ _export(exports, {
16
31
  return stringEndsWith;
17
32
  }
18
33
  });
34
+ var _module = /*#__PURE__*/ _interop_require_default(require("module"));
35
+ function _interop_require_default(obj) {
36
+ return obj && obj.__esModule ? obj : {
37
+ default: obj
38
+ };
39
+ }
40
+ var _require = typeof require === 'undefined' ? _module.default.createRequire(require("url").pathToFileURL(__filename).toString()) : require;
41
+ /**
42
+ * Stream compatibility - Transform class
43
+ * - Uses native stream.Transform on Node 0.10+
44
+ * - Falls back to readable-stream for Node 0.8
45
+ */ var major = +process.versions.node.split('.')[0];
46
+ var Readable = major > 0 ? _require('stream').Readable : _require('readable-stream').Readable;
47
+ var Writable = major > 0 ? _require('stream').Writable : _require('readable-stream').Writable;
48
+ var Transform = major > 0 ? _require('stream').Transform : _require('readable-stream').Transform;
49
+ var PassThrough = major > 0 ? _require('stream').PassThrough : _require('readable-stream').PassThrough;
19
50
  /**
20
- * Compatibility Layer for Node.js 0.8+
21
- * Local to this package - contains only needed functions.
22
- */ /**
23
51
  * String.prototype.endsWith wrapper for Node.js 0.8+
24
52
  * - Uses native endsWith on Node 4.0+ / ES2015+
25
53
  * - Falls back to lastIndexOf on Node 0.8-3.x
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\n\n/**\n * String.prototype.endsWith wrapper for Node.js 0.8+\n * - Uses native endsWith on Node 4.0+ / ES2015+\n * - Falls back to lastIndexOf on Node 0.8-3.x\n */\nconst hasEndsWith = typeof String.prototype.endsWith === 'function';\n\nexport function stringEndsWith(str: string, search: string, position?: number): boolean {\n if (hasEndsWith) {\n return str.endsWith(search, position);\n }\n const len = position === undefined ? str.length : position;\n return str.lastIndexOf(search) === len - search.length;\n}\n\n/**\n * Array.prototype.find wrapper for Node.js 0.8+\n * - Uses native find on Node 4.0+ / ES2015+\n * - Falls back to loop on Node 0.8-3.x\n */\nconst hasArrayFind = typeof Array.prototype.find === 'function';\n\nexport function arrayFind<T>(arr: T[], predicate: (item: T, index: number, arr: T[]) => boolean): T | undefined {\n if (hasArrayFind) {\n return arr.find(predicate);\n }\n for (let i = 0; i < arr.length; i++) {\n if (predicate(arr[i], i, arr)) return arr[i];\n }\n return undefined;\n}\n"],"names":["arrayFind","stringEndsWith","hasEndsWith","String","prototype","endsWith","str","search","position","len","undefined","length","lastIndexOf","hasArrayFind","Array","find","arr","predicate","i"],"mappings":";;;;;;;;;;;QA2BgBA;eAAAA;;QAfAC;eAAAA;;;AAZhB;;;CAGC,GAED;;;;CAIC,GACD,IAAMC,cAAc,OAAOC,OAAOC,SAAS,CAACC,QAAQ,KAAK;AAElD,SAASJ,eAAeK,GAAW,EAAEC,MAAc,EAAEC,QAAiB;IAC3E,IAAIN,aAAa;QACf,OAAOI,IAAID,QAAQ,CAACE,QAAQC;IAC9B;IACA,IAAMC,MAAMD,aAAaE,YAAYJ,IAAIK,MAAM,GAAGH;IAClD,OAAOF,IAAIM,WAAW,CAACL,YAAYE,MAAMF,OAAOI,MAAM;AACxD;AAEA;;;;CAIC,GACD,IAAME,eAAe,OAAOC,MAAMV,SAAS,CAACW,IAAI,KAAK;AAE9C,SAASf,UAAagB,GAAQ,EAAEC,SAAwD;IAC7F,IAAIJ,cAAc;QAChB,OAAOG,IAAID,IAAI,CAACE;IAClB;IACA,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIL,MAAM,EAAEO,IAAK;QACnC,IAAID,UAAUD,GAAG,CAACE,EAAE,EAAEA,GAAGF,MAAM,OAAOA,GAAG,CAACE,EAAE;IAC9C;IACA,OAAOR;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\n\nimport Module from 'module';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\n\n/**\n * Stream compatibility - Transform class\n * - Uses native stream.Transform on Node 0.10+\n * - Falls back to readable-stream for Node 0.8\n */\nconst major = +process.versions.node.split('.')[0];\nexport const Readable: typeof import('stream').Readable = major > 0 ? _require('stream').Readable : _require('readable-stream').Readable;\nexport const Writable: typeof import('stream').Writable = major > 0 ? _require('stream').Writable : _require('readable-stream').Writable;\nexport const Transform: typeof import('stream').Transform = major > 0 ? _require('stream').Transform : _require('readable-stream').Transform;\nexport const PassThrough: typeof import('stream').PassThrough = major > 0 ? _require('stream').PassThrough : _require('readable-stream').PassThrough;\n\n/**\n * String.prototype.endsWith wrapper for Node.js 0.8+\n * - Uses native endsWith on Node 4.0+ / ES2015+\n * - Falls back to lastIndexOf on Node 0.8-3.x\n */\nconst hasEndsWith = typeof String.prototype.endsWith === 'function';\nexport function stringEndsWith(str: string, search: string, position?: number): boolean {\n if (hasEndsWith) {\n return str.endsWith(search, position);\n }\n const len = position === undefined ? str.length : position;\n return str.lastIndexOf(search) === len - search.length;\n}\n\n/**\n * Array.prototype.find wrapper for Node.js 0.8+\n * - Uses native find on Node 4.0+ / ES2015+\n * - Falls back to loop on Node 0.8-3.x\n */\nconst hasArrayFind = typeof Array.prototype.find === 'function';\n\nexport function arrayFind<T>(arr: T[], predicate: (item: T, index: number, arr: T[]) => boolean): T | undefined {\n if (hasArrayFind) {\n return arr.find(predicate);\n }\n for (let i = 0; i < arr.length; i++) {\n if (predicate(arr[i], i, arr)) return arr[i];\n }\n return undefined;\n}\n"],"names":["PassThrough","Readable","Transform","Writable","arrayFind","stringEndsWith","_require","require","Module","createRequire","major","process","versions","node","split","hasEndsWith","String","prototype","endsWith","str","search","position","len","undefined","length","lastIndexOf","hasArrayFind","Array","find","arr","predicate","i"],"mappings":"AAAA;;;CAGC;;;;;;;;;;;QAeYA;eAAAA;;QAHAC;eAAAA;;QAEAC;eAAAA;;QADAC;eAAAA;;QAyBGC;eAAAA;;QAfAC;eAAAA;;;6DArBG;;;;;;AAEnB,IAAMC,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;AAE1F;;;;CAIC,GACD,IAAMG,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAC3C,IAAMb,WAA6CS,QAAQ,IAAIJ,SAAS,UAAUL,QAAQ,GAAGK,SAAS,mBAAmBL,QAAQ;AACjI,IAAME,WAA6CO,QAAQ,IAAIJ,SAAS,UAAUH,QAAQ,GAAGG,SAAS,mBAAmBH,QAAQ;AACjI,IAAMD,YAA+CQ,QAAQ,IAAIJ,SAAS,UAAUJ,SAAS,GAAGI,SAAS,mBAAmBJ,SAAS;AACrI,IAAMF,cAAmDU,QAAQ,IAAIJ,SAAS,UAAUN,WAAW,GAAGM,SAAS,mBAAmBN,WAAW;AAEpJ;;;;CAIC,GACD,IAAMe,cAAc,OAAOC,OAAOC,SAAS,CAACC,QAAQ,KAAK;AAClD,SAASb,eAAec,GAAW,EAAEC,MAAc,EAAEC,QAAiB;IAC3E,IAAIN,aAAa;QACf,OAAOI,IAAID,QAAQ,CAACE,QAAQC;IAC9B;IACA,IAAMC,MAAMD,aAAaE,YAAYJ,IAAIK,MAAM,GAAGH;IAClD,OAAOF,IAAIM,WAAW,CAACL,YAAYE,MAAMF,OAAOI,MAAM;AACxD;AAEA;;;;CAIC,GACD,IAAME,eAAe,OAAOC,MAAMV,SAAS,CAACW,IAAI,KAAK;AAE9C,SAASxB,UAAayB,GAAQ,EAAEC,SAAwD;IAC7F,IAAIJ,cAAc;QAChB,OAAOG,IAAID,IAAI,CAACE;IAClB;IACA,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIL,MAAM,EAAEO,IAAK;QACnC,IAAID,UAAUD,GAAG,CAACE,EAAE,EAAEA,GAAGF,MAAM,OAAOA,GAAG,CAACE,EAAE;IAC9C;IACA,OAAOR;AACT"}
@@ -8,16 +8,10 @@ Object.defineProperty(exports, "default", {
8
8
  return concatWritable;
9
9
  }
10
10
  });
11
- var _stream = /*#__PURE__*/ _interop_require_default(require("stream"));
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- var Writable = _stream.default.Writable;
11
+ var _compatts = require("../compat.js");
18
12
  function concatWritable(callback) {
19
13
  var chunks = [];
20
- var stream = new Writable({
14
+ var stream = new _compatts.Writable({
21
15
  write: function(chunk, _encoding, next) {
22
16
  chunks.push(chunk);
23
17
  next();
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/concatWritable.ts"],"sourcesContent":["import Stream from 'stream';\n\nconst Writable = Stream.Writable;\n\nexport type Callback = (lines: Buffer) => void;\n\nexport default function concatWritable(callback: Callback): NodeJS.WritableStream {\n const chunks = [];\n const stream = new Writable({\n write: (chunk, _encoding, next) => {\n chunks.push(chunk);\n next();\n },\n });\n stream.on('finish', () => callback(Buffer.concat(chunks.splice(0))));\n return stream;\n}\n"],"names":["concatWritable","Writable","Stream","callback","chunks","stream","write","chunk","_encoding","next","push","on","Buffer","concat","splice"],"mappings":";;;;+BAMA;;;eAAwBA;;;6DANL;;;;;;AAEnB,IAAMC,WAAWC,eAAM,CAACD,QAAQ;AAIjB,SAASD,eAAeG,QAAkB;IACvD,IAAMC,SAAS,EAAE;IACjB,IAAMC,SAAS,IAAIJ,SAAS;QAC1BK,OAAO,SAACC,OAAOC,WAAWC;YACxBL,OAAOM,IAAI,CAACH;YACZE;QACF;IACF;IACAJ,OAAOM,EAAE,CAAC,UAAU;eAAMR,SAASS,OAAOC,MAAM,CAACT,OAAOU,MAAM,CAAC;;IAC/D,OAAOT;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/concatWritable.ts"],"sourcesContent":["import { Writable } from '../compat.ts';\n\nexport type Callback = (lines: Buffer) => void;\n\nexport default function concatWritable(callback: Callback): NodeJS.WritableStream {\n const chunks = [];\n const stream = new Writable({\n write: (chunk, _encoding, next) => {\n chunks.push(chunk);\n next();\n },\n });\n stream.on('finish', () => callback(Buffer.concat(chunks.splice(0))));\n return stream;\n}\n"],"names":["concatWritable","callback","chunks","stream","Writable","write","chunk","_encoding","next","push","on","Buffer","concat","splice"],"mappings":";;;;+BAIA;;;eAAwBA;;;wBAJC;AAIV,SAASA,eAAeC,QAAkB;IACvD,IAAMC,SAAS,EAAE;IACjB,IAAMC,SAAS,IAAIC,kBAAQ,CAAC;QAC1BC,OAAO,SAACC,OAAOC,WAAWC;YACxBN,OAAOO,IAAI,CAACH;YACZE;QACF;IACF;IACAL,OAAOO,EAAE,CAAC,UAAU;eAAMT,SAASU,OAAOC,MAAM,CAACV,OAAOW,MAAM,CAAC;;IAC/D,OAAOV;AACT"}
@@ -2,5 +2,9 @@
2
2
  * Compatibility Layer for Node.js 0.8+
3
3
  * Local to this package - contains only needed functions.
4
4
  */
5
+ export declare const Readable: typeof import('stream').Readable;
6
+ export declare const Writable: typeof import('stream').Writable;
7
+ export declare const Transform: typeof import('stream').Transform;
8
+ export declare const PassThrough: typeof import('stream').PassThrough;
5
9
  export declare function stringEndsWith(str: string, search: string, position?: number): boolean;
6
10
  export declare function arrayFind<T>(arr: T[], predicate: (item: T, index: number, arr: T[]) => boolean): T | undefined;
@@ -1,7 +1,18 @@
1
1
  /**
2
2
  * Compatibility Layer for Node.js 0.8+
3
3
  * Local to this package - contains only needed functions.
4
- */ /**
4
+ */ import Module from 'module';
5
+ const _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;
6
+ /**
7
+ * Stream compatibility - Transform class
8
+ * - Uses native stream.Transform on Node 0.10+
9
+ * - Falls back to readable-stream for Node 0.8
10
+ */ const major = +process.versions.node.split('.')[0];
11
+ export const Readable = major > 0 ? _require('stream').Readable : _require('readable-stream').Readable;
12
+ export const Writable = major > 0 ? _require('stream').Writable : _require('readable-stream').Writable;
13
+ export const Transform = major > 0 ? _require('stream').Transform : _require('readable-stream').Transform;
14
+ export const PassThrough = major > 0 ? _require('stream').PassThrough : _require('readable-stream').PassThrough;
15
+ /**
5
16
  * String.prototype.endsWith wrapper for Node.js 0.8+
6
17
  * - Uses native endsWith on Node 4.0+ / ES2015+
7
18
  * - Falls back to lastIndexOf on Node 0.8-3.x
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\n\n/**\n * String.prototype.endsWith wrapper for Node.js 0.8+\n * - Uses native endsWith on Node 4.0+ / ES2015+\n * - Falls back to lastIndexOf on Node 0.8-3.x\n */\nconst hasEndsWith = typeof String.prototype.endsWith === 'function';\n\nexport function stringEndsWith(str: string, search: string, position?: number): boolean {\n if (hasEndsWith) {\n return str.endsWith(search, position);\n }\n const len = position === undefined ? str.length : position;\n return str.lastIndexOf(search) === len - search.length;\n}\n\n/**\n * Array.prototype.find wrapper for Node.js 0.8+\n * - Uses native find on Node 4.0+ / ES2015+\n * - Falls back to loop on Node 0.8-3.x\n */\nconst hasArrayFind = typeof Array.prototype.find === 'function';\n\nexport function arrayFind<T>(arr: T[], predicate: (item: T, index: number, arr: T[]) => boolean): T | undefined {\n if (hasArrayFind) {\n return arr.find(predicate);\n }\n for (let i = 0; i < arr.length; i++) {\n if (predicate(arr[i], i, arr)) return arr[i];\n }\n return undefined;\n}\n"],"names":["hasEndsWith","String","prototype","endsWith","stringEndsWith","str","search","position","len","undefined","length","lastIndexOf","hasArrayFind","Array","find","arrayFind","arr","predicate","i"],"mappings":"AAAA;;;CAGC,GAED;;;;CAIC,GACD,MAAMA,cAAc,OAAOC,OAAOC,SAAS,CAACC,QAAQ,KAAK;AAEzD,OAAO,SAASC,eAAeC,GAAW,EAAEC,MAAc,EAAEC,QAAiB;IAC3E,IAAIP,aAAa;QACf,OAAOK,IAAIF,QAAQ,CAACG,QAAQC;IAC9B;IACA,MAAMC,MAAMD,aAAaE,YAAYJ,IAAIK,MAAM,GAAGH;IAClD,OAAOF,IAAIM,WAAW,CAACL,YAAYE,MAAMF,OAAOI,MAAM;AACxD;AAEA;;;;CAIC,GACD,MAAME,eAAe,OAAOC,MAAMX,SAAS,CAACY,IAAI,KAAK;AAErD,OAAO,SAASC,UAAaC,GAAQ,EAAEC,SAAwD;IAC7F,IAAIL,cAAc;QAChB,OAAOI,IAAIF,IAAI,CAACG;IAClB;IACA,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIN,MAAM,EAAEQ,IAAK;QACnC,IAAID,UAAUD,GAAG,CAACE,EAAE,EAAEA,GAAGF,MAAM,OAAOA,GAAG,CAACE,EAAE;IAC9C;IACA,OAAOT;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\n\nimport Module from 'module';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\n\n/**\n * Stream compatibility - Transform class\n * - Uses native stream.Transform on Node 0.10+\n * - Falls back to readable-stream for Node 0.8\n */\nconst major = +process.versions.node.split('.')[0];\nexport const Readable: typeof import('stream').Readable = major > 0 ? _require('stream').Readable : _require('readable-stream').Readable;\nexport const Writable: typeof import('stream').Writable = major > 0 ? _require('stream').Writable : _require('readable-stream').Writable;\nexport const Transform: typeof import('stream').Transform = major > 0 ? _require('stream').Transform : _require('readable-stream').Transform;\nexport const PassThrough: typeof import('stream').PassThrough = major > 0 ? _require('stream').PassThrough : _require('readable-stream').PassThrough;\n\n/**\n * String.prototype.endsWith wrapper for Node.js 0.8+\n * - Uses native endsWith on Node 4.0+ / ES2015+\n * - Falls back to lastIndexOf on Node 0.8-3.x\n */\nconst hasEndsWith = typeof String.prototype.endsWith === 'function';\nexport function stringEndsWith(str: string, search: string, position?: number): boolean {\n if (hasEndsWith) {\n return str.endsWith(search, position);\n }\n const len = position === undefined ? str.length : position;\n return str.lastIndexOf(search) === len - search.length;\n}\n\n/**\n * Array.prototype.find wrapper for Node.js 0.8+\n * - Uses native find on Node 4.0+ / ES2015+\n * - Falls back to loop on Node 0.8-3.x\n */\nconst hasArrayFind = typeof Array.prototype.find === 'function';\n\nexport function arrayFind<T>(arr: T[], predicate: (item: T, index: number, arr: T[]) => boolean): T | undefined {\n if (hasArrayFind) {\n return arr.find(predicate);\n }\n for (let i = 0; i < arr.length; i++) {\n if (predicate(arr[i], i, arr)) return arr[i];\n }\n return undefined;\n}\n"],"names":["Module","_require","require","createRequire","url","major","process","versions","node","split","Readable","Writable","Transform","PassThrough","hasEndsWith","String","prototype","endsWith","stringEndsWith","str","search","position","len","undefined","length","lastIndexOf","hasArrayFind","Array","find","arrayFind","arr","predicate","i"],"mappings":"AAAA;;;CAGC,GAED,OAAOA,YAAY,SAAS;AAE5B,MAAMC,WAAW,OAAOC,YAAY,cAAcF,OAAOG,aAAa,CAAC,YAAYC,GAAG,IAAIF;AAE1F;;;;CAIC,GACD,MAAMG,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,OAAO,MAAMC,WAA6CL,QAAQ,IAAIJ,SAAS,UAAUS,QAAQ,GAAGT,SAAS,mBAAmBS,QAAQ,CAAC;AACzI,OAAO,MAAMC,WAA6CN,QAAQ,IAAIJ,SAAS,UAAUU,QAAQ,GAAGV,SAAS,mBAAmBU,QAAQ,CAAC;AACzI,OAAO,MAAMC,YAA+CP,QAAQ,IAAIJ,SAAS,UAAUW,SAAS,GAAGX,SAAS,mBAAmBW,SAAS,CAAC;AAC7I,OAAO,MAAMC,cAAmDR,QAAQ,IAAIJ,SAAS,UAAUY,WAAW,GAAGZ,SAAS,mBAAmBY,WAAW,CAAC;AAErJ;;;;CAIC,GACD,MAAMC,cAAc,OAAOC,OAAOC,SAAS,CAACC,QAAQ,KAAK;AACzD,OAAO,SAASC,eAAeC,GAAW,EAAEC,MAAc,EAAEC,QAAiB;IAC3E,IAAIP,aAAa;QACf,OAAOK,IAAIF,QAAQ,CAACG,QAAQC;IAC9B;IACA,MAAMC,MAAMD,aAAaE,YAAYJ,IAAIK,MAAM,GAAGH;IAClD,OAAOF,IAAIM,WAAW,CAACL,YAAYE,MAAMF,OAAOI,MAAM;AACxD;AAEA;;;;CAIC,GACD,MAAME,eAAe,OAAOC,MAAMX,SAAS,CAACY,IAAI,KAAK;AAErD,OAAO,SAASC,UAAaC,GAAQ,EAAEC,SAAwD;IAC7F,IAAIL,cAAc;QAChB,OAAOI,IAAIF,IAAI,CAACG;IAClB;IACA,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIN,MAAM,EAAEQ,IAAK;QACnC,IAAID,UAAUD,GAAG,CAACE,EAAE,EAAEA,GAAGF,MAAM,OAAOA,GAAG,CAACE,EAAE;IAC9C;IACA,OAAOT;AACT"}
@@ -1,5 +1,4 @@
1
- import Stream from 'stream';
2
- const Writable = Stream.Writable;
1
+ import { Writable } from '../compat.js';
3
2
  export default function concatWritable(callback) {
4
3
  const chunks = [];
5
4
  const stream = new Writable({
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/concatWritable.ts"],"sourcesContent":["import Stream from 'stream';\n\nconst Writable = Stream.Writable;\n\nexport type Callback = (lines: Buffer) => void;\n\nexport default function concatWritable(callback: Callback): NodeJS.WritableStream {\n const chunks = [];\n const stream = new Writable({\n write: (chunk, _encoding, next) => {\n chunks.push(chunk);\n next();\n },\n });\n stream.on('finish', () => callback(Buffer.concat(chunks.splice(0))));\n return stream;\n}\n"],"names":["Stream","Writable","concatWritable","callback","chunks","stream","write","chunk","_encoding","next","push","on","Buffer","concat","splice"],"mappings":"AAAA,OAAOA,YAAY,SAAS;AAE5B,MAAMC,WAAWD,OAAOC,QAAQ;AAIhC,eAAe,SAASC,eAAeC,QAAkB;IACvD,MAAMC,SAAS,EAAE;IACjB,MAAMC,SAAS,IAAIJ,SAAS;QAC1BK,OAAO,CAACC,OAAOC,WAAWC;YACxBL,OAAOM,IAAI,CAACH;YACZE;QACF;IACF;IACAJ,OAAOM,EAAE,CAAC,UAAU,IAAMR,SAASS,OAAOC,MAAM,CAACT,OAAOU,MAAM,CAAC;IAC/D,OAAOT;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/concatWritable.ts"],"sourcesContent":["import { Writable } from '../compat.ts';\n\nexport type Callback = (lines: Buffer) => void;\n\nexport default function concatWritable(callback: Callback): NodeJS.WritableStream {\n const chunks = [];\n const stream = new Writable({\n write: (chunk, _encoding, next) => {\n chunks.push(chunk);\n next();\n },\n });\n stream.on('finish', () => callback(Buffer.concat(chunks.splice(0))));\n return stream;\n}\n"],"names":["Writable","concatWritable","callback","chunks","stream","write","chunk","_encoding","next","push","on","Buffer","concat","splice"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,eAAe;AAIxC,eAAe,SAASC,eAAeC,QAAkB;IACvD,MAAMC,SAAS,EAAE;IACjB,MAAMC,SAAS,IAAIJ,SAAS;QAC1BK,OAAO,CAACC,OAAOC,WAAWC;YACxBL,OAAOM,IAAI,CAACH;YACZE;QACF;IACF;IACAJ,OAAOM,EAAE,CAAC,UAAU,IAAMR,SAASS,OAAOC,MAAM,CAACT,OAAOU,MAAM,CAAC;IAC/D,OAAOT;AACT"}
@@ -2,5 +2,9 @@
2
2
  * Compatibility Layer for Node.js 0.8+
3
3
  * Local to this package - contains only needed functions.
4
4
  */
5
+ export declare const Readable: typeof import('stream').Readable;
6
+ export declare const Writable: typeof import('stream').Writable;
7
+ export declare const Transform: typeof import('stream').Transform;
8
+ export declare const PassThrough: typeof import('stream').PassThrough;
5
9
  export declare function stringEndsWith(str: string, search: string, position?: number): boolean;
6
10
  export declare function arrayFind<T>(arr: T[], predicate: (item: T, index: number, arr: T[]) => boolean): T | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawn-term",
3
- "version": "3.3.6",
3
+ "version": "3.4.0",
4
4
  "description": "Formats spawn with for terminal grouping",
5
5
  "keywords": [
6
6
  "spawn",