@kubb/agent 4.28.0 → 4.29.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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +382 -642
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +4 -6
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +4 -6
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@kubb/fabric-core/dist/{defaultParser-BD_N68Bo.js → defaultParser-C1atU7yU.js} +2 -3
- package/.output/server/node_modules/@kubb/fabric-core/dist/{getRelativePath-C4Au07ON.js → getRelativePath-BcieQL5M.js} +1 -2
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +8 -9
- package/.output/server/node_modules/@kubb/fabric-core/dist/{Root-BQX3eHqb.js → onProcessExit-CF200hsz.js} +109 -190
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +3 -4
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +2 -3
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +58 -298
- package/.output/server/node_modules/@kubb/fabric-core/package.json +8 -18
- package/.output/server/node_modules/@kubb/react-fabric/dist/{chunk-DbZtQ4qb.js → chunk-Cnw5r_-A.js} +1 -5
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +39 -41
- package/.output/server/node_modules/@kubb/react-fabric/dist/{jsx-runtime-CQFBnRKx.js → jsx-runtime-Dm7PKVbc.js} +6 -24
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +5 -4
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +3 -3
- package/.output/server/node_modules/@kubb/react-fabric/dist/{react--draJ5Pm.js → react-D652OKii.js} +31 -91
- package/.output/server/node_modules/@kubb/react-fabric/dist/{reactPlugin-DqJsInTf.js → reactPlugin-BkDkx1cs.js} +410 -1650
- package/.output/server/node_modules/@kubb/react-fabric/package.json +8 -11
- package/.output/server/node_modules/empathic/access.js +39 -0
- package/.output/server/node_modules/empathic/access.mjs +34 -0
- package/.output/server/node_modules/empathic/find.js +81 -0
- package/.output/server/node_modules/empathic/find.mjs +76 -0
- package/.output/server/node_modules/empathic/package.json +49 -0
- package/.output/server/node_modules/empathic/package.mjs +52 -0
- package/.output/server/node_modules/empathic/resolve.js +31 -0
- package/.output/server/node_modules/empathic/resolve.mjs +27 -0
- package/.output/server/node_modules/empathic/walk.js +22 -0
- package/.output/server/node_modules/empathic/walk.mjs +20 -0
- package/.output/server/node_modules/tinyexec/dist/main.js +633 -0
- package/.output/server/node_modules/tinyexec/package.json +61 -0
- package/.output/server/package.json +6 -44
- package/package.json +19 -21
- package/.output/server/node_modules/.nitro/path-key@3.1.1/index.js +0 -16
- package/.output/server/node_modules/.nitro/path-key@3.1.1/package.json +0 -39
- package/.output/server/node_modules/.nitro/path-key@4.0.0/index.js +0 -12
- package/.output/server/node_modules/.nitro/path-key@4.0.0/package.json +0 -41
- package/.output/server/node_modules/.nitro/path-to-regexp@3.3.0/index.js +0 -421
- package/.output/server/node_modules/.nitro/path-to-regexp@3.3.0/package.json +0 -46
- package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-BVHe6Par.js +0 -22
- package/.output/server/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js +0 -89
- package/.output/server/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js +0 -34
- package/.output/server/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js +0 -6
- package/.output/server/node_modules/@sec-ant/readable-stream/package.json +0 -98
- package/.output/server/node_modules/@sindresorhus/merge-streams/index.js +0 -265
- package/.output/server/node_modules/@sindresorhus/merge-streams/package.json +0 -49
- package/.output/server/node_modules/balanced-match/index.js +0 -62
- package/.output/server/node_modules/balanced-match/package.json +0 -48
- package/.output/server/node_modules/brace-expansion/index.js +0 -201
- package/.output/server/node_modules/brace-expansion/package.json +0 -50
- package/.output/server/node_modules/bytes/index.js +0 -159
- package/.output/server/node_modules/bytes/package.json +0 -39
- package/.output/server/node_modules/concat-map/index.js +0 -13
- package/.output/server/node_modules/concat-map/package.json +0 -59
- package/.output/server/node_modules/content-disposition/index.js +0 -445
- package/.output/server/node_modules/content-disposition/package.json +0 -39
- package/.output/server/node_modules/cross-spawn/index.js +0 -39
- package/.output/server/node_modules/cross-spawn/lib/enoent.js +0 -59
- package/.output/server/node_modules/cross-spawn/lib/parse.js +0 -91
- package/.output/server/node_modules/cross-spawn/lib/util/escape.js +0 -47
- package/.output/server/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
- package/.output/server/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
- package/.output/server/node_modules/cross-spawn/package.json +0 -73
- package/.output/server/node_modules/execa/index.js +0 -28
- package/.output/server/node_modules/execa/lib/arguments/command.js +0 -20
- package/.output/server/node_modules/execa/lib/arguments/cwd.js +0 -39
- package/.output/server/node_modules/execa/lib/arguments/encoding-option.js +0 -50
- package/.output/server/node_modules/execa/lib/arguments/escape.js +0 -88
- package/.output/server/node_modules/execa/lib/arguments/fd-options.js +0 -108
- package/.output/server/node_modules/execa/lib/arguments/file-url.js +0 -25
- package/.output/server/node_modules/execa/lib/arguments/options.js +0 -96
- package/.output/server/node_modules/execa/lib/arguments/shell.js +0 -11
- package/.output/server/node_modules/execa/lib/arguments/specific.js +0 -111
- package/.output/server/node_modules/execa/lib/convert/add.js +0 -15
- package/.output/server/node_modules/execa/lib/convert/concurrent.js +0 -33
- package/.output/server/node_modules/execa/lib/convert/duplex.js +0 -69
- package/.output/server/node_modules/execa/lib/convert/iterable.js +0 -34
- package/.output/server/node_modules/execa/lib/convert/readable.js +0 -113
- package/.output/server/node_modules/execa/lib/convert/shared.js +0 -46
- package/.output/server/node_modules/execa/lib/convert/writable.js +0 -90
- package/.output/server/node_modules/execa/lib/io/contents.js +0 -116
- package/.output/server/node_modules/execa/lib/io/input-sync.js +0 -44
- package/.output/server/node_modules/execa/lib/io/iterate.js +0 -110
- package/.output/server/node_modules/execa/lib/io/max-buffer.js +0 -89
- package/.output/server/node_modules/execa/lib/io/output-async.js +0 -80
- package/.output/server/node_modules/execa/lib/io/output-sync.js +0 -135
- package/.output/server/node_modules/execa/lib/io/pipeline.js +0 -48
- package/.output/server/node_modules/execa/lib/io/strip-newline.js +0 -12
- package/.output/server/node_modules/execa/lib/ipc/array.js +0 -4
- package/.output/server/node_modules/execa/lib/ipc/buffer-messages.js +0 -47
- package/.output/server/node_modules/execa/lib/ipc/forward.js +0 -56
- package/.output/server/node_modules/execa/lib/ipc/get-each.js +0 -89
- package/.output/server/node_modules/execa/lib/ipc/get-one.js +0 -69
- package/.output/server/node_modules/execa/lib/ipc/graceful.js +0 -72
- package/.output/server/node_modules/execa/lib/ipc/incoming.js +0 -79
- package/.output/server/node_modules/execa/lib/ipc/ipc-input.js +0 -44
- package/.output/server/node_modules/execa/lib/ipc/methods.js +0 -49
- package/.output/server/node_modules/execa/lib/ipc/outgoing.js +0 -47
- package/.output/server/node_modules/execa/lib/ipc/reference.js +0 -44
- package/.output/server/node_modules/execa/lib/ipc/send.js +0 -91
- package/.output/server/node_modules/execa/lib/ipc/strict.js +0 -113
- package/.output/server/node_modules/execa/lib/ipc/validation.js +0 -111
- package/.output/server/node_modules/execa/lib/methods/bind.js +0 -23
- package/.output/server/node_modules/execa/lib/methods/command.js +0 -43
- package/.output/server/node_modules/execa/lib/methods/create.js +0 -65
- package/.output/server/node_modules/execa/lib/methods/main-async.js +0 -194
- package/.output/server/node_modules/execa/lib/methods/main-sync.js +0 -163
- package/.output/server/node_modules/execa/lib/methods/node.js +0 -51
- package/.output/server/node_modules/execa/lib/methods/parameters.js +0 -31
- package/.output/server/node_modules/execa/lib/methods/promise.js +0 -15
- package/.output/server/node_modules/execa/lib/methods/script.js +0 -22
- package/.output/server/node_modules/execa/lib/methods/template.js +0 -153
- package/.output/server/node_modules/execa/lib/pipe/abort.js +0 -20
- package/.output/server/node_modules/execa/lib/pipe/pipe-arguments.js +0 -91
- package/.output/server/node_modules/execa/lib/pipe/sequence.js +0 -24
- package/.output/server/node_modules/execa/lib/pipe/setup.js +0 -72
- package/.output/server/node_modules/execa/lib/pipe/streaming.js +0 -51
- package/.output/server/node_modules/execa/lib/pipe/throw.js +0 -58
- package/.output/server/node_modules/execa/lib/resolve/all-async.js +0 -46
- package/.output/server/node_modules/execa/lib/resolve/all-sync.js +0 -33
- package/.output/server/node_modules/execa/lib/resolve/exit-async.js +0 -54
- package/.output/server/node_modules/execa/lib/resolve/exit-sync.js +0 -25
- package/.output/server/node_modules/execa/lib/resolve/stdio.js +0 -47
- package/.output/server/node_modules/execa/lib/resolve/wait-stream.js +0 -96
- package/.output/server/node_modules/execa/lib/resolve/wait-subprocess.js +0 -146
- package/.output/server/node_modules/execa/lib/return/duration.js +0 -8
- package/.output/server/node_modules/execa/lib/return/early-error.js +0 -60
- package/.output/server/node_modules/execa/lib/return/final-error.js +0 -40
- package/.output/server/node_modules/execa/lib/return/message.js +0 -157
- package/.output/server/node_modules/execa/lib/return/reject.js +0 -13
- package/.output/server/node_modules/execa/lib/return/result.js +0 -186
- package/.output/server/node_modules/execa/lib/stdio/direction.js +0 -76
- package/.output/server/node_modules/execa/lib/stdio/duplicate.js +0 -116
- package/.output/server/node_modules/execa/lib/stdio/handle-async.js +0 -52
- package/.output/server/node_modules/execa/lib/stdio/handle-sync.js +0 -57
- package/.output/server/node_modules/execa/lib/stdio/handle.js +0 -214
- package/.output/server/node_modules/execa/lib/stdio/input-option.js +0 -50
- package/.output/server/node_modules/execa/lib/stdio/native.js +0 -106
- package/.output/server/node_modules/execa/lib/stdio/stdio-option.js +0 -60
- package/.output/server/node_modules/execa/lib/stdio/type.js +0 -173
- package/.output/server/node_modules/execa/lib/terminate/cancel.js +0 -20
- package/.output/server/node_modules/execa/lib/terminate/cleanup.js +0 -16
- package/.output/server/node_modules/execa/lib/terminate/graceful.js +0 -71
- package/.output/server/node_modules/execa/lib/terminate/kill.js +0 -93
- package/.output/server/node_modules/execa/lib/terminate/signal.js +0 -70
- package/.output/server/node_modules/execa/lib/terminate/timeout.js +0 -21
- package/.output/server/node_modules/execa/lib/transform/encoding-transform.js +0 -51
- package/.output/server/node_modules/execa/lib/transform/generator.js +0 -107
- package/.output/server/node_modules/execa/lib/transform/normalize.js +0 -111
- package/.output/server/node_modules/execa/lib/transform/object-mode.js +0 -41
- package/.output/server/node_modules/execa/lib/transform/run-async.js +0 -60
- package/.output/server/node_modules/execa/lib/transform/run-sync.js +0 -50
- package/.output/server/node_modules/execa/lib/transform/split.js +0 -110
- package/.output/server/node_modules/execa/lib/transform/validate.js +0 -43
- package/.output/server/node_modules/execa/lib/utils/abort-signal.js +0 -8
- package/.output/server/node_modules/execa/lib/utils/deferred.js +0 -7
- package/.output/server/node_modules/execa/lib/utils/max-listeners.js +0 -14
- package/.output/server/node_modules/execa/lib/utils/standard-stream.js +0 -6
- package/.output/server/node_modules/execa/lib/utils/uint-array.js +0 -69
- package/.output/server/node_modules/execa/lib/verbose/complete.js +0 -24
- package/.output/server/node_modules/execa/lib/verbose/custom.js +0 -26
- package/.output/server/node_modules/execa/lib/verbose/default.js +0 -54
- package/.output/server/node_modules/execa/lib/verbose/error.js +0 -13
- package/.output/server/node_modules/execa/lib/verbose/info.js +0 -39
- package/.output/server/node_modules/execa/lib/verbose/ipc.js +0 -15
- package/.output/server/node_modules/execa/lib/verbose/log.js +0 -54
- package/.output/server/node_modules/execa/lib/verbose/output.js +0 -60
- package/.output/server/node_modules/execa/lib/verbose/start.js +0 -15
- package/.output/server/node_modules/execa/lib/verbose/values.js +0 -33
- package/.output/server/node_modules/execa/package.json +0 -105
- package/.output/server/node_modules/figures/index.js +0 -292
- package/.output/server/node_modules/figures/package.json +0 -49
- package/.output/server/node_modules/fs-extra/lib/copy/copy-sync.js +0 -176
- package/.output/server/node_modules/fs-extra/lib/copy/copy.js +0 -180
- package/.output/server/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/.output/server/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/.output/server/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/.output/server/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/.output/server/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/.output/server/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/.output/server/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/.output/server/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/.output/server/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/.output/server/node_modules/fs-extra/lib/index.js +0 -16
- package/.output/server/node_modules/fs-extra/lib/json/index.js +0 -16
- package/.output/server/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/.output/server/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/.output/server/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/.output/server/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/.output/server/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/.output/server/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/.output/server/node_modules/fs-extra/lib/move/index.js +0 -7
- package/.output/server/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/.output/server/node_modules/fs-extra/lib/move/move.js +0 -59
- package/.output/server/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/.output/server/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/.output/server/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/.output/server/node_modules/fs-extra/lib/util/async.js +0 -29
- package/.output/server/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/.output/server/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/.output/server/node_modules/fs-extra/package.json +0 -71
- package/.output/server/node_modules/get-stream/package.json +0 -60
- package/.output/server/node_modules/get-stream/source/array-buffer.js +0 -84
- package/.output/server/node_modules/get-stream/source/array.js +0 -32
- package/.output/server/node_modules/get-stream/source/buffer.js +0 -19
- package/.output/server/node_modules/get-stream/source/contents.js +0 -121
- package/.output/server/node_modules/get-stream/source/exports.js +0 -5
- package/.output/server/node_modules/get-stream/source/index.js +0 -13
- package/.output/server/node_modules/get-stream/source/stream.js +0 -65
- package/.output/server/node_modules/get-stream/source/string.js +0 -41
- package/.output/server/node_modules/get-stream/source/utils.js +0 -11
- package/.output/server/node_modules/graceful-fs/clone.js +0 -23
- package/.output/server/node_modules/graceful-fs/graceful-fs.js +0 -448
- package/.output/server/node_modules/graceful-fs/legacy-streams.js +0 -118
- package/.output/server/node_modules/graceful-fs/package.json +0 -53
- package/.output/server/node_modules/graceful-fs/polyfills.js +0 -355
- package/.output/server/node_modules/human-signals/build/src/core.js +0 -273
- package/.output/server/node_modules/human-signals/build/src/main.js +0 -70
- package/.output/server/node_modules/human-signals/build/src/realtime.js +0 -16
- package/.output/server/node_modules/human-signals/build/src/signals.js +0 -34
- package/.output/server/node_modules/human-signals/package.json +0 -66
- package/.output/server/node_modules/is-plain-obj/index.js +0 -8
- package/.output/server/node_modules/is-plain-obj/package.json +0 -41
- package/.output/server/node_modules/is-stream/index.js +0 -37
- package/.output/server/node_modules/is-stream/package.json +0 -48
- package/.output/server/node_modules/is-unicode-supported/index.js +0 -21
- package/.output/server/node_modules/is-unicode-supported/package.json +0 -47
- package/.output/server/node_modules/isexe/index.js +0 -57
- package/.output/server/node_modules/isexe/mode.js +0 -41
- package/.output/server/node_modules/isexe/package.json +0 -31
- package/.output/server/node_modules/isexe/windows.js +0 -42
- package/.output/server/node_modules/js-runtime/dist/index.js +0 -5
- package/.output/server/node_modules/js-runtime/package.json +0 -72
- package/.output/server/node_modules/jsonfile/index.js +0 -88
- package/.output/server/node_modules/jsonfile/package.json +0 -40
- package/.output/server/node_modules/jsonfile/utils.js +0 -14
- package/.output/server/node_modules/mime-db/db.json +0 -7088
- package/.output/server/node_modules/mime-db/index.js +0 -11
- package/.output/server/node_modules/mime-db/package.json +0 -57
- package/.output/server/node_modules/mime-types/index.js +0 -188
- package/.output/server/node_modules/mime-types/package.json +0 -43
- package/.output/server/node_modules/minimatch/minimatch.js +0 -947
- package/.output/server/node_modules/minimatch/package.json +0 -33
- package/.output/server/node_modules/natural-orderby/dist/main.js +0 -19
- package/.output/server/node_modules/natural-orderby/dist/umd/natural-orderby.development.js +0 -420
- package/.output/server/node_modules/natural-orderby/dist/umd/natural-orderby.production.min.js +0 -11
- package/.output/server/node_modules/natural-orderby/package.json +0 -119
- package/.output/server/node_modules/npm-run-path/index.js +0 -55
- package/.output/server/node_modules/npm-run-path/package.json +0 -52
- package/.output/server/node_modules/parse-ms/index.js +0 -45
- package/.output/server/node_modules/parse-ms/package.json +0 -47
- package/.output/server/node_modules/path-is-inside/lib/path-is-inside.js +0 -28
- package/.output/server/node_modules/path-is-inside/package.json +0 -27
- package/.output/server/node_modules/pretty-ms/index.js +0 -149
- package/.output/server/node_modules/pretty-ms/package.json +0 -55
- package/.output/server/node_modules/range-parser/index.js +0 -158
- package/.output/server/node_modules/range-parser/package.json +0 -40
- package/.output/server/node_modules/serve-handler/package.json +0 -68
- package/.output/server/node_modules/serve-handler/src/directory.js +0 -16
- package/.output/server/node_modules/serve-handler/src/error.js +0 -10
- package/.output/server/node_modules/serve-handler/src/glob-slash.js +0 -9
- package/.output/server/node_modules/serve-handler/src/index.js +0 -769
- package/.output/server/node_modules/shebang-command/index.js +0 -19
- package/.output/server/node_modules/shebang-command/package.json +0 -34
- package/.output/server/node_modules/shebang-regex/index.js +0 -2
- package/.output/server/node_modules/shebang-regex/package.json +0 -35
- package/.output/server/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/.output/server/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/.output/server/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/.output/server/node_modules/signal-exit/package.json +0 -106
- package/.output/server/node_modules/string-argv/index.js +0 -41
- package/.output/server/node_modules/string-argv/package.json +0 -51
- package/.output/server/node_modules/strip-final-newline/index.js +0 -26
- package/.output/server/node_modules/strip-final-newline/package.json +0 -49
- package/.output/server/node_modules/unicorn-magic/default.js +0 -14
- package/.output/server/node_modules/unicorn-magic/node.js +0 -49
- package/.output/server/node_modules/unicorn-magic/package.json +0 -62
- package/.output/server/node_modules/universalify/index.js +0 -24
- package/.output/server/node_modules/universalify/package.json +0 -34
- package/.output/server/node_modules/which/package.json +0 -43
- package/.output/server/node_modules/which/which.js +0 -125
- package/.output/server/node_modules/yoctocolors/base.js +0 -94
- package/.output/server/node_modules/yoctocolors/index.js +0 -2
- package/.output/server/node_modules/yoctocolors/package.json +0 -69
- /package/.output/server/node_modules/{.nitro/path-to-regexp@8.3.0 → path-to-regexp}/dist/index.js +0 -0
- /package/.output/server/node_modules/{.nitro/path-to-regexp@8.3.0 → path-to-regexp}/package.json +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const shebangRegex = require('shebang-regex');
|
|
3
|
-
|
|
4
|
-
module.exports = (string = '') => {
|
|
5
|
-
const match = string.match(shebangRegex);
|
|
6
|
-
|
|
7
|
-
if (!match) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
|
|
12
|
-
const binary = path.split('/').pop();
|
|
13
|
-
|
|
14
|
-
if (binary === 'env') {
|
|
15
|
-
return argument;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
19
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "shebang-command",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"description": "Get the command from a shebang",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "kevva/shebang-command",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "Kevin Mårtensson",
|
|
9
|
-
"email": "kevinmartensson@gmail.com",
|
|
10
|
-
"url": "github.com/kevva"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">=8"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "xo && ava"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"index.js"
|
|
20
|
-
],
|
|
21
|
-
"keywords": [
|
|
22
|
-
"cmd",
|
|
23
|
-
"command",
|
|
24
|
-
"parse",
|
|
25
|
-
"shebang"
|
|
26
|
-
],
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"shebang-regex": "^3.0.0"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"ava": "^2.3.0",
|
|
32
|
-
"xo": "^0.24.0"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "shebang-regex",
|
|
3
|
-
"version": "3.0.0",
|
|
4
|
-
"description": "Regular expression for matching a shebang line",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/shebang-regex",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "Sindre Sorhus",
|
|
9
|
-
"email": "sindresorhus@gmail.com",
|
|
10
|
-
"url": "sindresorhus.com"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">=8"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "xo && ava && tsd"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"index.js",
|
|
20
|
-
"index.d.ts"
|
|
21
|
-
],
|
|
22
|
-
"keywords": [
|
|
23
|
-
"regex",
|
|
24
|
-
"regexp",
|
|
25
|
-
"shebang",
|
|
26
|
-
"match",
|
|
27
|
-
"test",
|
|
28
|
-
"line"
|
|
29
|
-
],
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"ava": "^1.4.1",
|
|
32
|
-
"tsd": "^0.7.2",
|
|
33
|
-
"xo": "^0.24.0"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
// Note: since nyc uses this module to output coverage, any lines
|
|
2
|
-
// that are in the direct sync flow of nyc's outputCoverage are
|
|
3
|
-
// ignored, since we can never get coverage for them.
|
|
4
|
-
// grab a reference to node's real process object right away
|
|
5
|
-
import { signals } from './signals.js';
|
|
6
|
-
export { signals };
|
|
7
|
-
const processOk = (process) => !!process &&
|
|
8
|
-
typeof process === 'object' &&
|
|
9
|
-
typeof process.removeListener === 'function' &&
|
|
10
|
-
typeof process.emit === 'function' &&
|
|
11
|
-
typeof process.reallyExit === 'function' &&
|
|
12
|
-
typeof process.listeners === 'function' &&
|
|
13
|
-
typeof process.kill === 'function' &&
|
|
14
|
-
typeof process.pid === 'number' &&
|
|
15
|
-
typeof process.on === 'function';
|
|
16
|
-
const kExitEmitter = Symbol.for('signal-exit emitter');
|
|
17
|
-
const global = globalThis;
|
|
18
|
-
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
19
|
-
// teeny special purpose ee
|
|
20
|
-
class Emitter {
|
|
21
|
-
emitted = {
|
|
22
|
-
afterExit: false,
|
|
23
|
-
exit: false,
|
|
24
|
-
};
|
|
25
|
-
listeners = {
|
|
26
|
-
afterExit: [],
|
|
27
|
-
exit: [],
|
|
28
|
-
};
|
|
29
|
-
count = 0;
|
|
30
|
-
id = Math.random();
|
|
31
|
-
constructor() {
|
|
32
|
-
if (global[kExitEmitter]) {
|
|
33
|
-
return global[kExitEmitter];
|
|
34
|
-
}
|
|
35
|
-
ObjectDefineProperty(global, kExitEmitter, {
|
|
36
|
-
value: this,
|
|
37
|
-
writable: false,
|
|
38
|
-
enumerable: false,
|
|
39
|
-
configurable: false,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
on(ev, fn) {
|
|
43
|
-
this.listeners[ev].push(fn);
|
|
44
|
-
}
|
|
45
|
-
removeListener(ev, fn) {
|
|
46
|
-
const list = this.listeners[ev];
|
|
47
|
-
const i = list.indexOf(fn);
|
|
48
|
-
/* c8 ignore start */
|
|
49
|
-
if (i === -1) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
/* c8 ignore stop */
|
|
53
|
-
if (i === 0 && list.length === 1) {
|
|
54
|
-
list.length = 0;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
list.splice(i, 1);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
emit(ev, code, signal) {
|
|
61
|
-
if (this.emitted[ev]) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
this.emitted[ev] = true;
|
|
65
|
-
let ret = false;
|
|
66
|
-
for (const fn of this.listeners[ev]) {
|
|
67
|
-
ret = fn(code, signal) === true || ret;
|
|
68
|
-
}
|
|
69
|
-
if (ev === 'exit') {
|
|
70
|
-
ret = this.emit('afterExit', code, signal) || ret;
|
|
71
|
-
}
|
|
72
|
-
return ret;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
class SignalExitBase {
|
|
76
|
-
}
|
|
77
|
-
const signalExitWrap = (handler) => {
|
|
78
|
-
return {
|
|
79
|
-
onExit(cb, opts) {
|
|
80
|
-
return handler.onExit(cb, opts);
|
|
81
|
-
},
|
|
82
|
-
load() {
|
|
83
|
-
return handler.load();
|
|
84
|
-
},
|
|
85
|
-
unload() {
|
|
86
|
-
return handler.unload();
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
class SignalExitFallback extends SignalExitBase {
|
|
91
|
-
onExit() {
|
|
92
|
-
return () => { };
|
|
93
|
-
}
|
|
94
|
-
load() { }
|
|
95
|
-
unload() { }
|
|
96
|
-
}
|
|
97
|
-
class SignalExit extends SignalExitBase {
|
|
98
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
99
|
-
// so use a supported signal instead
|
|
100
|
-
/* c8 ignore start */
|
|
101
|
-
#hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';
|
|
102
|
-
/* c8 ignore stop */
|
|
103
|
-
#emitter = new Emitter();
|
|
104
|
-
#process;
|
|
105
|
-
#originalProcessEmit;
|
|
106
|
-
#originalProcessReallyExit;
|
|
107
|
-
#sigListeners = {};
|
|
108
|
-
#loaded = false;
|
|
109
|
-
constructor(process) {
|
|
110
|
-
super();
|
|
111
|
-
this.#process = process;
|
|
112
|
-
// { <signal>: <listener fn>, ... }
|
|
113
|
-
this.#sigListeners = {};
|
|
114
|
-
for (const sig of signals) {
|
|
115
|
-
this.#sigListeners[sig] = () => {
|
|
116
|
-
// If there are no other listeners, an exit is coming!
|
|
117
|
-
// Simplest way: remove us and then re-send the signal.
|
|
118
|
-
// We know that this will kill the process, so we can
|
|
119
|
-
// safely emit now.
|
|
120
|
-
const listeners = this.#process.listeners(sig);
|
|
121
|
-
let { count } = this.#emitter;
|
|
122
|
-
// This is a workaround for the fact that signal-exit v3 and signal
|
|
123
|
-
// exit v4 are not aware of each other, and each will attempt to let
|
|
124
|
-
// the other handle it, so neither of them do. To correct this, we
|
|
125
|
-
// detect if we're the only handler *except* for previous versions
|
|
126
|
-
// of signal-exit, and increment by the count of listeners it has
|
|
127
|
-
// created.
|
|
128
|
-
/* c8 ignore start */
|
|
129
|
-
const p = process;
|
|
130
|
-
if (typeof p.__signal_exit_emitter__ === 'object' &&
|
|
131
|
-
typeof p.__signal_exit_emitter__.count === 'number') {
|
|
132
|
-
count += p.__signal_exit_emitter__.count;
|
|
133
|
-
}
|
|
134
|
-
/* c8 ignore stop */
|
|
135
|
-
if (listeners.length === count) {
|
|
136
|
-
this.unload();
|
|
137
|
-
const ret = this.#emitter.emit('exit', null, sig);
|
|
138
|
-
/* c8 ignore start */
|
|
139
|
-
const s = sig === 'SIGHUP' ? this.#hupSig : sig;
|
|
140
|
-
if (!ret)
|
|
141
|
-
process.kill(process.pid, s);
|
|
142
|
-
/* c8 ignore stop */
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
this.#originalProcessReallyExit = process.reallyExit;
|
|
147
|
-
this.#originalProcessEmit = process.emit;
|
|
148
|
-
}
|
|
149
|
-
onExit(cb, opts) {
|
|
150
|
-
/* c8 ignore start */
|
|
151
|
-
if (!processOk(this.#process)) {
|
|
152
|
-
return () => { };
|
|
153
|
-
}
|
|
154
|
-
/* c8 ignore stop */
|
|
155
|
-
if (this.#loaded === false) {
|
|
156
|
-
this.load();
|
|
157
|
-
}
|
|
158
|
-
const ev = opts?.alwaysLast ? 'afterExit' : 'exit';
|
|
159
|
-
this.#emitter.on(ev, cb);
|
|
160
|
-
return () => {
|
|
161
|
-
this.#emitter.removeListener(ev, cb);
|
|
162
|
-
if (this.#emitter.listeners['exit'].length === 0 &&
|
|
163
|
-
this.#emitter.listeners['afterExit'].length === 0) {
|
|
164
|
-
this.unload();
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
load() {
|
|
169
|
-
if (this.#loaded) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
this.#loaded = true;
|
|
173
|
-
// This is the number of onSignalExit's that are in play.
|
|
174
|
-
// It's important so that we can count the correct number of
|
|
175
|
-
// listeners on signals, and don't wait for the other one to
|
|
176
|
-
// handle it instead of us.
|
|
177
|
-
this.#emitter.count += 1;
|
|
178
|
-
for (const sig of signals) {
|
|
179
|
-
try {
|
|
180
|
-
const fn = this.#sigListeners[sig];
|
|
181
|
-
if (fn)
|
|
182
|
-
this.#process.on(sig, fn);
|
|
183
|
-
}
|
|
184
|
-
catch (_) { }
|
|
185
|
-
}
|
|
186
|
-
this.#process.emit = (ev, ...a) => {
|
|
187
|
-
return this.#processEmit(ev, ...a);
|
|
188
|
-
};
|
|
189
|
-
this.#process.reallyExit = (code) => {
|
|
190
|
-
return this.#processReallyExit(code);
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
unload() {
|
|
194
|
-
if (!this.#loaded) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
this.#loaded = false;
|
|
198
|
-
signals.forEach(sig => {
|
|
199
|
-
const listener = this.#sigListeners[sig];
|
|
200
|
-
/* c8 ignore start */
|
|
201
|
-
if (!listener) {
|
|
202
|
-
throw new Error('Listener not defined for signal: ' + sig);
|
|
203
|
-
}
|
|
204
|
-
/* c8 ignore stop */
|
|
205
|
-
try {
|
|
206
|
-
this.#process.removeListener(sig, listener);
|
|
207
|
-
/* c8 ignore start */
|
|
208
|
-
}
|
|
209
|
-
catch (_) { }
|
|
210
|
-
/* c8 ignore stop */
|
|
211
|
-
});
|
|
212
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
213
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
214
|
-
this.#emitter.count -= 1;
|
|
215
|
-
}
|
|
216
|
-
#processReallyExit(code) {
|
|
217
|
-
/* c8 ignore start */
|
|
218
|
-
if (!processOk(this.#process)) {
|
|
219
|
-
return 0;
|
|
220
|
-
}
|
|
221
|
-
this.#process.exitCode = code || 0;
|
|
222
|
-
/* c8 ignore stop */
|
|
223
|
-
this.#emitter.emit('exit', this.#process.exitCode, null);
|
|
224
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
225
|
-
}
|
|
226
|
-
#processEmit(ev, ...args) {
|
|
227
|
-
const og = this.#originalProcessEmit;
|
|
228
|
-
if (ev === 'exit' && processOk(this.#process)) {
|
|
229
|
-
if (typeof args[0] === 'number') {
|
|
230
|
-
this.#process.exitCode = args[0];
|
|
231
|
-
/* c8 ignore start */
|
|
232
|
-
}
|
|
233
|
-
/* c8 ignore start */
|
|
234
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
235
|
-
/* c8 ignore start */
|
|
236
|
-
this.#emitter.emit('exit', this.#process.exitCode, null);
|
|
237
|
-
/* c8 ignore stop */
|
|
238
|
-
return ret;
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
return og.call(this.#process, ev, ...args);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
const process = globalThis.process;
|
|
246
|
-
// wrap so that we call the method on the actual handler, without
|
|
247
|
-
// exporting it directly.
|
|
248
|
-
export const {
|
|
249
|
-
/**
|
|
250
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
251
|
-
* exit, or running out of stuff to do.
|
|
252
|
-
*
|
|
253
|
-
* If the global process object is not suitable for instrumentation,
|
|
254
|
-
* then this will be a no-op.
|
|
255
|
-
*
|
|
256
|
-
* Returns a function that may be used to unload signal-exit.
|
|
257
|
-
*/
|
|
258
|
-
onExit,
|
|
259
|
-
/**
|
|
260
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
261
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
262
|
-
* Mostly exposed for the benefit of testing.
|
|
263
|
-
*
|
|
264
|
-
* @internal
|
|
265
|
-
*/
|
|
266
|
-
load,
|
|
267
|
-
/**
|
|
268
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
269
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
270
|
-
* Mostly exposed for the benefit of testing.
|
|
271
|
-
*
|
|
272
|
-
* @internal
|
|
273
|
-
*/
|
|
274
|
-
unload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback());
|
|
275
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is not the set of all possible signals.
|
|
3
|
-
*
|
|
4
|
-
* It IS, however, the set of all signals that trigger
|
|
5
|
-
* an exit on either Linux or BSD systems. Linux is a
|
|
6
|
-
* superset of the signal names supported on BSD, and
|
|
7
|
-
* the unknown signals just fail to register, so we can
|
|
8
|
-
* catch that easily enough.
|
|
9
|
-
*
|
|
10
|
-
* Windows signals are a different set, since there are
|
|
11
|
-
* signals that terminate Windows processes, but don't
|
|
12
|
-
* terminate (or don't even exist) on Posix systems.
|
|
13
|
-
*
|
|
14
|
-
* Don't bother with SIGKILL. It's uncatchable, which
|
|
15
|
-
* means that we can't fire any callbacks anyway.
|
|
16
|
-
*
|
|
17
|
-
* If a user does happen to register a handler on a non-
|
|
18
|
-
* fatal signal like SIGWINCH or something, and then
|
|
19
|
-
* exit, it'll end up firing `process.emit('exit')`, so
|
|
20
|
-
* the handler will be fired anyway.
|
|
21
|
-
*
|
|
22
|
-
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
23
|
-
* artificially, inherently leave the process in a
|
|
24
|
-
* state from which it is not safe to try and enter JS
|
|
25
|
-
* listeners.
|
|
26
|
-
*/
|
|
27
|
-
export const signals = [];
|
|
28
|
-
signals.push('SIGHUP', 'SIGINT', 'SIGTERM');
|
|
29
|
-
if (process.platform !== 'win32') {
|
|
30
|
-
signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
|
|
31
|
-
// should detect profiler and enable/disable accordingly.
|
|
32
|
-
// see #21
|
|
33
|
-
// 'SIGPROF'
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
if (process.platform === 'linux') {
|
|
37
|
-
signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=signals.js.map
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "signal-exit",
|
|
3
|
-
"version": "4.1.0",
|
|
4
|
-
"description": "when you want to fire an event no matter how a process exits.",
|
|
5
|
-
"main": "./dist/cjs/index.js",
|
|
6
|
-
"module": "./dist/mjs/index.js",
|
|
7
|
-
"browser": "./dist/mjs/browser.js",
|
|
8
|
-
"types": "./dist/mjs/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": {
|
|
12
|
-
"types": "./dist/mjs/index.d.ts",
|
|
13
|
-
"default": "./dist/mjs/index.js"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/cjs/index.d.ts",
|
|
17
|
-
"default": "./dist/cjs/index.js"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"./signals": {
|
|
21
|
-
"import": {
|
|
22
|
-
"types": "./dist/mjs/signals.d.ts",
|
|
23
|
-
"default": "./dist/mjs/signals.js"
|
|
24
|
-
},
|
|
25
|
-
"require": {
|
|
26
|
-
"types": "./dist/cjs/signals.d.ts",
|
|
27
|
-
"default": "./dist/cjs/signals.js"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"./browser": {
|
|
31
|
-
"import": {
|
|
32
|
-
"types": "./dist/mjs/browser.d.ts",
|
|
33
|
-
"default": "./dist/mjs/browser.js"
|
|
34
|
-
},
|
|
35
|
-
"require": {
|
|
36
|
-
"types": "./dist/cjs/browser.d.ts",
|
|
37
|
-
"default": "./dist/cjs/browser.js"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"files": [
|
|
42
|
-
"dist"
|
|
43
|
-
],
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=14"
|
|
46
|
-
},
|
|
47
|
-
"repository": {
|
|
48
|
-
"type": "git",
|
|
49
|
-
"url": "https://github.com/tapjs/signal-exit.git"
|
|
50
|
-
},
|
|
51
|
-
"keywords": [
|
|
52
|
-
"signal",
|
|
53
|
-
"exit"
|
|
54
|
-
],
|
|
55
|
-
"author": "Ben Coe <ben@npmjs.com>",
|
|
56
|
-
"license": "ISC",
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@types/cross-spawn": "^6.0.2",
|
|
59
|
-
"@types/node": "^18.15.11",
|
|
60
|
-
"@types/signal-exit": "^3.0.1",
|
|
61
|
-
"@types/tap": "^15.0.8",
|
|
62
|
-
"c8": "^7.13.0",
|
|
63
|
-
"prettier": "^2.8.6",
|
|
64
|
-
"tap": "^16.3.4",
|
|
65
|
-
"ts-node": "^10.9.1",
|
|
66
|
-
"typedoc": "^0.23.28",
|
|
67
|
-
"typescript": "^5.0.2"
|
|
68
|
-
},
|
|
69
|
-
"scripts": {
|
|
70
|
-
"preversion": "npm test",
|
|
71
|
-
"postversion": "npm publish",
|
|
72
|
-
"prepublishOnly": "git push origin --follow-tags",
|
|
73
|
-
"preprepare": "rm -rf dist",
|
|
74
|
-
"prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh",
|
|
75
|
-
"pretest": "npm run prepare",
|
|
76
|
-
"presnap": "npm run prepare",
|
|
77
|
-
"test": "c8 tap",
|
|
78
|
-
"snap": "c8 tap",
|
|
79
|
-
"format": "prettier --write . --loglevel warn",
|
|
80
|
-
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts"
|
|
81
|
-
},
|
|
82
|
-
"prettier": {
|
|
83
|
-
"semi": false,
|
|
84
|
-
"printWidth": 75,
|
|
85
|
-
"tabWidth": 2,
|
|
86
|
-
"useTabs": false,
|
|
87
|
-
"singleQuote": true,
|
|
88
|
-
"jsxSingleQuote": false,
|
|
89
|
-
"bracketSameLine": true,
|
|
90
|
-
"arrowParens": "avoid",
|
|
91
|
-
"endOfLine": "lf"
|
|
92
|
-
},
|
|
93
|
-
"tap": {
|
|
94
|
-
"coverage": false,
|
|
95
|
-
"jobs": 1,
|
|
96
|
-
"node-arg": [
|
|
97
|
-
"--no-warnings",
|
|
98
|
-
"--loader",
|
|
99
|
-
"ts-node/esm"
|
|
100
|
-
],
|
|
101
|
-
"ts": false
|
|
102
|
-
},
|
|
103
|
-
"funding": {
|
|
104
|
-
"url": "https://github.com/sponsors/isaacs"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export { parseArgsStringToArgv };
|
|
2
|
-
export default function parseArgsStringToArgv(value, env, file) {
|
|
3
|
-
// ([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*) Matches nested quotes until the first space outside of quotes
|
|
4
|
-
// [^\s'"]+ or Match if not a space ' or "
|
|
5
|
-
// (['"])([^\5]*?)\5 or Match "quoted text" without quotes
|
|
6
|
-
// `\3` and `\5` are a backreference to the quote style (' or ") captured
|
|
7
|
-
var myRegexp = /([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi;
|
|
8
|
-
var myString = value;
|
|
9
|
-
var myArray = [];
|
|
10
|
-
if (env) {
|
|
11
|
-
myArray.push(env);
|
|
12
|
-
}
|
|
13
|
-
if (file) {
|
|
14
|
-
myArray.push(file);
|
|
15
|
-
}
|
|
16
|
-
var match;
|
|
17
|
-
do {
|
|
18
|
-
// Each call to exec returns the next regex match as an array
|
|
19
|
-
match = myRegexp.exec(myString);
|
|
20
|
-
if (match !== null) {
|
|
21
|
-
// Index 1 in the array is the captured group if it exists
|
|
22
|
-
// Index 0 is the matched text, which we use if no captured group exists
|
|
23
|
-
myArray.push(firstString(match[1], match[6], match[0]));
|
|
24
|
-
}
|
|
25
|
-
} while (match !== null);
|
|
26
|
-
return myArray;
|
|
27
|
-
}
|
|
28
|
-
// Accepts any number of arguments, and returns the first one that is a string
|
|
29
|
-
// (even an empty string)
|
|
30
|
-
function firstString() {
|
|
31
|
-
var args = [];
|
|
32
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
33
|
-
args[_i] = arguments[_i];
|
|
34
|
-
}
|
|
35
|
-
for (var i = 0; i < args.length; i++) {
|
|
36
|
-
var arg = args[i];
|
|
37
|
-
if (typeof arg === "string") {
|
|
38
|
-
return arg;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "string-argv",
|
|
3
|
-
"description": "string-argv parses a string into an argument array to mimic process.argv. This is useful when testing Command Line Utilities that you want to pass arguments to.",
|
|
4
|
-
"version": "0.3.2",
|
|
5
|
-
"contributors": [
|
|
6
|
-
{
|
|
7
|
-
"name": "Michael Ferris",
|
|
8
|
-
"email": "mike.ferri@hotmail.com"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"author": {
|
|
12
|
-
"name": "Anthony McCormick",
|
|
13
|
-
"email": "anthony.mccormick@gmail.com"
|
|
14
|
-
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"argv"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc -p . & tsc -p tsconfig.commonjs.json",
|
|
21
|
-
"prepublishOnly": "npm test",
|
|
22
|
-
"test": "npm run build & jasmine --config=test/config.json"
|
|
23
|
-
},
|
|
24
|
-
"type": "module",
|
|
25
|
-
"exports": {
|
|
26
|
-
".": {
|
|
27
|
-
"types": "./index.d.ts",
|
|
28
|
-
"import": "./index.js",
|
|
29
|
-
"require": "./commonjs/index.js"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"main": "./commonjs/index.js",
|
|
33
|
-
"module": "./index.js",
|
|
34
|
-
"types": "index.d.ts",
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=0.6.19"
|
|
37
|
-
},
|
|
38
|
-
"bugs": {
|
|
39
|
-
"url": "https://github.com/mccormicka/string-argv/issues"
|
|
40
|
-
},
|
|
41
|
-
"repository": {
|
|
42
|
-
"type": "git",
|
|
43
|
-
"url": "https://github.com/mccormicka/string-argv"
|
|
44
|
-
},
|
|
45
|
-
"homepage": "https://github.com/mccormicka/string-argv",
|
|
46
|
-
"readmeFilename": "README.md",
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"jasmine": "^4.4.0",
|
|
49
|
-
"typescript": "^5.0.4"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default function stripFinalNewline(input) {
|
|
2
|
-
if (typeof input === 'string') {
|
|
3
|
-
return stripFinalNewlineString(input);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
if (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) {
|
|
7
|
-
throw new Error('Input must be a string or a Uint8Array');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return stripFinalNewlineBinary(input);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const stripFinalNewlineString = input =>
|
|
14
|
-
input.at(-1) === LF
|
|
15
|
-
? input.slice(0, input.at(-2) === CR ? -2 : -1)
|
|
16
|
-
: input;
|
|
17
|
-
|
|
18
|
-
const stripFinalNewlineBinary = input =>
|
|
19
|
-
input.at(-1) === LF_BINARY
|
|
20
|
-
? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1)
|
|
21
|
-
: input;
|
|
22
|
-
|
|
23
|
-
const LF = '\n';
|
|
24
|
-
const LF_BINARY = LF.codePointAt(0);
|
|
25
|
-
const CR = '\r';
|
|
26
|
-
const CR_BINARY = CR.codePointAt(0);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "strip-final-newline",
|
|
3
|
-
"version": "4.0.0",
|
|
4
|
-
"description": "Strip the final newline character from a string or Uint8Array",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/strip-final-newline",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": {
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"default": "./index.js"
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": false,
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "xo && ava && tsd"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"strip",
|
|
31
|
-
"trim",
|
|
32
|
-
"remove",
|
|
33
|
-
"delete",
|
|
34
|
-
"final",
|
|
35
|
-
"last",
|
|
36
|
-
"end",
|
|
37
|
-
"file",
|
|
38
|
-
"newline",
|
|
39
|
-
"linebreak",
|
|
40
|
-
"character",
|
|
41
|
-
"string",
|
|
42
|
-
"uint8array"
|
|
43
|
-
],
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"ava": "^6.0.1",
|
|
46
|
-
"tsd": "^0.29.0",
|
|
47
|
-
"xo": "^0.56.0"
|
|
48
|
-
}
|
|
49
|
-
}
|