@gkalpak/cli-utils 0.1.10 → 0.2.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.
- package/jsconfig.json +35 -0
- package/out/bin/expand-cmd.js.map +1 -1
- package/out/bin/run.js.map +1 -1
- package/out/bin/tsconfig.tsbuildinfo +1 -0
- package/out/lib/command-utils.d.ts +1 -1
- package/out/lib/command-utils.d.ts.map +1 -1
- package/out/lib/command-utils.js +73 -79
- package/out/lib/command-utils.js.map +1 -1
- package/out/lib/internal-utils.d.ts +12 -0
- package/out/lib/internal-utils.d.ts.map +1 -1
- package/out/lib/internal-utils.js +22 -6
- package/out/lib/internal-utils.js.map +1 -1
- package/out/lib/process-utils.d.ts +0 -1
- package/out/lib/process-utils.d.ts.map +1 -1
- package/out/lib/process-utils.js +2 -2
- package/out/lib/process-utils.js.map +1 -1
- package/out/lib/testing-utils.d.ts +0 -1
- package/out/lib/testing-utils.d.ts.map +1 -1
- package/out/lib/testing-utils.js +5 -9
- package/out/lib/testing-utils.js.map +1 -1
- package/out/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +24 -17
- package/src/bin/expand-cmd.ts +1 -1
- package/src/bin/run.ts +1 -1
- package/src/bin/tsconfig.json +14 -0
- package/src/lib/command-utils.ts +20 -20
- package/src/lib/internal-utils.ts +28 -5
- package/src/lib/process-utils.ts +2 -2
- package/src/lib/testing-utils.ts +3 -5
- package/src/lib/tsconfig.json +11 -0
- package/tsconfig.json +32 -13
package/jsconfig.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowUnreachableCode": false,
|
|
4
|
+
"allowUnusedLabels": false,
|
|
5
|
+
"checkJs": true,
|
|
6
|
+
"exactOptionalPropertyTypes": true,
|
|
7
|
+
"lib": [
|
|
8
|
+
"ES2022",
|
|
9
|
+
],
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"moduleResolution": "Node",
|
|
12
|
+
"newLine": "lf",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"noFallthroughCasesInSwitch": true,
|
|
15
|
+
"noImplicitAny": false,
|
|
16
|
+
"noImplicitOverride": true,
|
|
17
|
+
"noImplicitReturns": true,
|
|
18
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"resolveJsonModule": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"strict": true,
|
|
25
|
+
"target": "ES2022",
|
|
26
|
+
},
|
|
27
|
+
"exclude": [
|
|
28
|
+
"./node_modules/",
|
|
29
|
+
"./out/",
|
|
30
|
+
"./src/",
|
|
31
|
+
],
|
|
32
|
+
"include": [
|
|
33
|
+
"./",
|
|
34
|
+
],
|
|
35
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand-cmd.js","sourceRoot":"","sources":["../../src/bin/expand-cmd.ts"],"names":[],"mappings":";;;AACA,wDAAkD;AAClD,0DAAoD;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"expand-cmd.js","sourceRoot":"","sources":["../../src/bin/expand-cmd.ts"],"names":[],"mappings":";;;AACA,wDAAkD;AAClD,0DAAoD;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,GAAG,4BAAY,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAE5D,4BAAY;QACV,SAAS,CAAC,GAAa,EAAE,IAAI,EAAE,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,8BAAa,CAAC,OAAO,CAAC,IAAI,CAAC,8BAAa,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
package/out/bin/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/bin/run.ts"],"names":[],"mappings":";;;AACA,wDAAkD;AAClD,0DAAoD;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/bin/run.ts"],"names":[],"mappings":";;;AACA,wDAAkD;AAClD,0DAAoD;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,GAAG,4BAAY,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAE5D,4BAAY;QACV,GAAG,CAAC,GAAa,EAAE,IAAI,EAAE,MAAM,CAAC;QAChC,KAAK,CAAC,8BAAa,CAAC,OAAO,CAAC,IAAI,CAAC,8BAAa,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/tslib/tslib.d.ts","../lib/command-utils.d.ts","../lib/internal-utils.d.ts","../../src/bin/expand-cmd.ts","../../src/bin/run.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/globals.global.d.ts","../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"4a882ffbb4ed09d9b7734f784aebb1dfe488d63725c40759165c5d9c657ca029","8144cfc881544706b4a8d691bfd46c7358c76558d44591b3ca5fd3a68c393ccd","68a6f97633a9195418052107e759c8e5d12c061e3a2d393af4581c447099fb98",{"version":"9ca276b432fd712adc2fa99fde75cc5df572c473d1c9eecd02c5dc52f9d51273","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},{"version":"c0e7e0a15732364d3fa38b65eb1628a1f5060b49f078e8b277eb9d0a7190998a","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},"2db0dd3aaa2ed285950273ce96ae8a450b45423aa9da2d10e194570f1233fa6b","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"e7be367719c613d580d4b27fdf8fe64c9736f48217f4b322c0d63b2971460918","affectsGlobalScope":true},"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"392eadc2af403dd10b4debfbc655c089a7fa6a9750caeb770cfb30051e55e848","affectsGlobalScope":true},"62f1c00d3d246e0e3cf0224f91e122d560428ec1ccc36bb51d4574a84f1dbad0","53f0960fdcc53d097918adfd8861ffbe0db989c56ffc16c052197bf115da5ed6",{"version":"662163e5327f260b23ca0a1a1ad8a74078aabb587c904fcb5ef518986987eaff","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"c48c503c6b3f63baf18257e9a87559b5602a4e960107c762586d2a6a62b64a18","affectsGlobalScope":true},"b0c0d1d13be149f790a75b381b413490f98558649428bb916fd2d71a3f47a134","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","0364f8bb461d6e84252412d4e5590feda4eb582f77d47f7a024a7a9ff105dfdc","5433f7f77cd1fd53f45bd82445a4e437b2f6a72a32070e907530a4fea56c30c8","d0ca5d7df114035258a9d01165be309371fcccf0cccd9d57b1453204686d1ed0",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"9a30b7fefd7f8abbca4828d481c61c18e40fe5ff107e113b1c1fcd2c8dcf2743","affectsGlobalScope":true},"173b6275a81ebdb283b180654890f46516c21199734fed01a773b1c168b8c45c","304f66274aa8119e8d65a49b1cff84cbf803def6afe1b2cc987386e9a9890e22","1b9adafe8a7fefaeaf9099a0e06f602903f6268438147b843a33a5233ac71745","98273274f2dbb79b0b2009b20f74eca4a7146a3447c912d580cd5d2d94a7ae30","c933f7ba4b201c98b14275fd11a14abb950178afd2074703250fe3654fc10cd2","2eaa31492906bc8525aff3c3ec2236e22d90b0dfeee77089f196cd0adf0b3e3b",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"8f5814f29dbaf8bacd1764aebdf1c8a6eb86381f6a188ddbac0fcbaab855ce52","a63d03de72adfb91777784015bd3b4125abd2f5ef867fc5a13920b5649e8f52b","d20e003f3d518a7c1f749dbe27c6ab5e3be7b3c905a48361b04a9557de4a6900",{"version":"1d4d78c8b23c9ddaaaa49485e6adc2ec01086dfe5d8d4d36ca4cdc98d2f7e74a","affectsGlobalScope":true},{"version":"44fc16356b81c0463cc7d7b2b35dcf324d8144136f5bc5ce73ced86f2b3475b5","affectsGlobalScope":true},"575fb200043b11b464db8e42cc64379c5fd322b6d787638e005b5ee98a64486d","6de2f225d942562733e231a695534b30039bdf1875b377bb7255881f0df8ede8","56249fd3ef1f6b90888e606f4ea648c43978ef43a7263aafad64f8d83cd3b8aa","139ad1dc93a503da85b7a0d5f615bddbae61ad796bc68fedd049150db67a1e26","7b166975fdbd3b37afb64707b98bca88e46577bbc6c59871f9383a7df2daacd1","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","81505c54d7cad0009352eaa21bd923ab7cdee7ec3405357a54d9a5da033a2084","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","3c1f19c7abcda6b3a4cf9438a15c7307a080bd3b51dfd56b198d9f86baf19447","2ee1645e0df9d84467cfe1d67b0ad3003c2f387de55874d565094464ee6f2927",{"version":"7da97d603bf3dd0000f56467c56cb6efaf5f94692980474925fae6c33412b12a","affectsGlobalScope":true},{"version":"9cf780e96b687e4bdfd1907ed26a688c18b89797490a00598fa8b8ab683335dd","affectsGlobalScope":true},"98e00f3613402504bc2a2c9a621800ab48e0a463d1eed062208a4ae98ad8f84c","9ae88ce9f73446c24b2d2452e993b676da1b31fca5ceb7276e7f36279f693ed1","e49d7625faff2a7842e4e7b9b197f972633fca685afcf6b4403400c97d087c36","b82c38abc53922b1b3670c3af6f333c21b735722a8f156e7d357a2da7c53a0a0",{"version":"b423f53647708043299ded4daa68d95c967a2ac30aa1437adc4442129d7d0a6c","affectsGlobalScope":true},{"version":"7245af181218216bacb01fbdf51095617a51661f20d77178c69a377e16fb69ed","affectsGlobalScope":true},"4f0fc7b7f54422bd97cfaf558ddb4bca86893839367b746a8f86b60ac7619673","4cdd8b6b51599180a387cc7c1c50f49eca5ce06595d781638fd0216520d98246","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"8704423bf338bff381ebc951ed819935d0252d90cd6de7dffe5b0a5debb65d07","affectsGlobalScope":true},"7c6929fd7cbf38499b6a600b91c3b603d1d78395046dc3499b2b92d01418b94b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"a42be67ed1ddaec743582f41fc219db96a1b69719fccac6d1464321178d610fc"],"root":[63,64],"options":{"allowUnreachableCode":false,"allowUnusedLabels":false,"composite":true,"declaration":true,"declarationMap":true,"exactOptionalPropertyTypes":true,"importHelpers":true,"module":1,"newLine":1,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"..","rootDir":"../../src","sourceMap":true,"strict":true,"target":9},"fileIdsList":[[65],[100],[101,106,135],[102,107,113,114,121,132,143],[102,103,113,121],[104,144],[105,106,114,122],[106,132,140],[107,109,113,121],[100,108],[109,110],[113],[111,113],[100,113],[113,114,115,132,143],[113,114,115,128,132,135],[98,101,148],[109,113,116,121,132,143],[113,114,116,117,121,132,140,143],[116,118,132,140,143],[65,66,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150],[113,119],[120,143,148],[109,113,121,132],[122],[123],[100,124],[121,122,125,142,148],[126],[127],[113,128,129],[128,130,144,146],[101,113,132,133,134,135],[101,132,134],[132,133],[135],[136],[100,132],[113,138,139],[138,139],[106,121,132,140],[141],[121,142],[101,116,127,143],[106,144],[132,145],[120,146],[147],[101,106,113,115,124,132,143,146,148],[132,149],[75,79,143],[75,132,143],[70],[72,75,140,143],[121,140],[151],[70,151],[72,75,121,143],[67,68,71,74,101,113,132,143],[67,73],[71,75,101,135,143,151],[101,151],[91,101,151],[69,70,151],[75],[69,70,71,72,73,74,75,76,77,79,80,81,82,83,84,85,86,87,88,89,90,92,93,94,95,96,97],[75,82,83],[73,75,83,84],[74],[67,70,75],[75,79,83,84],[79],[73,75,78,143],[67,72,73,75,79,82],[101,132],[70,75,91,101,148,151],[60,61,62]],"referencedMap":[[65,1],[66,1],[100,2],[101,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,11],[112,12],[111,13],[113,14],[114,15],[115,16],[99,17],[116,18],[117,19],[118,20],[151,21],[119,22],[120,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,31],[130,32],[132,33],[134,34],[133,35],[135,36],[136,37],[137,38],[138,39],[139,40],[140,41],[141,42],[142,43],[143,44],[144,45],[145,46],[146,47],[147,48],[148,49],[149,50],[82,51],[89,52],[81,51],[96,53],[73,54],[72,55],[95,56],[90,57],[93,58],[75,59],[74,60],[70,61],[69,62],[92,63],[71,64],[76,65],[80,65],[98,66],[97,65],[84,67],[85,68],[87,69],[83,70],[86,71],[91,56],[78,72],[79,73],[88,74],[68,75],[94,76],[63,77],[64,77]],"latestChangedDtsFile":"./run.d.ts"},"version":"5.5.3"}
|
|
@@ -136,7 +136,7 @@ export declare class CommandUtils {
|
|
|
136
136
|
private parseRawCmd;
|
|
137
137
|
private parseSingleCmd;
|
|
138
138
|
private transformForDryrun;
|
|
139
|
-
private
|
|
139
|
+
private cleanUpOutput;
|
|
140
140
|
}
|
|
141
141
|
export declare const commandUtils: CommandUtils;
|
|
142
142
|
//# sourceMappingURL=command-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-utils.d.ts","sourceRoot":"","sources":["../../src/lib/command-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-utils.d.ts","sourceRoot":"","sources":["../../src/lib/command-utils.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEhC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAQD,qBAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACU,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAuE/F;;;;;;;;;;;;;OAaG;IACI,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAC;IAkB9E;;;;;;;;;;;;;;;;OAgBG;IACU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO,EAAE,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAWnG;;;;;;;;;;;;;;;OAeG;IACI,eAAe,CAClB,MAAM,EAAE,MAAM,EACd,EAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,UAAc,EAAE,WAAW,EAAC,GAAE,UAAe,GAC5E,OAAO,CAAC,MAAM,CAAC;IAmFlB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,cAAc;IA+BtB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,aAAa;CAMtB;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
package/out/lib/command-utils.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commandUtils = exports.CommandUtils = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const stream_1 = require("stream");
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_stream_1 = require("node:stream");
|
|
7
6
|
const internal_utils_1 = require("./internal-utils");
|
|
8
7
|
const process_utils_1 = require("./process-utils");
|
|
9
8
|
class CommandUtils {
|
|
@@ -40,63 +39,61 @@ class CommandUtils {
|
|
|
40
39
|
* @return A promise that resolves with the expanded command, with arguments substituted (including running
|
|
41
40
|
* default/fallback value sub-commands, as necessary).
|
|
42
41
|
*/
|
|
43
|
-
expandCmd(cmd, runtimeArgs, config) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
subCommands.set(subCmd, []);
|
|
75
|
-
}
|
|
76
|
-
subCommands.get(subCmd).push({ placeholder, returnOutput, transformValue });
|
|
77
|
-
return placeholder;
|
|
42
|
+
async expandCmd(cmd, runtimeArgs, config) {
|
|
43
|
+
// 1: leading \s
|
|
44
|
+
// 2, 5: $*
|
|
45
|
+
// 3, 6: $\d+*
|
|
46
|
+
// 4, 7: $\d+
|
|
47
|
+
// 8: default/fallback value (possibly with `returnOutput` limit)
|
|
48
|
+
const re = /(\s{0,1})\\?\$(?:(\*)|([1-9]+)\*|(\d+)|{(?:(\*)|([1-9]+)\*|(\d+))(?::([^}]*))?})/g;
|
|
49
|
+
const subCommands = new Map();
|
|
50
|
+
let expandedCmd = cmd.replace(re, (_, g1, g2, g3, g4, g5, g6, g7, g8) => {
|
|
51
|
+
const transformValue = (val) => !val ? '' : `${g1}${val}`;
|
|
52
|
+
// Value based on the supplied arguments.
|
|
53
|
+
const startIdx = (g2 || g5) ? 0 : (g3 || g6 || g4 || g7) - 1;
|
|
54
|
+
const endIdx = (g2 || g5 || g3 || g6) ? runtimeArgs.length : +(g4 || g7);
|
|
55
|
+
let value = runtimeArgs.slice(startIdx, endIdx).join(' ');
|
|
56
|
+
// No argument(s), fall back to default.
|
|
57
|
+
if (!value && g8) {
|
|
58
|
+
const match = /^::(.+)$/.exec(g8);
|
|
59
|
+
if (!match) {
|
|
60
|
+
// It is a plain ol' fallback value.
|
|
61
|
+
value = g8;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// It is a command.
|
|
65
|
+
let returnOutput = true;
|
|
66
|
+
const subCmd = match[1].replace(/ --gkcu-returnOutput=(\d+)$/, (__, g) => {
|
|
67
|
+
returnOutput = +g;
|
|
68
|
+
return '';
|
|
69
|
+
});
|
|
70
|
+
const placeholder = `${Math.random()}`;
|
|
71
|
+
if (!subCommands.has(subCmd)) {
|
|
72
|
+
subCommands.set(subCmd, []);
|
|
78
73
|
}
|
|
74
|
+
subCommands.get(subCmd).push({ placeholder, returnOutput, transformValue });
|
|
75
|
+
return placeholder;
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
yield Promise.all(subCommandPromises);
|
|
98
|
-
return expandedCmd;
|
|
77
|
+
}
|
|
78
|
+
return transformValue(value);
|
|
79
|
+
});
|
|
80
|
+
const subCommandPromises = Array.from(subCommands.entries()).map(([subCmd, infoList]) => {
|
|
81
|
+
const hasNumericReturnOutput = infoList.some(info => typeof info.returnOutput === 'number');
|
|
82
|
+
const returnOutput = hasNumericReturnOutput ? Infinity : true;
|
|
83
|
+
const runConfig = Object.assign({}, config, { returnOutput });
|
|
84
|
+
const subCmdPromise = this.run(subCmd, runtimeArgs, runConfig).then(result => this.cleanUpOutput(result));
|
|
85
|
+
const replPromises = infoList.map(info => subCmdPromise.then(result => {
|
|
86
|
+
// Retrieve the part of the output that this sub-command cares about.
|
|
87
|
+
const value = (typeof info.returnOutput === 'number') ? this.getLastLines(result, info.returnOutput) : result;
|
|
88
|
+
// Construct the replacement for this sub-command (e.g. leading whitespace may vary).
|
|
89
|
+
const repl = info.transformValue(config.dryrun ? `{{${value.replace(/\s/g, '_')}}}` : value);
|
|
90
|
+
// Replace in `expandedCmd`.
|
|
91
|
+
expandedCmd = expandedCmd.replace(info.placeholder, repl);
|
|
92
|
+
}));
|
|
93
|
+
return Promise.all(replPromises);
|
|
99
94
|
});
|
|
95
|
+
await Promise.all(subCommandPromises);
|
|
96
|
+
return expandedCmd;
|
|
100
97
|
}
|
|
101
98
|
/**
|
|
102
99
|
* Preprocess a list of input arguments (e.g. `process.argv.slice(2)`) into a list of arguments that can be used for
|
|
@@ -143,15 +140,13 @@ class CommandUtils {
|
|
|
143
140
|
* @return A promise that resolves once the command has been executed. The resolved value is either an empty string or
|
|
144
141
|
* (some part of) the output of the command (if `returnOutput` is set and not false).
|
|
145
142
|
*/
|
|
146
|
-
run(cmd, runtimeArgs = [], config = {}) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return this.spawnAsPromised(expandedCmd, config);
|
|
154
|
-
});
|
|
143
|
+
async run(cmd, runtimeArgs = [], config = {}) {
|
|
144
|
+
const expandedCmd = await this.expandCmd(cmd, runtimeArgs, config);
|
|
145
|
+
if (config.debug) {
|
|
146
|
+
this.debugMessage(`Input command: '${cmd}'`);
|
|
147
|
+
this.debugMessage(`Expanded command: '${expandedCmd}'`);
|
|
148
|
+
}
|
|
149
|
+
return this.spawnAsPromised(expandedCmd, config);
|
|
155
150
|
}
|
|
156
151
|
/**
|
|
157
152
|
* Spawn a complex command (or series of piped commands) and return a promise that resolves or rejects based on the
|
|
@@ -179,9 +174,7 @@ class CommandUtils {
|
|
|
179
174
|
if (debug) {
|
|
180
175
|
this.debugMessage(' Reseting the output and cursor styles.');
|
|
181
176
|
}
|
|
182
|
-
|
|
183
|
-
process.stdout.write('\u001b[0m');
|
|
184
|
-
process.stdout.write('\u001b[?25h');
|
|
177
|
+
internal_utils_1.internalUtils.resetOutputStyle(process.stdout);
|
|
185
178
|
};
|
|
186
179
|
const cancelCleanUp = process_utils_1.processUtils.doOnExit(process, cleanUp);
|
|
187
180
|
const unsuppressTbj = suppressTbj ?
|
|
@@ -215,7 +208,7 @@ class CommandUtils {
|
|
|
215
208
|
this.debugMessage(` Running ${idx + 1}/${arr.length}: '${executable}', '${args.join(', ')}'\n` +
|
|
216
209
|
` (sapVersion: ${sapVersion}, stdio: ${options.stdio.join(', ')})`);
|
|
217
210
|
}
|
|
218
|
-
const proc =
|
|
211
|
+
const proc = (0, node_child_process_1.spawn)(executable, args, options).
|
|
219
212
|
on('error', reject).
|
|
220
213
|
on('exit', (code, signal) => {
|
|
221
214
|
if (code !== 0)
|
|
@@ -228,7 +221,7 @@ class CommandUtils {
|
|
|
228
221
|
return proc.stdout;
|
|
229
222
|
}, null);
|
|
230
223
|
if (returnOutput) {
|
|
231
|
-
const outputStream = new
|
|
224
|
+
const outputStream = new node_stream_1.PassThrough();
|
|
232
225
|
outputStream.on('data', d => data += d);
|
|
233
226
|
lastStdout.pipe(outputStream);
|
|
234
227
|
if (returnOutputSubset) {
|
|
@@ -240,7 +233,7 @@ class CommandUtils {
|
|
|
240
233
|
}
|
|
241
234
|
// Methods - Private
|
|
242
235
|
debugMessage(msg) {
|
|
243
|
-
const { gray } = require('chalk');
|
|
236
|
+
const { gray } = require('chalk'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
244
237
|
const formatted = msg.
|
|
245
238
|
split('\n').
|
|
246
239
|
map(line => gray(`[debug] ${line}`)).
|
|
@@ -270,10 +263,11 @@ class CommandUtils {
|
|
|
270
263
|
return rawCmd.
|
|
271
264
|
split(/\s+\|\s+/).
|
|
272
265
|
map(cmd => this.parseSingleCmd(cmd, dryrun));
|
|
273
|
-
case 2:
|
|
266
|
+
case 2: {
|
|
274
267
|
// Since it will be executed in a shell, there is no need to handle anything specially. (Or is it?)
|
|
275
268
|
const executable = !dryrun ? rawCmd : `node --print '${JSON.stringify(rawCmd).replace(/'/g, '\\\'')}'`;
|
|
276
|
-
return [{
|
|
269
|
+
return [{ args: [], executable }];
|
|
270
|
+
}
|
|
277
271
|
default:
|
|
278
272
|
throw new Error(`Unknown 'sapVersion' (${sapVersion}).`);
|
|
279
273
|
}
|
|
@@ -285,7 +279,7 @@ class CommandUtils {
|
|
|
285
279
|
const newTokens = (idx % 2) ? [`"${str}"`] : str.split(' ');
|
|
286
280
|
const lastToken = arr[arr.length - 1];
|
|
287
281
|
if (lastToken)
|
|
288
|
-
arr[arr.length - 1]
|
|
282
|
+
arr[arr.length - 1] = lastToken + newTokens.shift();
|
|
289
283
|
return arr.concat(newTokens);
|
|
290
284
|
}, []).
|
|
291
285
|
filter(x => x).
|
|
@@ -311,10 +305,10 @@ class CommandUtils {
|
|
|
311
305
|
this.insertAfter(tokens, 'echo', '&&');
|
|
312
306
|
this.insertAfter(tokens, 'echo', '||');
|
|
313
307
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
replace(
|
|
308
|
+
cleanUpOutput(str) {
|
|
309
|
+
return internal_utils_1.internalUtils.
|
|
310
|
+
stripOutputStyleResetSequences(str).
|
|
311
|
+
replace(internal_utils_1.internalUtils.escapeSeqRes.moveCursor, '').
|
|
318
312
|
trim();
|
|
319
313
|
}
|
|
320
314
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-utils.js","sourceRoot":"","sources":["../../src/lib/command-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-utils.js","sourceRoot":"","sources":["../../src/lib/command-utils.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AACvD,6CAAkD;AAElD,qDAA+C;AAC/C,mDAA6C;AAyD7C,MAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,KAAK,CAAC,SAAS,C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,MAAM,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAEO,aAAa,CAAC,GAAW;QAC/B,OAAO,8BAAa;YAClB,8BAA8B,CAAC,GAAG,CAAC;YACnC,OAAO,CAAC,8BAAa,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC;YAClD,IAAI,EAAE,CAAC;IACX,CAAC;CACF;AArWD,oCAqWC;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
export declare class InternalUtils {
|
|
2
|
+
readonly escapeSeqs: {
|
|
3
|
+
readonly resetBold: "\u001B[0m";
|
|
4
|
+
readonly showCursor: "\u001B[?25h";
|
|
5
|
+
};
|
|
6
|
+
readonly escapeSeqRes: {
|
|
7
|
+
readonly moveCursor: RegExp;
|
|
8
|
+
readonly resetBold: RegExp;
|
|
9
|
+
readonly showCursor: RegExp;
|
|
10
|
+
};
|
|
11
|
+
private outputStyleResetSeqNames;
|
|
2
12
|
finallyAsPromised<T>(promise: Promise<T>, callback: () => void | Promise<void>): Promise<T>;
|
|
3
13
|
noop(): undefined;
|
|
4
14
|
onError(err?: Error | string | number): void;
|
|
15
|
+
resetOutputStyle(stream: NodeJS.WriteStream): void;
|
|
16
|
+
stripOutputStyleResetSequences(str: string): string;
|
|
5
17
|
}
|
|
6
18
|
export declare const internalUtils: InternalUtils;
|
|
7
19
|
//# sourceMappingURL=internal-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-utils.d.ts","sourceRoot":"","sources":["../../src/lib/internal-utils.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACX,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAMjG,IAAI;IAIJ,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"internal-utils.d.ts","sourceRoot":"","sources":["../../src/lib/internal-utils.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,SAAgB,UAAU;;;MAGf;IACX,SAAgB,YAAY;;;;MAMjB;IAEX,OAAO,CAAC,wBAAwB,CAAwC;IAE3D,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAMjG,IAAI;IAIJ,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI;IAa5C,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW;IAK3C,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAG3D;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.internalUtils = exports.InternalUtils = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
class InternalUtils {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
escapeSeqs = {
|
|
6
|
+
resetBold: '\u001b[0m',
|
|
7
|
+
showCursor: '\u001b[?25h',
|
|
8
|
+
};
|
|
9
|
+
escapeSeqRes = {
|
|
10
|
+
/* eslint-disable no-control-regex */
|
|
11
|
+
moveCursor: /\u001b\[\d+[a-d]/gi,
|
|
12
|
+
resetBold: /\u001b\[0m/gi,
|
|
13
|
+
showCursor: /\u001b\[\?25h/gi,
|
|
14
|
+
/* eslint-enable no-control-regex */
|
|
15
|
+
};
|
|
16
|
+
outputStyleResetSeqNames = ['resetBold', 'showCursor'];
|
|
17
|
+
async finallyAsPromised(promise, callback) {
|
|
18
|
+
return promise.then(val => Promise.resolve(callback()).then(() => val), err => Promise.resolve(callback()).then(() => Promise.reject(err)));
|
|
10
19
|
}
|
|
11
20
|
noop() {
|
|
12
21
|
return undefined;
|
|
13
22
|
}
|
|
14
23
|
onError(err) {
|
|
15
|
-
const { red } = require('chalk');
|
|
24
|
+
const { red } = require('chalk'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
16
25
|
const isExitCode = !!err && (typeof err === 'number');
|
|
17
26
|
const errorMsg = (err instanceof Error) ?
|
|
18
27
|
err.stack : isExitCode ?
|
|
@@ -21,6 +30,13 @@ class InternalUtils {
|
|
|
21
30
|
console.error(red(errorMsg));
|
|
22
31
|
process.exit(isExitCode ? err : 1);
|
|
23
32
|
}
|
|
33
|
+
resetOutputStyle(stream) {
|
|
34
|
+
// Reset the output style (e.g. bold) and show the cursor.
|
|
35
|
+
this.outputStyleResetSeqNames.forEach(seqName => stream.write(this.escapeSeqs[seqName]));
|
|
36
|
+
}
|
|
37
|
+
stripOutputStyleResetSequences(str) {
|
|
38
|
+
return this.outputStyleResetSeqNames.reduce((aggr, seqName) => aggr.replace(this.escapeSeqRes[seqName], ''), str);
|
|
39
|
+
}
|
|
24
40
|
}
|
|
25
41
|
exports.InternalUtils = InternalUtils;
|
|
26
42
|
exports.internalUtils = new InternalUtils();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-utils.js","sourceRoot":"","sources":["../../src/lib/internal-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-utils.js","sourceRoot":"","sources":["../../src/lib/internal-utils.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IACR,UAAU,GAAG;QAC3B,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,aAAa;KACjB,CAAC;IACK,YAAY,GAAG;QAC7B,qCAAqC;QACrC,UAAU,EAAE,oBAAoB;QAChC,SAAS,EAA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,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3F,CAAC;IAEM,8BAA8B,CAAC,GAAW;QAC/C,OAAO,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IACpH,CAAC;CACF;AA9CD,sCA8CC;AAEY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-utils.d.ts","sourceRoot":"","sources":["../../src/lib/process-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"process-utils.d.ts","sourceRoot":"","sources":["../../src/lib/process-utils.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IACvB;;;;;;;OAOG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,KAAK,IAAI;IA0B7F;;;;;;;;;;;;;;OAcG;IACI,qCAAqC,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,IAAI;CAkB/E;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
package/out/lib/process-utils.js
CHANGED
|
@@ -55,11 +55,11 @@ class ProcessUtils {
|
|
|
55
55
|
return internal_utils_1.internalUtils.noop;
|
|
56
56
|
}
|
|
57
57
|
// On Windows, suppress the "Terminate batch job (Y/N)?" confirmation.
|
|
58
|
-
const rl = require('readline');
|
|
58
|
+
const rl = require('readline'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
59
59
|
const rlInstance = rl.
|
|
60
60
|
createInterface({ input: proc.stdin, output: proc.stdout }).
|
|
61
61
|
on('SIGINT', () => {
|
|
62
|
-
const { exec } = require('child_process');
|
|
62
|
+
const { exec } = require('child_process'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
63
63
|
exec(`taskkill /F /PID ${proc.pid} /T`);
|
|
64
64
|
});
|
|
65
65
|
// Closing synchronously sometimes results in stale output (for whatever reason).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-utils.js","sourceRoot":"","sources":["../../src/lib/process-utils.ts"],"names":[],"mappings":";;;AAAA,qDAA+C;AAG/C,MAAa,YAAY;IACvB;;;;;;;OAOG;IACI,QAAQ,CAAC,IAAoB,EAAE,MAAuD;QAC3F,IAAI,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"process-utils.js","sourceRoot":"","sources":["../../src/lib/process-utils.ts"],"names":[],"mappings":";;;AAAA,qDAA+C;AAG/C,MAAa,YAAY;IACvB;;;;;;;OAOG;IACI,QAAQ,CAAC,IAAoB,EAAE,MAAuD;QAC3F,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;aAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;QAED,MAAM,YAAY,GAAwB,CAAC,IAAY,EAAE,EAAE;YACzD,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC,CAAC;QACF,MAAM,cAAc,GAA2B,CAAC,MAAsB,EAAE,EAAE;YACxE,MAAM,CAAC,MAAM,CAAC,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACf,CAAC,CAAC;QACF,MAAM,OAAO,GAAqB,CAAC,QAAQ,CAAC,CAAC;QAE7C,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACvC,OAAO,CAAC,OAAO,CAAC,M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67
|
private normalizeNewlines;
|
|
68
|
-
private stripCleanUpCharacters;
|
|
69
68
|
}
|
|
70
69
|
export declare const testingUtils: TestingUtils;
|
|
71
70
|
//# sourceMappingURL=testing-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-utils.d.ts","sourceRoot":"","sources":["../../src/lib/testing-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing-utils.d.ts","sourceRoot":"","sources":["../../src/lib/testing-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAIzD,qBAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACU,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAKvE;;;;;;;;;;;;;;;;;;OAkBG;IACI,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC;IAKxG;;;;;;;;;;;;;OAaG;IACI,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAgBhF,OAAO,CAAC,iBAAiB;CAG1B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
package/out/lib/testing-utils.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.testingUtils = exports.TestingUtils = void 0;
|
|
4
|
-
|
|
4
|
+
/// <reference types="jasmine" />
|
|
5
5
|
const command_utils_1 = require("./command-utils");
|
|
6
|
+
const internal_utils_1 = require("./internal-utils");
|
|
6
7
|
class TestingUtils {
|
|
7
8
|
/**
|
|
8
9
|
* Run the specified command using {@link CommandUtils#spawnAsPromised spawnAsPromised()}, capture the output and
|
|
@@ -32,11 +33,9 @@ class TestingUtils {
|
|
|
32
33
|
* @return A promise that resolves once the command has been executed. The resolved value is the output of the
|
|
33
34
|
* command.
|
|
34
35
|
*/
|
|
35
|
-
testCmd(cmd, config) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return this.normalizeNewlines(this.stripCleanUpCharacters(result)).trim();
|
|
39
|
-
});
|
|
36
|
+
async testCmd(cmd, config) {
|
|
37
|
+
const result = await command_utils_1.commandUtils.spawnAsPromised(cmd, { returnOutput: true, ...config });
|
|
38
|
+
return this.normalizeNewlines(internal_utils_1.internalUtils.stripOutputStyleResetSequences(result).trim());
|
|
40
39
|
}
|
|
41
40
|
/**
|
|
42
41
|
* Create a function that can be used for testing a Node.js script with {@link TestingUtils#testCmd testCmd()}. It can
|
|
@@ -90,9 +89,6 @@ class TestingUtils {
|
|
|
90
89
|
normalizeNewlines(str) {
|
|
91
90
|
return str.replace(/\r\n?/g, '\n');
|
|
92
91
|
}
|
|
93
|
-
stripCleanUpCharacters(str) {
|
|
94
|
-
return str.replace(/\u001b\[(?:0m|\?25h)/gi, '');
|
|
95
|
-
}
|
|
96
92
|
}
|
|
97
93
|
exports.TestingUtils = TestingUtils;
|
|
98
94
|
exports.testingUtils = new TestingUtils();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-utils.js","sourceRoot":"","sources":["../../src/lib/testing-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing-utils.js","sourceRoot":"","sources":["../../src/lib/testing-utils.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,mDAAyD;AACzD,qDAA+C;AAG/C,MAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,MAAmB;QACnD,MAAM,MAAM,GAAG,MAAM,4BAAY,CAAC,eAAe,CAAC,GAAG,EAAE,EAAC,YAAY,EAAE,IAAI,EAAE,GAAG,MAAM,EAAC,CAAC,CAAC;QACxF,OAAO,IAAI,CAAC,iBAAiB,CAAC,8BAAa,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACI,iBAAiB,CAAC,UAAkB;QACzC,MAAM,OAAO,GAAG,QAAQ,UAAU,EAAE,CAAC;QACrC,OAAO,CAAC,OAAO,GAAG,EAAE,EAAE,MAAmB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,OAAO,IAAI,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,kBAAkB,CAAC,UAAkB,EAAE,SAAqB;QACjE,OAAO,GAAG,EAAE;YACV,IAAI,8BAAsC,CAAC;YAE3C,SAAS,CAAC,GAAG,EAAE;gBACb,8BAA8B,GAAG,OAAO,CAAC,wBAAwB,CAAC;gBAClE,OAAO,CAAC,wBAAwB,GAAG,UAAU,CAAC;YAChD,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,wBAAwB,GAAG,8BAA8B,CAAC,CAAC;YAElF,SAAS,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IAED,oBAAoB;IACZ,iBAAiB,CAAC,GAAW;QACnC,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AA3FD,oCA2FC;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/tslib/tslib.d.ts","../../src/lib/internal-utils.ts","../../src/lib/process-utils.ts","../../src/lib/command-utils.ts","../../node_modules/@types/jasmine/index.d.ts","../../src/lib/testing-utils.ts","../../src/lib/index.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/globals.global.d.ts","../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"4a882ffbb4ed09d9b7734f784aebb1dfe488d63725c40759165c5d9c657ca029",{"version":"1efdb0669891e188cfa71f5ae178e269de583c7535cf7b4a58dd57878ab2238f","signature":"68a6f97633a9195418052107e759c8e5d12c061e3a2d393af4581c447099fb98"},{"version":"5b3b3d47d8a9633f569c4da0f4c41f721e0733f0a11174dd7120628c10fd13e7","signature":"20d52cf5f922566392e3a1cb960290dbb6e46766ee484df54f1612736a84ca80"},{"version":"a3b6987027188d690bed95d906c463293994a793d8ffe71fea8e80753e546fe6","signature":"8144cfc881544706b4a8d691bfd46c7358c76558d44591b3ca5fd3a68c393ccd"},{"version":"880d6e0b06b0ee58724ed2b8dc0532badf9a9af6d25a0afbe9a9021f942d4321","affectsGlobalScope":true},{"version":"3bb314f745d5efd865c3a2fb52009bd3eda86cd46e22f141d61b8a57fe9c92b4","signature":"55c2c75787cbb74ad0b536358e5e3100509f2fca5764d9dc63922bde936ae8d4"},{"version":"4e0620f75a887e44fa54a1655151ed22abc571d523acbf9bf93f0590937347b5","signature":"eb7630413bfd6ce95c230f09397c5c4c4dd51c771b6e2eaabf1897bb870dfd57"},"2db0dd3aaa2ed285950273ce96ae8a450b45423aa9da2d10e194570f1233fa6b","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"e7be367719c613d580d4b27fdf8fe64c9736f48217f4b322c0d63b2971460918","affectsGlobalScope":true},"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36",{"version":"392eadc2af403dd10b4debfbc655c089a7fa6a9750caeb770cfb30051e55e848","affectsGlobalScope":true},"62f1c00d3d246e0e3cf0224f91e122d560428ec1ccc36bb51d4574a84f1dbad0","53f0960fdcc53d097918adfd8861ffbe0db989c56ffc16c052197bf115da5ed6",{"version":"662163e5327f260b23ca0a1a1ad8a74078aabb587c904fcb5ef518986987eaff","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"c48c503c6b3f63baf18257e9a87559b5602a4e960107c762586d2a6a62b64a18","affectsGlobalScope":true},"b0c0d1d13be149f790a75b381b413490f98558649428bb916fd2d71a3f47a134","3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","0364f8bb461d6e84252412d4e5590feda4eb582f77d47f7a024a7a9ff105dfdc","5433f7f77cd1fd53f45bd82445a4e437b2f6a72a32070e907530a4fea56c30c8","d0ca5d7df114035258a9d01165be309371fcccf0cccd9d57b1453204686d1ed0",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"9a30b7fefd7f8abbca4828d481c61c18e40fe5ff107e113b1c1fcd2c8dcf2743","affectsGlobalScope":true},"173b6275a81ebdb283b180654890f46516c21199734fed01a773b1c168b8c45c","304f66274aa8119e8d65a49b1cff84cbf803def6afe1b2cc987386e9a9890e22","1b9adafe8a7fefaeaf9099a0e06f602903f6268438147b843a33a5233ac71745","98273274f2dbb79b0b2009b20f74eca4a7146a3447c912d580cd5d2d94a7ae30","c933f7ba4b201c98b14275fd11a14abb950178afd2074703250fe3654fc10cd2","2eaa31492906bc8525aff3c3ec2236e22d90b0dfeee77089f196cd0adf0b3e3b",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"8f5814f29dbaf8bacd1764aebdf1c8a6eb86381f6a188ddbac0fcbaab855ce52","a63d03de72adfb91777784015bd3b4125abd2f5ef867fc5a13920b5649e8f52b","d20e003f3d518a7c1f749dbe27c6ab5e3be7b3c905a48361b04a9557de4a6900",{"version":"1d4d78c8b23c9ddaaaa49485e6adc2ec01086dfe5d8d4d36ca4cdc98d2f7e74a","affectsGlobalScope":true},{"version":"44fc16356b81c0463cc7d7b2b35dcf324d8144136f5bc5ce73ced86f2b3475b5","affectsGlobalScope":true},"575fb200043b11b464db8e42cc64379c5fd322b6d787638e005b5ee98a64486d","6de2f225d942562733e231a695534b30039bdf1875b377bb7255881f0df8ede8","56249fd3ef1f6b90888e606f4ea648c43978ef43a7263aafad64f8d83cd3b8aa","139ad1dc93a503da85b7a0d5f615bddbae61ad796bc68fedd049150db67a1e26","7b166975fdbd3b37afb64707b98bca88e46577bbc6c59871f9383a7df2daacd1","9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","81505c54d7cad0009352eaa21bd923ab7cdee7ec3405357a54d9a5da033a2084","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","3c1f19c7abcda6b3a4cf9438a15c7307a080bd3b51dfd56b198d9f86baf19447","2ee1645e0df9d84467cfe1d67b0ad3003c2f387de55874d565094464ee6f2927",{"version":"7da97d603bf3dd0000f56467c56cb6efaf5f94692980474925fae6c33412b12a","affectsGlobalScope":true},{"version":"9cf780e96b687e4bdfd1907ed26a688c18b89797490a00598fa8b8ab683335dd","affectsGlobalScope":true},"98e00f3613402504bc2a2c9a621800ab48e0a463d1eed062208a4ae98ad8f84c","9ae88ce9f73446c24b2d2452e993b676da1b31fca5ceb7276e7f36279f693ed1","e49d7625faff2a7842e4e7b9b197f972633fca685afcf6b4403400c97d087c36","b82c38abc53922b1b3670c3af6f333c21b735722a8f156e7d357a2da7c53a0a0",{"version":"b423f53647708043299ded4daa68d95c967a2ac30aa1437adc4442129d7d0a6c","affectsGlobalScope":true},{"version":"7245af181218216bacb01fbdf51095617a51661f20d77178c69a377e16fb69ed","affectsGlobalScope":true},"4f0fc7b7f54422bd97cfaf558ddb4bca86893839367b746a8f86b60ac7619673","4cdd8b6b51599180a387cc7c1c50f49eca5ce06595d781638fd0216520d98246","d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c",{"version":"8704423bf338bff381ebc951ed819935d0252d90cd6de7dffe5b0a5debb65d07","affectsGlobalScope":true},"7c6929fd7cbf38499b6a600b91c3b603d1d78395046dc3499b2b92d01418b94b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"a42be67ed1ddaec743582f41fc219db96a1b69719fccac6d1464321178d610fc"],"root":[[61,63],65,66],"options":{"allowUnreachableCode":false,"allowUnusedLabels":false,"composite":true,"declaration":true,"declarationMap":true,"exactOptionalPropertyTypes":true,"importHelpers":true,"module":1,"newLine":1,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"..","rootDir":"../../src","sourceMap":true,"strict":true,"target":9},"fileIdsList":[[67],[102],[103,108,137],[104,109,115,116,123,134,145],[104,105,115,123],[106,146],[107,108,116,124],[108,134,142],[109,111,115,123],[102,110],[111,112],[115],[113,115],[102,115],[115,116,117,134,145],[115,116,117,130,134,137],[100,103,150],[111,115,118,123,134,145],[115,116,118,119,123,134,142,145],[118,120,134,142,145],[67,68,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152],[115,121],[122,145,150],[111,115,123,134],[124],[125],[102,126],[123,124,127,144,150],[128],[129],[115,130,131],[130,132,146,148],[103,115,134,135,136,137],[103,134,136],[134,135],[137],[138],[102,134],[115,140,141],[140,141],[108,123,134,142],[143],[123,144],[103,118,129,145],[108,146],[134,147],[122,148],[149],[103,108,115,117,126,134,145,148,150],[134,151],[77,81,145],[77,134,145],[72],[74,77,142,145],[123,142],[153],[72,153],[74,77,123,145],[69,70,73,76,103,115,134,145],[69,75],[73,77,103,137,145,153],[103,153],[93,103,153],[71,72,153],[77],[71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99],[77,84,85],[75,77,85,86],[76],[69,72,77],[77,81,85,86],[81],[75,77,80,145],[69,74,75,77,81,84],[103,134],[72,77,93,103,150,153],[60,61,62,104,134],[60,62,63,65],[60],[60,61],[60,61,63,64]],"referencedMap":[[67,1],[68,1],[102,2],[103,3],[104,4],[105,5],[106,6],[107,7],[108,8],[109,9],[110,10],[111,11],[112,11],[114,12],[113,13],[115,14],[116,15],[117,16],[101,17],[118,18],[119,19],[120,20],[153,21],[121,22],[122,23],[123,24],[124,25],[125,26],[126,27],[127,28],[128,29],[129,30],[130,31],[131,31],[132,32],[134,33],[136,34],[135,35],[137,36],[138,37],[139,38],[140,39],[141,40],[142,41],[143,42],[144,43],[145,44],[146,45],[147,46],[148,47],[149,48],[150,49],[151,50],[84,51],[91,52],[83,51],[98,53],[75,54],[74,55],[97,56],[92,57],[95,58],[77,59],[76,60],[72,61],[71,62],[94,63],[73,64],[78,65],[82,65],[100,66],[99,65],[86,67],[87,68],[89,69],[85,70],[88,71],[93,56],[80,72],[81,73],[90,74],[70,75],[96,76],[63,77],[66,78],[61,79],[62,80],[65,81]],"latestChangedDtsFile":"./index.d.ts"},"version":"5.5.3"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gkalpak/cli-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A private collection of utilities for developing cli tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Private",
|
|
7
7
|
"Utility"
|
|
8
8
|
],
|
|
9
9
|
"main": "out/lib/index.js",
|
|
10
|
-
"
|
|
10
|
+
"types": "out/lib/index.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"prebuild": "npm run clean-
|
|
12
|
+
"prebuild": "npm run clean-up",
|
|
13
13
|
"build": "npm run ~~build",
|
|
14
14
|
"prebuild-watch": "npm run prebuild",
|
|
15
15
|
"build-watch": "npm run ~~build-watch",
|
|
16
|
-
"clean-
|
|
16
|
+
"clean-up": "node --eval \"require('shelljs/global'); set('-e'); rm('-rf', 'out/');\"",
|
|
17
17
|
"predev": "npm run build || true",
|
|
18
18
|
"dev": "run-p ~~build-watch ~~test-unit-watch",
|
|
19
|
-
"lint": "
|
|
19
|
+
"lint": "run-p ~~lint-code ~~typecheck-scripts",
|
|
20
20
|
"prerelease": "npm test",
|
|
21
21
|
"release": "node out/bin/run \"npm version \\${*:patch}\"",
|
|
22
22
|
"postrelease": "npm publish",
|
|
@@ -27,12 +27,14 @@
|
|
|
27
27
|
"pretest-unit": "npm run build",
|
|
28
28
|
"test-unit": "npm run ~~test-unit",
|
|
29
29
|
"postversion": "git push && git push --tags",
|
|
30
|
-
"~~build": "tsc --
|
|
30
|
+
"~~build": "tsc --build tsconfig.json",
|
|
31
31
|
"~~build-watch": "npm run ~~build -- --watch",
|
|
32
|
+
"~~lint-code": "eslint ./",
|
|
32
33
|
"~~test-e2e": "jasmine out/test/e2e/**/*.spec.js",
|
|
33
34
|
"~~test-pkg": "node scripts/test-pkg",
|
|
34
35
|
"~~test-unit": "jasmine out/test/unit/**/*.spec.js",
|
|
35
|
-
"~~test-unit-watch": "watch \"npm run ~~test-unit\" out/ --wait 1"
|
|
36
|
+
"~~test-unit-watch": "watch \"npm run ~~test-unit\" out/ --wait 1",
|
|
37
|
+
"~~typecheck-scripts": "tsc --project jsconfig.json"
|
|
36
38
|
},
|
|
37
39
|
"bin": {
|
|
38
40
|
"gkcu-expand-cmd": "out/bin/expand-cmd.js",
|
|
@@ -46,19 +48,24 @@
|
|
|
46
48
|
"url": "git+https://github.com/gkalpak/cli-utils.git"
|
|
47
49
|
},
|
|
48
50
|
"dependencies": {
|
|
49
|
-
"chalk": "^4.1.
|
|
50
|
-
"tslib": "^2.3
|
|
51
|
+
"chalk": "^4.1.2",
|
|
52
|
+
"tslib": "^2.6.3"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@types/jasmine": "^
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"
|
|
55
|
+
"@types/jasmine": "^5.1.4",
|
|
56
|
+
"@types/node": "^20.14.10",
|
|
57
|
+
"@types/shelljs": "^0.8.15",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
59
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
60
|
+
"eslint": "^8.57.0",
|
|
61
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
62
|
+
"eslint-plugin-import": "^2.29.1",
|
|
63
|
+
"eslint-plugin-jasmine": "^4.2.0",
|
|
64
|
+
"jasmine": "^5.1.0",
|
|
56
65
|
"npm-run-all": "^4.1.5",
|
|
57
|
-
"shelljs": "^0.8.
|
|
58
|
-
"source-map-support": "^0.5.
|
|
59
|
-
"
|
|
60
|
-
"tslint-jasmine-noSkipOrFocus": "^1.0.9",
|
|
61
|
-
"typescript": "^4.3.5",
|
|
66
|
+
"shelljs": "^0.8.5",
|
|
67
|
+
"source-map-support": "^0.5.21",
|
|
68
|
+
"typescript": "^5.5.3",
|
|
62
69
|
"watch": "^1.0.2"
|
|
63
70
|
}
|
|
64
71
|
}
|
package/src/bin/expand-cmd.ts
CHANGED
package/src/bin/run.ts
CHANGED
package/src/lib/command-utils.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {spawn, SpawnOptions} from 'child_process';
|
|
2
|
-
import {PassThrough, Readable} from 'stream';
|
|
1
|
+
import {spawn, SpawnOptions} from 'node:child_process';
|
|
2
|
+
import {PassThrough, Readable} from 'node:stream';
|
|
3
|
+
|
|
3
4
|
import {internalUtils} from './internal-utils';
|
|
4
5
|
import {processUtils} from './process-utils';
|
|
5
6
|
|
|
@@ -119,7 +120,7 @@ export class CommandUtils {
|
|
|
119
120
|
} else {
|
|
120
121
|
// It is a command.
|
|
121
122
|
let returnOutput: boolean | number = true;
|
|
122
|
-
const subCmd = match[1]
|
|
123
|
+
const subCmd = match[1]!.replace(/ --gkcu-returnOutput=(\d+)$/, (__, g) => {
|
|
123
124
|
returnOutput = +g;
|
|
124
125
|
return '';
|
|
125
126
|
});
|
|
@@ -143,7 +144,7 @@ export class CommandUtils {
|
|
|
143
144
|
const returnOutput = hasNumericReturnOutput ? Infinity : true;
|
|
144
145
|
const runConfig: IRunConfig = Object.assign({}, config, {returnOutput});
|
|
145
146
|
|
|
146
|
-
const subCmdPromise = this.run(subCmd, runtimeArgs, runConfig).then(result => this.
|
|
147
|
+
const subCmdPromise = this.run(subCmd, runtimeArgs, runConfig).then(result => this.cleanUpOutput(result));
|
|
147
148
|
const replPromises = infoList.map(info => subCmdPromise.then(result => {
|
|
148
149
|
// Retrieve the part of the output that this sub-command cares about.
|
|
149
150
|
const value = (typeof info.returnOutput === 'number') ? this.getLastLines(result, info.returnOutput) : result;
|
|
@@ -184,7 +185,7 @@ export class CommandUtils {
|
|
|
184
185
|
const [key, ...rest] = arg.split('=');
|
|
185
186
|
const value = rest.join('=');
|
|
186
187
|
|
|
187
|
-
config[key] = +value || value || true;
|
|
188
|
+
config[key as string] = +value || value || true;
|
|
188
189
|
};
|
|
189
190
|
|
|
190
191
|
const config = Object.create(null);
|
|
@@ -240,8 +241,8 @@ export class CommandUtils {
|
|
|
240
241
|
* (some part of) the output of the command (if `returnOutput` is set and not false).
|
|
241
242
|
*/
|
|
242
243
|
public spawnAsPromised(
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
rawCmd: string,
|
|
245
|
+
{debug, dryrun, returnOutput, sapVersion = 1, suppressTbj}: IRunConfig = {},
|
|
245
246
|
): Promise<string> {
|
|
246
247
|
const returnOutputSubset = (typeof returnOutput === 'number');
|
|
247
248
|
|
|
@@ -255,9 +256,7 @@ export class CommandUtils {
|
|
|
255
256
|
this.debugMessage(' Reseting the output and cursor styles.');
|
|
256
257
|
}
|
|
257
258
|
|
|
258
|
-
|
|
259
|
-
process.stdout.write('\u001b[0m');
|
|
260
|
-
process.stdout.write('\u001b[?25h');
|
|
259
|
+
internalUtils.resetOutputStyle(process.stdout);
|
|
261
260
|
};
|
|
262
261
|
const cancelCleanUp = processUtils.doOnExit(process, cleanUp);
|
|
263
262
|
const unsuppressTbj = suppressTbj ?
|
|
@@ -296,8 +295,8 @@ export class CommandUtils {
|
|
|
296
295
|
|
|
297
296
|
if (debug) {
|
|
298
297
|
this.debugMessage(
|
|
299
|
-
|
|
300
|
-
|
|
298
|
+
` Running ${idx + 1}/${arr.length}: '${executable}', '${args.join(', ')}'\n` +
|
|
299
|
+
` (sapVersion: ${sapVersion}, stdio: ${(options.stdio as string[]).join(', ')})`);
|
|
301
300
|
}
|
|
302
301
|
|
|
303
302
|
const proc = spawn(executable, args, options).
|
|
@@ -328,7 +327,7 @@ export class CommandUtils {
|
|
|
328
327
|
|
|
329
328
|
// Methods - Private
|
|
330
329
|
private debugMessage(msg: string): void {
|
|
331
|
-
const {gray} = require('chalk');
|
|
330
|
+
const {gray} = require('chalk'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
332
331
|
const formatted = msg.
|
|
333
332
|
split('\n').
|
|
334
333
|
map(line => gray(`[debug] ${line}`)).
|
|
@@ -364,10 +363,11 @@ export class CommandUtils {
|
|
|
364
363
|
return rawCmd.
|
|
365
364
|
split(/\s+\|\s+/).
|
|
366
365
|
map(cmd => this.parseSingleCmd(cmd, dryrun));
|
|
367
|
-
case 2:
|
|
366
|
+
case 2: {
|
|
368
367
|
// Since it will be executed in a shell, there is no need to handle anything specially. (Or is it?)
|
|
369
368
|
const executable = !dryrun ? rawCmd : `node --print '${JSON.stringify(rawCmd).replace(/'/g, '\\\'')}'`;
|
|
370
|
-
return [{
|
|
369
|
+
return [{args: [], executable}];
|
|
370
|
+
}
|
|
371
371
|
default:
|
|
372
372
|
throw new Error(`Unknown 'sapVersion' (${sapVersion}).`);
|
|
373
373
|
}
|
|
@@ -380,7 +380,7 @@ export class CommandUtils {
|
|
|
380
380
|
const newTokens = (idx % 2) ? [`"${str}"`] : str.split(' ');
|
|
381
381
|
const lastToken = arr[arr.length - 1];
|
|
382
382
|
|
|
383
|
-
if (lastToken) arr[arr.length - 1]
|
|
383
|
+
if (lastToken) arr[arr.length - 1] = lastToken + newTokens.shift();
|
|
384
384
|
|
|
385
385
|
return arr.concat(newTokens);
|
|
386
386
|
}, [] as string[]).
|
|
@@ -410,10 +410,10 @@ export class CommandUtils {
|
|
|
410
410
|
this.insertAfter(tokens, 'echo', '||');
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
private
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
replace(
|
|
413
|
+
private cleanUpOutput(str: string): string {
|
|
414
|
+
return internalUtils.
|
|
415
|
+
stripOutputStyleResetSequences(str).
|
|
416
|
+
replace(internalUtils.escapeSeqRes.moveCursor, '').
|
|
417
417
|
trim();
|
|
418
418
|
}
|
|
419
419
|
}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
export class InternalUtils {
|
|
2
|
+
public readonly escapeSeqs = {
|
|
3
|
+
resetBold: '\u001b[0m',
|
|
4
|
+
showCursor: '\u001b[?25h',
|
|
5
|
+
} as const;
|
|
6
|
+
public readonly escapeSeqRes = {
|
|
7
|
+
/* eslint-disable no-control-regex */
|
|
8
|
+
moveCursor: /\u001b\[\d+[a-d]/gi,
|
|
9
|
+
resetBold: /\u001b\[0m/gi,
|
|
10
|
+
showCursor: /\u001b\[\?25h/gi,
|
|
11
|
+
/* eslint-enable no-control-regex */
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
private outputStyleResetSeqNames = ['resetBold', 'showCursor'] as const;
|
|
15
|
+
|
|
2
16
|
public async finallyAsPromised<T>(promise: Promise<T>, callback: () => void | Promise<void>): Promise<T> {
|
|
3
17
|
return promise.then(
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
val => Promise.resolve(callback()).then(() => val),
|
|
19
|
+
err => Promise.resolve(callback()).then(() => Promise.reject(err)));
|
|
6
20
|
}
|
|
7
21
|
|
|
8
22
|
public noop() {
|
|
@@ -10,17 +24,26 @@ export class InternalUtils {
|
|
|
10
24
|
}
|
|
11
25
|
|
|
12
26
|
public onError(err?: Error | string | number): void {
|
|
13
|
-
const {red} = require('chalk');
|
|
27
|
+
const {red} = require('chalk'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
14
28
|
|
|
15
29
|
const isExitCode = !!err && (typeof err === 'number');
|
|
16
30
|
const errorMsg = (err instanceof Error) ?
|
|
17
31
|
err.stack : isExitCode ?
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
`Exit code: ${err}` :
|
|
33
|
+
`Error: ${err}`;
|
|
20
34
|
|
|
21
35
|
console.error(red(errorMsg));
|
|
22
36
|
process.exit(isExitCode ? err as number : 1);
|
|
23
37
|
}
|
|
38
|
+
|
|
39
|
+
public resetOutputStyle(stream: NodeJS.WriteStream) {
|
|
40
|
+
// Reset the output style (e.g. bold) and show the cursor.
|
|
41
|
+
this.outputStyleResetSeqNames.forEach(seqName => stream.write(this.escapeSeqs[seqName]));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public stripOutputStyleResetSequences(str: string): string {
|
|
45
|
+
return this.outputStyleResetSeqNames.reduce((aggr, seqName) => aggr.replace(this.escapeSeqRes[seqName], ''), str);
|
|
46
|
+
}
|
|
24
47
|
}
|
|
25
48
|
|
|
26
49
|
export const internalUtils = new InternalUtils();
|
package/src/lib/process-utils.ts
CHANGED
|
@@ -58,11 +58,11 @@ export class ProcessUtils {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// On Windows, suppress the "Terminate batch job (Y/N)?" confirmation.
|
|
61
|
-
const rl = require('readline');
|
|
61
|
+
const rl = require('readline'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
62
62
|
const rlInstance = rl.
|
|
63
63
|
createInterface({input: proc.stdin, output: proc.stdout}).
|
|
64
64
|
on('SIGINT', () => {
|
|
65
|
-
const {exec} = require('child_process');
|
|
65
|
+
const {exec} = require('child_process'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
66
66
|
exec(`taskkill /F /PID ${proc.pid} /T`);
|
|
67
67
|
});
|
|
68
68
|
|
package/src/lib/testing-utils.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="jasmine" />
|
|
1
2
|
import {commandUtils, IRunConfig} from './command-utils';
|
|
3
|
+
import {internalUtils} from './internal-utils';
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
export class TestingUtils {
|
|
@@ -32,7 +34,7 @@ export class TestingUtils {
|
|
|
32
34
|
*/
|
|
33
35
|
public async testCmd(cmd: string, config?: IRunConfig): Promise<string> {
|
|
34
36
|
const result = await commandUtils.spawnAsPromised(cmd, {returnOutput: true, ...config});
|
|
35
|
-
return this.normalizeNewlines(
|
|
37
|
+
return this.normalizeNewlines(internalUtils.stripOutputStyleResetSequences(result).trim());
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
/**
|
|
@@ -92,10 +94,6 @@ export class TestingUtils {
|
|
|
92
94
|
private normalizeNewlines(str: string): string {
|
|
93
95
|
return str.replace(/\r\n?/g, '\n');
|
|
94
96
|
}
|
|
95
|
-
|
|
96
|
-
private stripCleanUpCharacters(str: string): string {
|
|
97
|
-
return str.replace(/\u001b\[(?:0m|\?25h)/gi, '');
|
|
98
|
-
}
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
export const testingUtils = new TestingUtils();
|
package/tsconfig.json
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"allowUnreachableCode": false,
|
|
4
|
+
"allowUnusedLabels": false,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
7
|
+
"exactOptionalPropertyTypes": true,
|
|
8
|
+
"importHelpers": true,
|
|
6
9
|
"lib": [
|
|
7
|
-
"
|
|
10
|
+
"DOM",
|
|
11
|
+
"ES2022",
|
|
8
12
|
],
|
|
9
|
-
"
|
|
13
|
+
"module": "CommonJS",
|
|
14
|
+
"moduleResolution": "Node",
|
|
15
|
+
"newLine": "lf",
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noImplicitOverride": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
+
"noUncheckedIndexedAccess": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"outDir": "out/",
|
|
10
24
|
"rootDir": "src/",
|
|
25
|
+
"sourceMap": true,
|
|
11
26
|
"strict": true,
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"newLine": "lf"
|
|
27
|
+
"target": "ES2022",
|
|
28
|
+
"types": [
|
|
29
|
+
"node",
|
|
30
|
+
],
|
|
17
31
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
32
|
+
"files": [
|
|
33
|
+
],
|
|
34
|
+
"references": [
|
|
35
|
+
{"path": "src/bin/tsconfig.json"},
|
|
36
|
+
{"path": "src/lib/tsconfig.json"},
|
|
37
|
+
{"path": "src/test/unit/tsconfig.json"},
|
|
38
|
+
{"path": "src/test/e2e/tsconfig.json"},
|
|
39
|
+
],
|
|
21
40
|
}
|