@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,292 +0,0 @@
|
|
|
1
|
-
import isUnicodeSupported from 'is-unicode-supported';
|
|
2
|
-
|
|
3
|
-
const common = {
|
|
4
|
-
circleQuestionMark: '(?)',
|
|
5
|
-
questionMarkPrefix: '(?)',
|
|
6
|
-
square: '█',
|
|
7
|
-
squareDarkShade: '▓',
|
|
8
|
-
squareMediumShade: '▒',
|
|
9
|
-
squareLightShade: '░',
|
|
10
|
-
squareTop: '▀',
|
|
11
|
-
squareBottom: '▄',
|
|
12
|
-
squareLeft: '▌',
|
|
13
|
-
squareRight: '▐',
|
|
14
|
-
squareCenter: '■',
|
|
15
|
-
bullet: '●',
|
|
16
|
-
dot: '․',
|
|
17
|
-
ellipsis: '…',
|
|
18
|
-
pointerSmall: '›',
|
|
19
|
-
triangleUp: '▲',
|
|
20
|
-
triangleUpSmall: '▴',
|
|
21
|
-
triangleDown: '▼',
|
|
22
|
-
triangleDownSmall: '▾',
|
|
23
|
-
triangleLeftSmall: '◂',
|
|
24
|
-
triangleRightSmall: '▸',
|
|
25
|
-
home: '⌂',
|
|
26
|
-
heart: '♥',
|
|
27
|
-
musicNote: '♪',
|
|
28
|
-
musicNoteBeamed: '♫',
|
|
29
|
-
arrowUp: '↑',
|
|
30
|
-
arrowDown: '↓',
|
|
31
|
-
arrowLeft: '←',
|
|
32
|
-
arrowRight: '→',
|
|
33
|
-
arrowLeftRight: '↔',
|
|
34
|
-
arrowUpDown: '↕',
|
|
35
|
-
almostEqual: '≈',
|
|
36
|
-
notEqual: '≠',
|
|
37
|
-
lessOrEqual: '≤',
|
|
38
|
-
greaterOrEqual: '≥',
|
|
39
|
-
identical: '≡',
|
|
40
|
-
infinity: '∞',
|
|
41
|
-
subscriptZero: '₀',
|
|
42
|
-
subscriptOne: '₁',
|
|
43
|
-
subscriptTwo: '₂',
|
|
44
|
-
subscriptThree: '₃',
|
|
45
|
-
subscriptFour: '₄',
|
|
46
|
-
subscriptFive: '₅',
|
|
47
|
-
subscriptSix: '₆',
|
|
48
|
-
subscriptSeven: '₇',
|
|
49
|
-
subscriptEight: '₈',
|
|
50
|
-
subscriptNine: '₉',
|
|
51
|
-
oneHalf: '½',
|
|
52
|
-
oneThird: '⅓',
|
|
53
|
-
oneQuarter: '¼',
|
|
54
|
-
oneFifth: '⅕',
|
|
55
|
-
oneSixth: '⅙',
|
|
56
|
-
oneEighth: '⅛',
|
|
57
|
-
twoThirds: '⅔',
|
|
58
|
-
twoFifths: '⅖',
|
|
59
|
-
threeQuarters: '¾',
|
|
60
|
-
threeFifths: '⅗',
|
|
61
|
-
threeEighths: '⅜',
|
|
62
|
-
fourFifths: '⅘',
|
|
63
|
-
fiveSixths: '⅚',
|
|
64
|
-
fiveEighths: '⅝',
|
|
65
|
-
sevenEighths: '⅞',
|
|
66
|
-
line: '─',
|
|
67
|
-
lineBold: '━',
|
|
68
|
-
lineDouble: '═',
|
|
69
|
-
lineDashed0: '┄',
|
|
70
|
-
lineDashed1: '┅',
|
|
71
|
-
lineDashed2: '┈',
|
|
72
|
-
lineDashed3: '┉',
|
|
73
|
-
lineDashed4: '╌',
|
|
74
|
-
lineDashed5: '╍',
|
|
75
|
-
lineDashed6: '╴',
|
|
76
|
-
lineDashed7: '╶',
|
|
77
|
-
lineDashed8: '╸',
|
|
78
|
-
lineDashed9: '╺',
|
|
79
|
-
lineDashed10: '╼',
|
|
80
|
-
lineDashed11: '╾',
|
|
81
|
-
lineDashed12: '−',
|
|
82
|
-
lineDashed13: '–',
|
|
83
|
-
lineDashed14: '‐',
|
|
84
|
-
lineDashed15: '⁃',
|
|
85
|
-
lineVertical: '│',
|
|
86
|
-
lineVerticalBold: '┃',
|
|
87
|
-
lineVerticalDouble: '║',
|
|
88
|
-
lineVerticalDashed0: '┆',
|
|
89
|
-
lineVerticalDashed1: '┇',
|
|
90
|
-
lineVerticalDashed2: '┊',
|
|
91
|
-
lineVerticalDashed3: '┋',
|
|
92
|
-
lineVerticalDashed4: '╎',
|
|
93
|
-
lineVerticalDashed5: '╏',
|
|
94
|
-
lineVerticalDashed6: '╵',
|
|
95
|
-
lineVerticalDashed7: '╷',
|
|
96
|
-
lineVerticalDashed8: '╹',
|
|
97
|
-
lineVerticalDashed9: '╻',
|
|
98
|
-
lineVerticalDashed10: '╽',
|
|
99
|
-
lineVerticalDashed11: '╿',
|
|
100
|
-
lineDownLeft: '┐',
|
|
101
|
-
lineDownLeftArc: '╮',
|
|
102
|
-
lineDownBoldLeftBold: '┓',
|
|
103
|
-
lineDownBoldLeft: '┒',
|
|
104
|
-
lineDownLeftBold: '┑',
|
|
105
|
-
lineDownDoubleLeftDouble: '╗',
|
|
106
|
-
lineDownDoubleLeft: '╖',
|
|
107
|
-
lineDownLeftDouble: '╕',
|
|
108
|
-
lineDownRight: '┌',
|
|
109
|
-
lineDownRightArc: '╭',
|
|
110
|
-
lineDownBoldRightBold: '┏',
|
|
111
|
-
lineDownBoldRight: '┎',
|
|
112
|
-
lineDownRightBold: '┍',
|
|
113
|
-
lineDownDoubleRightDouble: '╔',
|
|
114
|
-
lineDownDoubleRight: '╓',
|
|
115
|
-
lineDownRightDouble: '╒',
|
|
116
|
-
lineUpLeft: '┘',
|
|
117
|
-
lineUpLeftArc: '╯',
|
|
118
|
-
lineUpBoldLeftBold: '┛',
|
|
119
|
-
lineUpBoldLeft: '┚',
|
|
120
|
-
lineUpLeftBold: '┙',
|
|
121
|
-
lineUpDoubleLeftDouble: '╝',
|
|
122
|
-
lineUpDoubleLeft: '╜',
|
|
123
|
-
lineUpLeftDouble: '╛',
|
|
124
|
-
lineUpRight: '└',
|
|
125
|
-
lineUpRightArc: '╰',
|
|
126
|
-
lineUpBoldRightBold: '┗',
|
|
127
|
-
lineUpBoldRight: '┖',
|
|
128
|
-
lineUpRightBold: '┕',
|
|
129
|
-
lineUpDoubleRightDouble: '╚',
|
|
130
|
-
lineUpDoubleRight: '╙',
|
|
131
|
-
lineUpRightDouble: '╘',
|
|
132
|
-
lineUpDownLeft: '┤',
|
|
133
|
-
lineUpBoldDownBoldLeftBold: '┫',
|
|
134
|
-
lineUpBoldDownBoldLeft: '┨',
|
|
135
|
-
lineUpDownLeftBold: '┥',
|
|
136
|
-
lineUpBoldDownLeftBold: '┩',
|
|
137
|
-
lineUpDownBoldLeftBold: '┪',
|
|
138
|
-
lineUpDownBoldLeft: '┧',
|
|
139
|
-
lineUpBoldDownLeft: '┦',
|
|
140
|
-
lineUpDoubleDownDoubleLeftDouble: '╣',
|
|
141
|
-
lineUpDoubleDownDoubleLeft: '╢',
|
|
142
|
-
lineUpDownLeftDouble: '╡',
|
|
143
|
-
lineUpDownRight: '├',
|
|
144
|
-
lineUpBoldDownBoldRightBold: '┣',
|
|
145
|
-
lineUpBoldDownBoldRight: '┠',
|
|
146
|
-
lineUpDownRightBold: '┝',
|
|
147
|
-
lineUpBoldDownRightBold: '┡',
|
|
148
|
-
lineUpDownBoldRightBold: '┢',
|
|
149
|
-
lineUpDownBoldRight: '┟',
|
|
150
|
-
lineUpBoldDownRight: '┞',
|
|
151
|
-
lineUpDoubleDownDoubleRightDouble: '╠',
|
|
152
|
-
lineUpDoubleDownDoubleRight: '╟',
|
|
153
|
-
lineUpDownRightDouble: '╞',
|
|
154
|
-
lineDownLeftRight: '┬',
|
|
155
|
-
lineDownBoldLeftBoldRightBold: '┳',
|
|
156
|
-
lineDownLeftBoldRightBold: '┯',
|
|
157
|
-
lineDownBoldLeftRight: '┰',
|
|
158
|
-
lineDownBoldLeftBoldRight: '┱',
|
|
159
|
-
lineDownBoldLeftRightBold: '┲',
|
|
160
|
-
lineDownLeftRightBold: '┮',
|
|
161
|
-
lineDownLeftBoldRight: '┭',
|
|
162
|
-
lineDownDoubleLeftDoubleRightDouble: '╦',
|
|
163
|
-
lineDownDoubleLeftRight: '╥',
|
|
164
|
-
lineDownLeftDoubleRightDouble: '╤',
|
|
165
|
-
lineUpLeftRight: '┴',
|
|
166
|
-
lineUpBoldLeftBoldRightBold: '┻',
|
|
167
|
-
lineUpLeftBoldRightBold: '┷',
|
|
168
|
-
lineUpBoldLeftRight: '┸',
|
|
169
|
-
lineUpBoldLeftBoldRight: '┹',
|
|
170
|
-
lineUpBoldLeftRightBold: '┺',
|
|
171
|
-
lineUpLeftRightBold: '┶',
|
|
172
|
-
lineUpLeftBoldRight: '┵',
|
|
173
|
-
lineUpDoubleLeftDoubleRightDouble: '╩',
|
|
174
|
-
lineUpDoubleLeftRight: '╨',
|
|
175
|
-
lineUpLeftDoubleRightDouble: '╧',
|
|
176
|
-
lineUpDownLeftRight: '┼',
|
|
177
|
-
lineUpBoldDownBoldLeftBoldRightBold: '╋',
|
|
178
|
-
lineUpDownBoldLeftBoldRightBold: '╈',
|
|
179
|
-
lineUpBoldDownLeftBoldRightBold: '╇',
|
|
180
|
-
lineUpBoldDownBoldLeftRightBold: '╊',
|
|
181
|
-
lineUpBoldDownBoldLeftBoldRight: '╉',
|
|
182
|
-
lineUpBoldDownLeftRight: '╀',
|
|
183
|
-
lineUpDownBoldLeftRight: '╁',
|
|
184
|
-
lineUpDownLeftBoldRight: '┽',
|
|
185
|
-
lineUpDownLeftRightBold: '┾',
|
|
186
|
-
lineUpBoldDownBoldLeftRight: '╂',
|
|
187
|
-
lineUpDownLeftBoldRightBold: '┿',
|
|
188
|
-
lineUpBoldDownLeftBoldRight: '╃',
|
|
189
|
-
lineUpBoldDownLeftRightBold: '╄',
|
|
190
|
-
lineUpDownBoldLeftBoldRight: '╅',
|
|
191
|
-
lineUpDownBoldLeftRightBold: '╆',
|
|
192
|
-
lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',
|
|
193
|
-
lineUpDoubleDownDoubleLeftRight: '╫',
|
|
194
|
-
lineUpDownLeftDoubleRightDouble: '╪',
|
|
195
|
-
lineCross: '╳',
|
|
196
|
-
lineBackslash: '╲',
|
|
197
|
-
lineSlash: '╱',
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
const specialMainSymbols = {
|
|
201
|
-
tick: '✔',
|
|
202
|
-
info: 'ℹ',
|
|
203
|
-
warning: '⚠',
|
|
204
|
-
cross: '✘',
|
|
205
|
-
squareSmall: '◻',
|
|
206
|
-
squareSmallFilled: '◼',
|
|
207
|
-
circle: '◯',
|
|
208
|
-
circleFilled: '◉',
|
|
209
|
-
circleDotted: '◌',
|
|
210
|
-
circleDouble: '◎',
|
|
211
|
-
circleCircle: 'ⓞ',
|
|
212
|
-
circleCross: 'ⓧ',
|
|
213
|
-
circlePipe: 'Ⓘ',
|
|
214
|
-
radioOn: '◉',
|
|
215
|
-
radioOff: '◯',
|
|
216
|
-
checkboxOn: '☒',
|
|
217
|
-
checkboxOff: '☐',
|
|
218
|
-
checkboxCircleOn: 'ⓧ',
|
|
219
|
-
checkboxCircleOff: 'Ⓘ',
|
|
220
|
-
pointer: '❯',
|
|
221
|
-
triangleUpOutline: '△',
|
|
222
|
-
triangleLeft: '◀',
|
|
223
|
-
triangleRight: '▶',
|
|
224
|
-
lozenge: '◆',
|
|
225
|
-
lozengeOutline: '◇',
|
|
226
|
-
hamburger: '☰',
|
|
227
|
-
smiley: '㋡',
|
|
228
|
-
mustache: '෴',
|
|
229
|
-
star: '★',
|
|
230
|
-
play: '▶',
|
|
231
|
-
nodejs: '⬢',
|
|
232
|
-
oneSeventh: '⅐',
|
|
233
|
-
oneNinth: '⅑',
|
|
234
|
-
oneTenth: '⅒',
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
const specialFallbackSymbols = {
|
|
238
|
-
tick: '√',
|
|
239
|
-
info: 'i',
|
|
240
|
-
warning: '‼',
|
|
241
|
-
cross: '×',
|
|
242
|
-
squareSmall: '□',
|
|
243
|
-
squareSmallFilled: '■',
|
|
244
|
-
circle: '( )',
|
|
245
|
-
circleFilled: '(*)',
|
|
246
|
-
circleDotted: '( )',
|
|
247
|
-
circleDouble: '( )',
|
|
248
|
-
circleCircle: '(○)',
|
|
249
|
-
circleCross: '(×)',
|
|
250
|
-
circlePipe: '(│)',
|
|
251
|
-
radioOn: '(*)',
|
|
252
|
-
radioOff: '( )',
|
|
253
|
-
checkboxOn: '[×]',
|
|
254
|
-
checkboxOff: '[ ]',
|
|
255
|
-
checkboxCircleOn: '(×)',
|
|
256
|
-
checkboxCircleOff: '( )',
|
|
257
|
-
pointer: '>',
|
|
258
|
-
triangleUpOutline: '∆',
|
|
259
|
-
triangleLeft: '◄',
|
|
260
|
-
triangleRight: '►',
|
|
261
|
-
lozenge: '♦',
|
|
262
|
-
lozengeOutline: '◊',
|
|
263
|
-
hamburger: '≡',
|
|
264
|
-
smiley: '☺',
|
|
265
|
-
mustache: '┌─┐',
|
|
266
|
-
star: '✶',
|
|
267
|
-
play: '►',
|
|
268
|
-
nodejs: '♦',
|
|
269
|
-
oneSeventh: '1/7',
|
|
270
|
-
oneNinth: '1/9',
|
|
271
|
-
oneTenth: '1/10',
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
export const mainSymbols = {...common, ...specialMainSymbols};
|
|
275
|
-
export const fallbackSymbols = {...common, ...specialFallbackSymbols};
|
|
276
|
-
|
|
277
|
-
const shouldUseMain = isUnicodeSupported();
|
|
278
|
-
const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
279
|
-
export default figures;
|
|
280
|
-
|
|
281
|
-
const replacements = Object.entries(specialMainSymbols);
|
|
282
|
-
|
|
283
|
-
// On terminals which do not support Unicode symbols, substitute them to other symbols
|
|
284
|
-
export const replaceSymbols = (string, {useFallback = !shouldUseMain} = {}) => {
|
|
285
|
-
if (useFallback) {
|
|
286
|
-
for (const [key, mainSymbol] of replacements) {
|
|
287
|
-
string = string.replaceAll(mainSymbol, fallbackSymbols[key]);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return string;
|
|
292
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "figures",
|
|
3
|
-
"version": "6.1.0",
|
|
4
|
-
"description": "Unicode symbols with fallbacks for older terminals",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/figures",
|
|
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
|
-
"unicode",
|
|
31
|
-
"cli",
|
|
32
|
-
"cmd",
|
|
33
|
-
"command-line",
|
|
34
|
-
"characters",
|
|
35
|
-
"symbol",
|
|
36
|
-
"symbols",
|
|
37
|
-
"figure",
|
|
38
|
-
"figures",
|
|
39
|
-
"fallback"
|
|
40
|
-
],
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"is-unicode-supported": "^2.0.0"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"ava": "^5.3.1",
|
|
46
|
-
"tsd": "^0.29.0",
|
|
47
|
-
"xo": "^0.56.0"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const fs = require('graceful-fs')
|
|
4
|
-
const path = require('path')
|
|
5
|
-
const mkdirsSync = require('../mkdirs').mkdirsSync
|
|
6
|
-
const utimesMillisSync = require('../util/utimes').utimesMillisSync
|
|
7
|
-
const stat = require('../util/stat')
|
|
8
|
-
|
|
9
|
-
function copySync (src, dest, opts) {
|
|
10
|
-
if (typeof opts === 'function') {
|
|
11
|
-
opts = { filter: opts }
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
opts = opts || {}
|
|
15
|
-
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
|
16
|
-
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
|
17
|
-
|
|
18
|
-
// Warn about using preserveTimestamps on 32-bit node
|
|
19
|
-
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
|
20
|
-
process.emitWarning(
|
|
21
|
-
'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
|
|
22
|
-
'\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
|
|
23
|
-
'Warning', 'fs-extra-WARN0002'
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
|
|
28
|
-
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
|
|
29
|
-
if (opts.filter && !opts.filter(src, dest)) return
|
|
30
|
-
const destParent = path.dirname(dest)
|
|
31
|
-
if (!fs.existsSync(destParent)) mkdirsSync(destParent)
|
|
32
|
-
return getStats(destStat, src, dest, opts)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getStats (destStat, src, dest, opts) {
|
|
36
|
-
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
|
|
37
|
-
const srcStat = statSync(src)
|
|
38
|
-
|
|
39
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
|
40
|
-
else if (srcStat.isFile() ||
|
|
41
|
-
srcStat.isCharacterDevice() ||
|
|
42
|
-
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
|
|
43
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
|
44
|
-
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
|
45
|
-
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
|
46
|
-
throw new Error(`Unknown file: ${src}`)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function onFile (srcStat, destStat, src, dest, opts) {
|
|
50
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
|
51
|
-
return mayCopyFile(srcStat, src, dest, opts)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function mayCopyFile (srcStat, src, dest, opts) {
|
|
55
|
-
if (opts.overwrite) {
|
|
56
|
-
fs.unlinkSync(dest)
|
|
57
|
-
return copyFile(srcStat, src, dest, opts)
|
|
58
|
-
} else if (opts.errorOnExist) {
|
|
59
|
-
throw new Error(`'${dest}' already exists`)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function copyFile (srcStat, src, dest, opts) {
|
|
64
|
-
fs.copyFileSync(src, dest)
|
|
65
|
-
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
|
|
66
|
-
return setDestMode(dest, srcStat.mode)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function handleTimestamps (srcMode, src, dest) {
|
|
70
|
-
// Make sure the file is writable before setting the timestamp
|
|
71
|
-
// otherwise open fails with EPERM when invoked with 'r+'
|
|
72
|
-
// (through utimes call)
|
|
73
|
-
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
|
|
74
|
-
return setDestTimestamps(src, dest)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function fileIsNotWritable (srcMode) {
|
|
78
|
-
return (srcMode & 0o200) === 0
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function makeFileWritable (dest, srcMode) {
|
|
82
|
-
return setDestMode(dest, srcMode | 0o200)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function setDestMode (dest, srcMode) {
|
|
86
|
-
return fs.chmodSync(dest, srcMode)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function setDestTimestamps (src, dest) {
|
|
90
|
-
// The initial srcStat.atime cannot be trusted
|
|
91
|
-
// because it is modified by the read(2) system call
|
|
92
|
-
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
|
93
|
-
const updatedSrcStat = fs.statSync(src)
|
|
94
|
-
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function onDir (srcStat, destStat, src, dest, opts) {
|
|
98
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
|
|
99
|
-
return copyDir(src, dest, opts)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function mkDirAndCopy (srcMode, src, dest, opts) {
|
|
103
|
-
fs.mkdirSync(dest)
|
|
104
|
-
copyDir(src, dest, opts)
|
|
105
|
-
return setDestMode(dest, srcMode)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function copyDir (src, dest, opts) {
|
|
109
|
-
const dir = fs.opendirSync(src)
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
let dirent
|
|
113
|
-
|
|
114
|
-
while ((dirent = dir.readSync()) !== null) {
|
|
115
|
-
copyDirItem(dirent.name, src, dest, opts)
|
|
116
|
-
}
|
|
117
|
-
} finally {
|
|
118
|
-
dir.closeSync()
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function copyDirItem (item, src, dest, opts) {
|
|
123
|
-
const srcItem = path.join(src, item)
|
|
124
|
-
const destItem = path.join(dest, item)
|
|
125
|
-
if (opts.filter && !opts.filter(srcItem, destItem)) return
|
|
126
|
-
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
|
|
127
|
-
return getStats(destStat, srcItem, destItem, opts)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function onLink (destStat, src, dest, opts) {
|
|
131
|
-
let resolvedSrc = fs.readlinkSync(src)
|
|
132
|
-
if (opts.dereference) {
|
|
133
|
-
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (!destStat) {
|
|
137
|
-
return fs.symlinkSync(resolvedSrc, dest)
|
|
138
|
-
} else {
|
|
139
|
-
let resolvedDest
|
|
140
|
-
try {
|
|
141
|
-
resolvedDest = fs.readlinkSync(dest)
|
|
142
|
-
} catch (err) {
|
|
143
|
-
// dest exists and is a regular file or directory,
|
|
144
|
-
// Windows may throw UNKNOWN error. If dest already exists,
|
|
145
|
-
// fs throws error anyway, so no need to guard against it here.
|
|
146
|
-
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
|
|
147
|
-
throw err
|
|
148
|
-
}
|
|
149
|
-
if (opts.dereference) {
|
|
150
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
|
151
|
-
}
|
|
152
|
-
// If both symlinks resolve to the same target, they are still distinct symlinks
|
|
153
|
-
// that can be copied/overwritten. Only check subdirectory constraints when
|
|
154
|
-
// the resolved paths are different.
|
|
155
|
-
if (resolvedSrc !== resolvedDest) {
|
|
156
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
157
|
-
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// prevent copy if src is a subdir of dest since unlinking
|
|
161
|
-
// dest in this case would result in removing src contents
|
|
162
|
-
// and therefore a broken symlink would be created.
|
|
163
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
164
|
-
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return copyLink(resolvedSrc, dest)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function copyLink (resolvedSrc, dest) {
|
|
172
|
-
fs.unlinkSync(dest)
|
|
173
|
-
return fs.symlinkSync(resolvedSrc, dest)
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
module.exports = copySync
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const fs = require('../fs')
|
|
4
|
-
const path = require('path')
|
|
5
|
-
const { mkdirs } = require('../mkdirs')
|
|
6
|
-
const { pathExists } = require('../path-exists')
|
|
7
|
-
const { utimesMillis } = require('../util/utimes')
|
|
8
|
-
const stat = require('../util/stat')
|
|
9
|
-
const { asyncIteratorConcurrentProcess } = require('../util/async')
|
|
10
|
-
|
|
11
|
-
async function copy (src, dest, opts = {}) {
|
|
12
|
-
if (typeof opts === 'function') {
|
|
13
|
-
opts = { filter: opts }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
|
17
|
-
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
|
18
|
-
|
|
19
|
-
// Warn about using preserveTimestamps on 32-bit node
|
|
20
|
-
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
|
21
|
-
process.emitWarning(
|
|
22
|
-
'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
|
|
23
|
-
'\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
|
|
24
|
-
'Warning', 'fs-extra-WARN0001'
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)
|
|
29
|
-
|
|
30
|
-
await stat.checkParentPaths(src, srcStat, dest, 'copy')
|
|
31
|
-
|
|
32
|
-
const include = await runFilter(src, dest, opts)
|
|
33
|
-
|
|
34
|
-
if (!include) return
|
|
35
|
-
|
|
36
|
-
// check if the parent of dest exists, and create it if it doesn't exist
|
|
37
|
-
const destParent = path.dirname(dest)
|
|
38
|
-
const dirExists = await pathExists(destParent)
|
|
39
|
-
if (!dirExists) {
|
|
40
|
-
await mkdirs(destParent)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
await getStatsAndPerformCopy(destStat, src, dest, opts)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function runFilter (src, dest, opts) {
|
|
47
|
-
if (!opts.filter) return true
|
|
48
|
-
return opts.filter(src, dest)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async function getStatsAndPerformCopy (destStat, src, dest, opts) {
|
|
52
|
-
const statFn = opts.dereference ? fs.stat : fs.lstat
|
|
53
|
-
const srcStat = await statFn(src)
|
|
54
|
-
|
|
55
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
srcStat.isFile() ||
|
|
59
|
-
srcStat.isCharacterDevice() ||
|
|
60
|
-
srcStat.isBlockDevice()
|
|
61
|
-
) return onFile(srcStat, destStat, src, dest, opts)
|
|
62
|
-
|
|
63
|
-
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
|
64
|
-
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
|
65
|
-
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
|
66
|
-
throw new Error(`Unknown file: ${src}`)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async function onFile (srcStat, destStat, src, dest, opts) {
|
|
70
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
|
71
|
-
|
|
72
|
-
if (opts.overwrite) {
|
|
73
|
-
await fs.unlink(dest)
|
|
74
|
-
return copyFile(srcStat, src, dest, opts)
|
|
75
|
-
}
|
|
76
|
-
if (opts.errorOnExist) {
|
|
77
|
-
throw new Error(`'${dest}' already exists`)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async function copyFile (srcStat, src, dest, opts) {
|
|
82
|
-
await fs.copyFile(src, dest)
|
|
83
|
-
if (opts.preserveTimestamps) {
|
|
84
|
-
// Make sure the file is writable before setting the timestamp
|
|
85
|
-
// otherwise open fails with EPERM when invoked with 'r+'
|
|
86
|
-
// (through utimes call)
|
|
87
|
-
if (fileIsNotWritable(srcStat.mode)) {
|
|
88
|
-
await makeFileWritable(dest, srcStat.mode)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Set timestamps and mode correspondingly
|
|
92
|
-
|
|
93
|
-
// Note that The initial srcStat.atime cannot be trusted
|
|
94
|
-
// because it is modified by the read(2) system call
|
|
95
|
-
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
|
96
|
-
const updatedSrcStat = await fs.stat(src)
|
|
97
|
-
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return fs.chmod(dest, srcStat.mode)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function fileIsNotWritable (srcMode) {
|
|
104
|
-
return (srcMode & 0o200) === 0
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function makeFileWritable (dest, srcMode) {
|
|
108
|
-
return fs.chmod(dest, srcMode | 0o200)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
async function onDir (srcStat, destStat, src, dest, opts) {
|
|
112
|
-
// the dest directory might not exist, create it
|
|
113
|
-
if (!destStat) {
|
|
114
|
-
await fs.mkdir(dest)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// iterate through the files in the current directory to copy everything
|
|
118
|
-
await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
|
|
119
|
-
const srcItem = path.join(src, item.name)
|
|
120
|
-
const destItem = path.join(dest, item.name)
|
|
121
|
-
|
|
122
|
-
const include = await runFilter(srcItem, destItem, opts)
|
|
123
|
-
// only copy the item if it matches the filter function
|
|
124
|
-
if (include) {
|
|
125
|
-
const { destStat } = await stat.checkPaths(srcItem, destItem, 'copy', opts)
|
|
126
|
-
// If the item is a copyable file, `getStatsAndPerformCopy` will copy it
|
|
127
|
-
// If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
|
|
128
|
-
await getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
if (!destStat) {
|
|
133
|
-
await fs.chmod(dest, srcStat.mode)
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
async function onLink (destStat, src, dest, opts) {
|
|
138
|
-
let resolvedSrc = await fs.readlink(src)
|
|
139
|
-
if (opts.dereference) {
|
|
140
|
-
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
|
141
|
-
}
|
|
142
|
-
if (!destStat) {
|
|
143
|
-
return fs.symlink(resolvedSrc, dest)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
let resolvedDest = null
|
|
147
|
-
try {
|
|
148
|
-
resolvedDest = await fs.readlink(dest)
|
|
149
|
-
} catch (e) {
|
|
150
|
-
// dest exists and is a regular file or directory,
|
|
151
|
-
// Windows may throw UNKNOWN error. If dest already exists,
|
|
152
|
-
// fs throws error anyway, so no need to guard against it here.
|
|
153
|
-
if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)
|
|
154
|
-
throw e
|
|
155
|
-
}
|
|
156
|
-
if (opts.dereference) {
|
|
157
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
|
158
|
-
}
|
|
159
|
-
// If both symlinks resolve to the same target, they are still distinct symlinks
|
|
160
|
-
// that can be copied/overwritten. Only check subdirectory constraints when
|
|
161
|
-
// the resolved paths are different.
|
|
162
|
-
if (resolvedSrc !== resolvedDest) {
|
|
163
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
164
|
-
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// do not copy if src is a subdir of dest since unlinking
|
|
168
|
-
// dest in this case would result in removing src contents
|
|
169
|
-
// and therefore a broken symlink would be created.
|
|
170
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
171
|
-
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// copy the link
|
|
176
|
-
await fs.unlink(dest)
|
|
177
|
-
return fs.symlink(resolvedSrc, dest)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
module.exports = copy
|