@theia/process 1.34.2 → 1.34.3

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.
Files changed (70) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +30 -30
  3. package/lib/common/process-common-module.d.ts +3 -3
  4. package/lib/common/process-common-module.js +22 -22
  5. package/lib/common/process-manager-types.d.ts +35 -35
  6. package/lib/common/process-manager-types.js +23 -23
  7. package/lib/common/shell-command-builder.d.ts +49 -49
  8. package/lib/common/shell-command-builder.js +174 -174
  9. package/lib/common/shell-command-builder.slow-spec.d.ts +9 -9
  10. package/lib/common/shell-command-builder.slow-spec.js +404 -404
  11. package/lib/common/shell-quoting.d.ts +91 -91
  12. package/lib/common/shell-quoting.js +145 -145
  13. package/lib/common/shell-quoting.spec.d.ts +1 -1
  14. package/lib/common/shell-quoting.spec.js +170 -170
  15. package/lib/node/dev-null-stream.d.ts +17 -17
  16. package/lib/node/dev-null-stream.js +41 -41
  17. package/lib/node/index.d.ts +6 -6
  18. package/lib/node/index.js +33 -33
  19. package/lib/node/multi-ring-buffer.d.ts +68 -68
  20. package/lib/node/multi-ring-buffer.js +310 -310
  21. package/lib/node/multi-ring-buffer.spec.d.ts +1 -1
  22. package/lib/node/multi-ring-buffer.spec.js +422 -422
  23. package/lib/node/process-backend-module.d.ts +3 -3
  24. package/lib/node/process-backend-module.js +56 -56
  25. package/lib/node/process-manager.d.ts +33 -33
  26. package/lib/node/process-manager.js +113 -113
  27. package/lib/node/process.d.ts +95 -95
  28. package/lib/node/process.js +153 -153
  29. package/lib/node/pseudo-pty.d.ts +22 -22
  30. package/lib/node/pseudo-pty.js +38 -38
  31. package/lib/node/raw-process.d.ts +45 -45
  32. package/lib/node/raw-process.js +115 -115
  33. package/lib/node/raw-process.spec.d.ts +1 -1
  34. package/lib/node/raw-process.spec.js +164 -164
  35. package/lib/node/task-terminal-process.d.ts +10 -10
  36. package/lib/node/task-terminal-process.js +47 -47
  37. package/lib/node/terminal-process.d.ts +49 -49
  38. package/lib/node/terminal-process.js +180 -180
  39. package/lib/node/terminal-process.spec.d.ts +1 -1
  40. package/lib/node/terminal-process.spec.js +89 -89
  41. package/lib/node/test/process-test-container.d.ts +2 -2
  42. package/lib/node/test/process-test-container.js +28 -28
  43. package/lib/node/utils.d.ts +16 -16
  44. package/lib/node/utils.js +77 -77
  45. package/package.json +4 -4
  46. package/src/common/process-common-module.ts +22 -22
  47. package/src/common/process-manager-types.ts +58 -58
  48. package/src/common/shell-command-builder.slow-spec.ts +486 -486
  49. package/src/common/shell-command-builder.ts +187 -187
  50. package/src/common/shell-quoting.spec.ts +176 -176
  51. package/src/common/shell-quoting.ts +236 -236
  52. package/src/common/tests/$weird(),file=name.js +1 -1
  53. package/src/common/tests/white space.js +1 -1
  54. package/src/node/dev-null-stream.ts +47 -47
  55. package/src/node/index.ts +22 -22
  56. package/src/node/multi-ring-buffer.spec.ts +486 -486
  57. package/src/node/multi-ring-buffer.ts +348 -348
  58. package/src/node/process-backend-module.ts +67 -67
  59. package/src/node/process-manager.ts +107 -107
  60. package/src/node/process.ts +207 -207
  61. package/src/node/pseudo-pty.ts +54 -54
  62. package/src/node/raw-process.spec.ts +199 -199
  63. package/src/node/raw-process.ts +156 -156
  64. package/src/node/string-argv.d.ts +21 -21
  65. package/src/node/task-terminal-process.ts +41 -41
  66. package/src/node/terminal-process.spec.ts +104 -104
  67. package/src/node/terminal-process.ts +198 -198
  68. package/src/node/test/process-fork-test.js +22 -22
  69. package/src/node/test/process-test-container.ts +27 -27
  70. package/src/node/utils.ts +79 -79
@@ -1,171 +1,171 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2020 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const chai_1 = require("chai");
19
- const shell_quoting_1 = require("./shell-quoting");
20
- describe('Shell arguments escaping:', () => {
21
- // Procedurally execute tests from this list of data.
22
- const testData = {
23
- bash: {
24
- // https://www.gnu.org/software/bash/manual/html_node/Quoting.html
25
- quotingFunctions: shell_quoting_1.BashQuotingFunctions,
26
- data: {
27
- ["escape" /* Escape */]: [
28
- { input: 'abc', expected: 'abc' },
29
- { input: 'ab c', expected: 'ab\\ c' },
30
- { input: 'ab"c', expected: 'ab\\"c' },
31
- { input: 'ab\'c', expected: 'ab\\\'c' },
32
- { input: 'ab\\ c\\', expected: 'ab\\\\\\ c\\\\' },
33
- {
34
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
35
- expected: 'setTimeout\\(\\(\\)\\ =\\>\\ \\{\\ console.log\\(1,\\ \\"2\\\'3\\"\\)\\;\\ \\},\\ 100\\)',
36
- },
37
- ],
38
- ["strong" /* Strong */]: [
39
- { input: 'abc', expected: '\'abc\'' },
40
- { input: 'ab c', expected: '\'ab c\'' },
41
- { input: 'ab"c', expected: '\'ab"c\'' },
42
- { input: 'ab\'c', expected: '\'ab\'"\'"\'c\'' },
43
- { input: 'ab\\ c\\', expected: '\'ab\\ c\\\'' },
44
- {
45
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
46
- expected: '\'setTimeout(() => { console.log(1, "2\'"\'"\'3"); }, 100)\'',
47
- },
48
- ],
49
- ["weak" /* Weak */]: [
50
- { input: 'abc', expected: '"abc"' },
51
- { input: 'ab c', expected: '"ab c"' },
52
- { input: 'ab"c', expected: '"ab\\"c"' },
53
- { input: 'ab\'c', expected: '"ab\'c"' },
54
- { input: 'ab\\ c\\', expected: '"ab\\ c\\\\"' },
55
- {
56
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
57
- expected: '"setTimeout(() => { console.log(1, \\"2\'3\\"); }, 100)"',
58
- },
59
- ]
60
- },
61
- },
62
- cmd: {
63
- // https://ss64.com/nt/syntax-esc.html
64
- quotingFunctions: shell_quoting_1.CmdQuotingFunctions,
65
- data: {
66
- ["escape" /* Escape */]: [
67
- { input: 'abc', expected: 'abc' },
68
- { input: 'ab c', expected: 'ab" "c' },
69
- { input: 'ab"c', expected: 'ab\\"c' },
70
- { input: 'ab\'c', expected: 'ab\'c' },
71
- { input: 'ab^ c^', expected: 'ab^^" "c^^' },
72
- {
73
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
74
- expected: 'setTimeout^(^(^)" "=^>" "{" "console.log^(1," "\\"2\'3\\"^);" "}," "100^)',
75
- },
76
- {
77
- input: 'console.log("%PATH%")',
78
- expected: 'console.log^(\\"^%PATH^%\\"^)',
79
- },
80
- ],
81
- ["strong" /* Strong */]: [
82
- { input: 'abc', expected: '"abc"' },
83
- { input: 'ab c', expected: '"ab c"' },
84
- { input: 'ab"c', expected: '"ab\\"c"' },
85
- { input: 'ab\'c', expected: '"ab\'c"' },
86
- { input: 'ab^ c^', expected: '"ab^^ c^^"' },
87
- {
88
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
89
- expected: '"setTimeout^(^(^) =^> { console.log^(1, \\"2\'3\\"^); }, 100^)"',
90
- },
91
- {
92
- input: 'console.log("%PATH%")',
93
- expected: '"console.log^(\\""%"PATH"%"\\"^)"',
94
- },
95
- ],
96
- ["weak" /* Weak */]: [
97
- { input: 'abc', expected: '"abc"' },
98
- { input: 'ab c', expected: '"ab c"' },
99
- { input: 'ab"c', expected: '"ab\\"c"' },
100
- { input: 'ab\'c', expected: '"ab\'c"' },
101
- { input: 'ab^ c^', expected: '"ab^^ c^^"' },
102
- {
103
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
104
- expected: '"setTimeout^(^(^) =^> { console.log^(1, \\"2\'3\\"^); }, 100^)"',
105
- },
106
- {
107
- input: 'console.log("%PATH%")',
108
- expected: '"console.log^(\\"%PATH%\\"^)"',
109
- },
110
- ]
111
- },
112
- },
113
- powershell: {
114
- // https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-6
115
- quotingFunctions: shell_quoting_1.PowershellQuotingFunctions,
116
- data: {
117
- ["escape" /* Escape */]: [
118
- { input: 'abc', expected: 'abc' },
119
- { input: 'ab c', expected: 'ab` c' },
120
- { input: 'ab"c', expected: 'ab`"c' },
121
- { input: 'ab\'c', expected: 'ab`\'c' },
122
- { input: 'ab` c`', expected: 'ab``` c``' },
123
- {
124
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
125
- expected: 'setTimeout`(`(`)` =`>` `{` console.log`(1,` `"2`\'3`"`)`;` `},` 100`)',
126
- },
127
- ],
128
- ["strong" /* Strong */]: [
129
- { input: 'abc', expected: '\'abc\'' },
130
- { input: 'ab c', expected: '\'ab c\'' },
131
- { input: 'ab"c', expected: '\'ab"c\'' },
132
- { input: 'ab\'c', expected: '\'ab\'\'c\'' },
133
- { input: 'ab` c`', expected: '\'ab` c`\'' },
134
- {
135
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
136
- expected: '\'setTimeout(() => { console.log(1, "2\'\'3"); }, 100)\'',
137
- },
138
- ],
139
- ["weak" /* Weak */]: [
140
- { input: 'abc', expected: '"abc"' },
141
- { input: 'ab c', expected: '"ab c"' },
142
- { input: 'ab"c', expected: '"ab`"c"' },
143
- { input: 'ab\'c', expected: '"ab\'c"' },
144
- { input: 'ab` c`', expected: '"ab` c``"' },
145
- {
146
- input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
147
- expected: '"setTimeout(() => { console.log(1, `"2\'3`"); }, 100)"',
148
- },
149
- ]
150
- },
151
- }
152
- };
153
- // Iter through each runtime (bash/cmd/powershell):
154
- for (const runtime of Object.keys(testData)) {
155
- const testInfo = testData[runtime];
156
- // Get all quoting types (escape/strong/weak):
157
- for (const quotingType of Object.keys(testInfo.data)) {
158
- const testInput = testInfo.data[quotingType];
159
- // Run the test for each input:
160
- it(`${runtime}/${quotingType}`, () => {
161
- for (const test of testInput) {
162
- (0, chai_1.expect)((0, shell_quoting_1.escapeForShell)({
163
- quoting: quotingType,
164
- value: test.input,
165
- }, testInfo.quotingFunctions)).equal(test.expected);
166
- }
167
- });
168
- }
169
- }
170
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2020 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const chai_1 = require("chai");
19
+ const shell_quoting_1 = require("./shell-quoting");
20
+ describe('Shell arguments escaping:', () => {
21
+ // Procedurally execute tests from this list of data.
22
+ const testData = {
23
+ bash: {
24
+ // https://www.gnu.org/software/bash/manual/html_node/Quoting.html
25
+ quotingFunctions: shell_quoting_1.BashQuotingFunctions,
26
+ data: {
27
+ ["escape" /* Escape */]: [
28
+ { input: 'abc', expected: 'abc' },
29
+ { input: 'ab c', expected: 'ab\\ c' },
30
+ { input: 'ab"c', expected: 'ab\\"c' },
31
+ { input: 'ab\'c', expected: 'ab\\\'c' },
32
+ { input: 'ab\\ c\\', expected: 'ab\\\\\\ c\\\\' },
33
+ {
34
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
35
+ expected: 'setTimeout\\(\\(\\)\\ =\\>\\ \\{\\ console.log\\(1,\\ \\"2\\\'3\\"\\)\\;\\ \\},\\ 100\\)',
36
+ },
37
+ ],
38
+ ["strong" /* Strong */]: [
39
+ { input: 'abc', expected: '\'abc\'' },
40
+ { input: 'ab c', expected: '\'ab c\'' },
41
+ { input: 'ab"c', expected: '\'ab"c\'' },
42
+ { input: 'ab\'c', expected: '\'ab\'"\'"\'c\'' },
43
+ { input: 'ab\\ c\\', expected: '\'ab\\ c\\\'' },
44
+ {
45
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
46
+ expected: '\'setTimeout(() => { console.log(1, "2\'"\'"\'3"); }, 100)\'',
47
+ },
48
+ ],
49
+ ["weak" /* Weak */]: [
50
+ { input: 'abc', expected: '"abc"' },
51
+ { input: 'ab c', expected: '"ab c"' },
52
+ { input: 'ab"c', expected: '"ab\\"c"' },
53
+ { input: 'ab\'c', expected: '"ab\'c"' },
54
+ { input: 'ab\\ c\\', expected: '"ab\\ c\\\\"' },
55
+ {
56
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
57
+ expected: '"setTimeout(() => { console.log(1, \\"2\'3\\"); }, 100)"',
58
+ },
59
+ ]
60
+ },
61
+ },
62
+ cmd: {
63
+ // https://ss64.com/nt/syntax-esc.html
64
+ quotingFunctions: shell_quoting_1.CmdQuotingFunctions,
65
+ data: {
66
+ ["escape" /* Escape */]: [
67
+ { input: 'abc', expected: 'abc' },
68
+ { input: 'ab c', expected: 'ab" "c' },
69
+ { input: 'ab"c', expected: 'ab\\"c' },
70
+ { input: 'ab\'c', expected: 'ab\'c' },
71
+ { input: 'ab^ c^', expected: 'ab^^" "c^^' },
72
+ {
73
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
74
+ expected: 'setTimeout^(^(^)" "=^>" "{" "console.log^(1," "\\"2\'3\\"^);" "}," "100^)',
75
+ },
76
+ {
77
+ input: 'console.log("%PATH%")',
78
+ expected: 'console.log^(\\"^%PATH^%\\"^)',
79
+ },
80
+ ],
81
+ ["strong" /* Strong */]: [
82
+ { input: 'abc', expected: '"abc"' },
83
+ { input: 'ab c', expected: '"ab c"' },
84
+ { input: 'ab"c', expected: '"ab\\"c"' },
85
+ { input: 'ab\'c', expected: '"ab\'c"' },
86
+ { input: 'ab^ c^', expected: '"ab^^ c^^"' },
87
+ {
88
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
89
+ expected: '"setTimeout^(^(^) =^> { console.log^(1, \\"2\'3\\"^); }, 100^)"',
90
+ },
91
+ {
92
+ input: 'console.log("%PATH%")',
93
+ expected: '"console.log^(\\""%"PATH"%"\\"^)"',
94
+ },
95
+ ],
96
+ ["weak" /* Weak */]: [
97
+ { input: 'abc', expected: '"abc"' },
98
+ { input: 'ab c', expected: '"ab c"' },
99
+ { input: 'ab"c', expected: '"ab\\"c"' },
100
+ { input: 'ab\'c', expected: '"ab\'c"' },
101
+ { input: 'ab^ c^', expected: '"ab^^ c^^"' },
102
+ {
103
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
104
+ expected: '"setTimeout^(^(^) =^> { console.log^(1, \\"2\'3\\"^); }, 100^)"',
105
+ },
106
+ {
107
+ input: 'console.log("%PATH%")',
108
+ expected: '"console.log^(\\"%PATH%\\"^)"',
109
+ },
110
+ ]
111
+ },
112
+ },
113
+ powershell: {
114
+ // https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-6
115
+ quotingFunctions: shell_quoting_1.PowershellQuotingFunctions,
116
+ data: {
117
+ ["escape" /* Escape */]: [
118
+ { input: 'abc', expected: 'abc' },
119
+ { input: 'ab c', expected: 'ab` c' },
120
+ { input: 'ab"c', expected: 'ab`"c' },
121
+ { input: 'ab\'c', expected: 'ab`\'c' },
122
+ { input: 'ab` c`', expected: 'ab``` c``' },
123
+ {
124
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
125
+ expected: 'setTimeout`(`(`)` =`>` `{` console.log`(1,` `"2`\'3`"`)`;` `},` 100`)',
126
+ },
127
+ ],
128
+ ["strong" /* Strong */]: [
129
+ { input: 'abc', expected: '\'abc\'' },
130
+ { input: 'ab c', expected: '\'ab c\'' },
131
+ { input: 'ab"c', expected: '\'ab"c\'' },
132
+ { input: 'ab\'c', expected: '\'ab\'\'c\'' },
133
+ { input: 'ab` c`', expected: '\'ab` c`\'' },
134
+ {
135
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
136
+ expected: '\'setTimeout(() => { console.log(1, "2\'\'3"); }, 100)\'',
137
+ },
138
+ ],
139
+ ["weak" /* Weak */]: [
140
+ { input: 'abc', expected: '"abc"' },
141
+ { input: 'ab c', expected: '"ab c"' },
142
+ { input: 'ab"c', expected: '"ab`"c"' },
143
+ { input: 'ab\'c', expected: '"ab\'c"' },
144
+ { input: 'ab` c`', expected: '"ab` c``"' },
145
+ {
146
+ input: 'setTimeout(() => { console.log(1, "2\'3"); }, 100)',
147
+ expected: '"setTimeout(() => { console.log(1, `"2\'3`"); }, 100)"',
148
+ },
149
+ ]
150
+ },
151
+ }
152
+ };
153
+ // Iter through each runtime (bash/cmd/powershell):
154
+ for (const runtime of Object.keys(testData)) {
155
+ const testInfo = testData[runtime];
156
+ // Get all quoting types (escape/strong/weak):
157
+ for (const quotingType of Object.keys(testInfo.data)) {
158
+ const testInput = testInfo.data[quotingType];
159
+ // Run the test for each input:
160
+ it(`${runtime}/${quotingType}`, () => {
161
+ for (const test of testInput) {
162
+ (0, chai_1.expect)((0, shell_quoting_1.escapeForShell)({
163
+ quoting: quotingType,
164
+ value: test.input,
165
+ }, testInfo.quotingFunctions)).equal(test.expected);
166
+ }
167
+ });
168
+ }
169
+ }
170
+ });
171
171
  //# sourceMappingURL=shell-quoting.spec.js.map
@@ -1,18 +1,18 @@
1
- /// <reference types="node" />
2
- import stream = require('stream');
3
- /**
4
- * A Node stream like `/dev/null`.
5
- *
6
- * Writing goes to a black hole, reading returns `EOF`.
7
- */
8
- export declare class DevNullStream extends stream.Duplex {
9
- constructor(options?: {
10
- /**
11
- * Makes this stream call `destroy` on itself, emitting the `close` event.
12
- */
13
- autoDestroy?: boolean;
14
- });
15
- _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
16
- _read(size: number): void;
17
- }
1
+ /// <reference types="node" />
2
+ import stream = require('stream');
3
+ /**
4
+ * A Node stream like `/dev/null`.
5
+ *
6
+ * Writing goes to a black hole, reading returns `EOF`.
7
+ */
8
+ export declare class DevNullStream extends stream.Duplex {
9
+ constructor(options?: {
10
+ /**
11
+ * Makes this stream call `destroy` on itself, emitting the `close` event.
12
+ */
13
+ autoDestroy?: boolean;
14
+ });
15
+ _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
16
+ _read(size: number): void;
17
+ }
18
18
  //# sourceMappingURL=dev-null-stream.d.ts.map
@@ -1,42 +1,42 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.DevNullStream = void 0;
19
- const stream = require("stream");
20
- /**
21
- * A Node stream like `/dev/null`.
22
- *
23
- * Writing goes to a black hole, reading returns `EOF`.
24
- */
25
- class DevNullStream extends stream.Duplex {
26
- constructor(options = {}) {
27
- super();
28
- if (options.autoDestroy) {
29
- this.destroy();
30
- }
31
- }
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- _write(chunk, encoding, callback) {
34
- callback();
35
- }
36
- _read(size) {
37
- // eslint-disable-next-line no-null/no-null
38
- this.push(null);
39
- }
40
- }
41
- exports.DevNullStream = DevNullStream;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DevNullStream = void 0;
19
+ const stream = require("stream");
20
+ /**
21
+ * A Node stream like `/dev/null`.
22
+ *
23
+ * Writing goes to a black hole, reading returns `EOF`.
24
+ */
25
+ class DevNullStream extends stream.Duplex {
26
+ constructor(options = {}) {
27
+ super();
28
+ if (options.autoDestroy) {
29
+ this.destroy();
30
+ }
31
+ }
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ _write(chunk, encoding, callback) {
34
+ callback();
35
+ }
36
+ _read(size) {
37
+ // eslint-disable-next-line no-null/no-null
38
+ this.push(null);
39
+ }
40
+ }
41
+ exports.DevNullStream = DevNullStream;
42
42
  //# sourceMappingURL=dev-null-stream.js.map
@@ -1,7 +1,7 @@
1
- export * from './process-manager';
2
- export * from './process';
3
- export * from './raw-process';
4
- export * from './terminal-process';
5
- export * from './task-terminal-process';
6
- export * from './multi-ring-buffer';
1
+ export * from './process-manager';
2
+ export * from './process';
3
+ export * from './raw-process';
4
+ export * from './terminal-process';
5
+ export * from './task-terminal-process';
6
+ export * from './multi-ring-buffer';
7
7
  //# sourceMappingURL=index.d.ts.map
package/lib/node/index.js CHANGED
@@ -1,34 +1,34 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- __exportStar(require("./process-manager"), exports);
29
- __exportStar(require("./process"), exports);
30
- __exportStar(require("./raw-process"), exports);
31
- __exportStar(require("./terminal-process"), exports);
32
- __exportStar(require("./task-terminal-process"), exports);
33
- __exportStar(require("./multi-ring-buffer"), exports);
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ __exportStar(require("./process-manager"), exports);
29
+ __exportStar(require("./process"), exports);
30
+ __exportStar(require("./raw-process"), exports);
31
+ __exportStar(require("./terminal-process"), exports);
32
+ __exportStar(require("./task-terminal-process"), exports);
33
+ __exportStar(require("./multi-ring-buffer"), exports);
34
34
  //# sourceMappingURL=index.js.map