diff --git a/package-lock.json b/package-lock.json index 5c67314..30105f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,7 @@ ], "dependencies": { "async-mutex": "^0.3.2", - "cross-spawn": "^7.0.3", - "ts-replace-all": "^1.0.0" + "cross-spawn": "^7.0.3" }, "devDependencies": { "@types/cross-spawn": "^6.0.2", @@ -1852,16 +1851,6 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/core-js": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.17.3.tgz", - "integrity": "sha512-lyvajs+wd8N1hXfzob1LdOCCHFU4bGMbqqmLn1Q4QlCpDqWPpGf+p0nj+LNrvDDG33j0hZXw2nsvvVpHysxyNw==", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -4900,14 +4889,6 @@ } } }, - "node_modules/ts-replace-all": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ts-replace-all/-/ts-replace-all-1.0.0.tgz", - "integrity": "sha512-6uBtdkw3jHXkPtx/e9xB/5vcngMm17CyJYsS2YZeQ+9FdRnt6Ev5g931Sg2p+dxbtMGoCm13m3ax/obicTZIkQ==", - "dependencies": { - "core-js": "^3.4.1" - } - }, "node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -6642,11 +6623,6 @@ "safe-buffer": "~5.1.1" } }, - "core-js": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.17.3.tgz", - "integrity": "sha512-lyvajs+wd8N1hXfzob1LdOCCHFU4bGMbqqmLn1Q4QlCpDqWPpGf+p0nj+LNrvDDG33j0hZXw2nsvvVpHysxyNw==" - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8928,14 +8904,6 @@ "yargs-parser": "20.x" } }, - "ts-replace-all": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ts-replace-all/-/ts-replace-all-1.0.0.tgz", - "integrity": "sha512-6uBtdkw3jHXkPtx/e9xB/5vcngMm17CyJYsS2YZeQ+9FdRnt6Ev5g931Sg2p+dxbtMGoCm13m3ax/obicTZIkQ==", - "requires": { - "core-js": "^3.4.1" - } - }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", diff --git a/package.json b/package.json index 22874bb..9177577 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,7 @@ }, "dependencies": { "async-mutex": "^0.3.2", - "cross-spawn": "^7.0.3", - "ts-replace-all": "^1.0.0" + "cross-spawn": "^7.0.3" }, "devDependencies": { "@types/cross-spawn": "^6.0.2", diff --git a/src/index.ts b/src/index.ts index bc47fdd..6ba51fc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,6 @@ import { spawn, exec, ChildProcess, SpawnOptionsWithoutStdio } from 'child_proce import { Readable, Writable } from 'stream'; import { Mutex } from 'async-mutex'; import { promisify } from 'util'; -import 'ts-replace-all'; const execute = promisify(exec); @@ -233,7 +232,7 @@ export class PythonInteractive { stdout.on('data', function (data) { stdoutData += data; if (stdoutData.includes('#StdoutEnd#')) { - stdoutData = stdoutData.replaceAll('#StdoutEnd#', ''); + stdoutData = stdoutData.replace(/#StdoutEnd#/g, ''); stdoutDone = true; done(); } @@ -254,7 +253,7 @@ export class PythonInteractive { stderr.on('data', function (data) { stderrData += data; if (stderrData.includes('#StderrEnd#')) { - stderrData = stderrData.replaceAll('#StderrEnd#', ''); + stderrData = stderrData.replace(/#StderrEnd#/g, ''); stderrDone = true; done(); }