spawn-term 0.1.46 → 0.1.47
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.
|
@@ -8,25 +8,14 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return addLines;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var _newlineiterator = /*#__PURE__*/ _interop_require_default(require("newline-iterator"));
|
|
12
11
|
var _readablestream = require("readable-stream");
|
|
13
|
-
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
12
|
+
var REGEX_NEW_LINE = /\r?\n|\r/g;
|
|
18
13
|
function addLines(fn) {
|
|
19
14
|
var last = '';
|
|
20
15
|
var stream = new _readablestream.Writable({
|
|
21
16
|
write: function write(chunk, _enc, callback) {
|
|
22
|
-
var
|
|
23
|
-
var lines =
|
|
24
|
-
var iterator = (0, _newlineiterator.default)(string);
|
|
25
|
-
var next = iterator.next();
|
|
26
|
-
while(!next.done){
|
|
27
|
-
lines.push(next.value);
|
|
28
|
-
next = iterator.next();
|
|
29
|
-
}
|
|
17
|
+
var more = last + chunk.toString('utf8');
|
|
18
|
+
var lines = more.split(REGEX_NEW_LINE);
|
|
30
19
|
last = lines.pop();
|
|
31
20
|
if (lines.length > 0) fn(lines);
|
|
32
21
|
callback();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/addLines.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/addLines.ts"],"sourcesContent":["import { Writable } from 'readable-stream';\n\nconst REGEX_NEW_LINE = /\\r?\\n|\\r/g;\n\nexport default function addLines(fn) {\n let last = '';\n\n const stream = new Writable({\n write(chunk, _enc, callback) {\n const more = last + chunk.toString('utf8');\n const lines = more.split(REGEX_NEW_LINE);\n last = lines.pop();\n if (lines.length > 0) fn(lines);\n callback();\n },\n });\n stream.on('finish', () => {\n if (last.length) fn([last]);\n last = '';\n });\n return stream;\n}\n"],"names":["addLines","REGEX_NEW_LINE","fn","last","stream","Writable","write","chunk","_enc","callback","more","toString","lines","split","pop","length","on"],"mappings":";;;;+BAIA;;;eAAwBA;;;8BAJC;AAEzB,IAAMC,iBAAiB;AAER,SAASD,SAASE,EAAE;IACjC,IAAIC,OAAO;IAEX,IAAMC,SAAS,IAAIC,wBAAQ,CAAC;QAC1BC,OAAAA,SAAAA,MAAMC,KAAK,EAAEC,IAAI,EAAEC,QAAQ;YACzB,IAAMC,OAAOP,OAAOI,MAAMI,QAAQ,CAAC;YACnC,IAAMC,QAAQF,KAAKG,KAAK,CAACZ;YACzBE,OAAOS,MAAME,GAAG;YAChB,IAAIF,MAAMG,MAAM,GAAG,GAAGb,GAAGU;YACzBH;QACF;IACF;IACAL,OAAOY,EAAE,CAAC,UAAU;QAClB,IAAIb,KAAKY,MAAM,EAAEb,GAAG;YAACC;SAAK;QAC1BA,OAAO;IACT;IACA,OAAOC;AACT"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import newlineIterator from 'newline-iterator';
|
|
2
1
|
import { Writable } from 'readable-stream';
|
|
2
|
+
const REGEX_NEW_LINE = /\r?\n|\r/g;
|
|
3
3
|
export default function addLines(fn) {
|
|
4
4
|
let last = '';
|
|
5
5
|
const stream = new Writable({
|
|
6
6
|
write (chunk, _enc, callback) {
|
|
7
|
-
const
|
|
8
|
-
const lines =
|
|
9
|
-
const iterator = newlineIterator(string);
|
|
10
|
-
let next = iterator.next();
|
|
11
|
-
while(!next.done){
|
|
12
|
-
lines.push(next.value);
|
|
13
|
-
next = iterator.next();
|
|
14
|
-
}
|
|
7
|
+
const more = last + chunk.toString('utf8');
|
|
8
|
+
const lines = more.split(REGEX_NEW_LINE);
|
|
15
9
|
last = lines.pop();
|
|
16
10
|
if (lines.length > 0) fn(lines);
|
|
17
11
|
callback();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/addLines.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/lib/addLines.ts"],"sourcesContent":["import { Writable } from 'readable-stream';\n\nconst REGEX_NEW_LINE = /\\r?\\n|\\r/g;\n\nexport default function addLines(fn) {\n let last = '';\n\n const stream = new Writable({\n write(chunk, _enc, callback) {\n const more = last + chunk.toString('utf8');\n const lines = more.split(REGEX_NEW_LINE);\n last = lines.pop();\n if (lines.length > 0) fn(lines);\n callback();\n },\n });\n stream.on('finish', () => {\n if (last.length) fn([last]);\n last = '';\n });\n return stream;\n}\n"],"names":["Writable","REGEX_NEW_LINE","addLines","fn","last","stream","write","chunk","_enc","callback","more","toString","lines","split","pop","length","on"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,kBAAkB;AAE3C,MAAMC,iBAAiB;AAEvB,eAAe,SAASC,SAASC,EAAE;IACjC,IAAIC,OAAO;IAEX,MAAMC,SAAS,IAAIL,SAAS;QAC1BM,OAAMC,KAAK,EAAEC,IAAI,EAAEC,QAAQ;YACzB,MAAMC,OAAON,OAAOG,MAAMI,QAAQ,CAAC;YACnC,MAAMC,QAAQF,KAAKG,KAAK,CAACZ;YACzBG,OAAOQ,MAAME,GAAG;YAChB,IAAIF,MAAMG,MAAM,GAAG,GAAGZ,GAAGS;YACzBH;QACF;IACF;IACAJ,OAAOW,EAAE,CAAC,UAAU;QAClB,IAAIZ,KAAKW,MAAM,EAAEZ,GAAG;YAACC;SAAK;QAC1BA,OAAO;IACT;IACA,OAAOC;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spawn-term",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "Formats spawn with for terminal grouping",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"spawn",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"core-js": "^3.40.0",
|
|
44
44
|
"cross-spawn-cb": "^2.1.22",
|
|
45
45
|
"lil-uuid": "^0.1.1",
|
|
46
|
-
"newline-iterator": "^0.3.29",
|
|
47
46
|
"on-one": "^0.1.4",
|
|
48
47
|
"queue-cb": "^1.4.16",
|
|
49
48
|
"react": "^18.3.1",
|