@jointhedots/gear 1.0.21 → 1.1.4
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/browser-modules/asap-raw.js +79 -0
- package/browser-modules/asap.js +57 -0
- package/browser-modules/buffer.js +3 -1
- package/browser-modules/child_process.js +145 -0
- package/browser-modules/events.js +200 -0
- package/browser-modules/side-effects.js +7 -0
- package/browser-modules/stream.js +323 -0
- package/browser-modules/util.js +170 -0
- package/browser-modules/worker_threads.js +85 -0
- package/esm/builder/build-app-bundle.js +185 -0
- package/esm/builder/build-app-bundle.js.map +1 -0
- package/esm/builder/build-app-host.js +170 -0
- package/esm/builder/build-app-host.js.map +1 -0
- package/esm/builder/build-application.js +219 -63
- package/esm/builder/build-application.js.map +1 -1
- package/esm/builder/build-library.js +17 -33
- package/esm/builder/build-library.js.map +1 -1
- package/esm/builder/build-target.js +45 -76
- package/esm/builder/build-target.js.map +1 -1
- package/esm/builder/emit-dts.js +110 -87
- package/esm/builder/emit-dts.js.map +1 -1
- package/esm/builder/esbuild-plugins.js +256 -59
- package/esm/builder/esbuild-plugins.js.map +1 -1
- package/esm/builder/helpers/path-helpers.js +95 -0
- package/esm/builder/helpers/path-helpers.js.map +1 -0
- package/esm/cli.js +0 -1
- package/esm/cli.js.map +1 -1
- package/esm/commands/init.js +1 -0
- package/esm/commands/init.js.map +1 -1
- package/esm/commands/make.js +52 -9
- package/esm/commands/make.js.map +1 -1
- package/esm/commands/publish.js +1 -0
- package/esm/commands/publish.js.map +1 -1
- package/esm/commands/run.js +1 -0
- package/esm/commands/run.js.map +1 -1
- package/esm/commands/serve.js +42 -9
- package/esm/commands/serve.js.map +1 -1
- package/esm/model/component.js +4 -8
- package/esm/model/component.js.map +1 -1
- package/esm/model/helpers/create-manifests.js +73 -0
- package/esm/model/helpers/create-manifests.js.map +1 -0
- package/esm/model/helpers/discover-workspace.js +227 -0
- package/esm/model/helpers/discover-workspace.js.map +1 -0
- package/esm/model/helpers/logger.js +116 -0
- package/esm/model/helpers/logger.js.map +1 -0
- package/esm/model/storage.js +82 -24
- package/esm/model/storage.js.map +1 -1
- package/esm/model/workspace.js +97 -147
- package/esm/model/workspace.js.map +1 -1
- package/esm/publish/publish_aws_s3.js +1 -0
- package/esm/publish/publish_aws_s3.js.map +1 -1
- package/esm/utils/file.js +10 -2
- package/esm/utils/file.js.map +1 -1
- package/esm/utils/graph-ordering.js +86 -0
- package/esm/utils/graph-ordering.js.map +1 -0
- package/esm/utils/normalized-name.js +94 -0
- package/esm/utils/normalized-name.js.map +1 -0
- package/node_modules/@jspm/core/.github/workflows/ci.yml +64 -0
- package/node_modules/@jspm/core/LICENSE +796 -0
- package/node_modules/@jspm/core/README.md +11 -0
- package/node_modules/@jspm/core/chompfile.toml +28 -0
- package/node_modules/@jspm/core/generate-node-libs.mjs +10 -0
- package/node_modules/@jspm/core/nodelibs/@empty.dew.js +7 -0
- package/node_modules/@jspm/core/nodelibs/@empty.js +3 -0
- package/node_modules/@jspm/core/nodelibs/browser/_stream_duplex.js +13 -0
- package/node_modules/@jspm/core/nodelibs/browser/_stream_passthrough.js +12 -0
- package/node_modules/@jspm/core/nodelibs/browser/_stream_readable.js +14 -0
- package/node_modules/@jspm/core/nodelibs/browser/_stream_transform.js +12 -0
- package/node_modules/@jspm/core/nodelibs/browser/_stream_writable.js +13 -0
- package/node_modules/@jspm/core/nodelibs/browser/assert/strict.js +29 -0
- package/node_modules/@jspm/core/nodelibs/browser/assert.js +2574 -0
- package/node_modules/@jspm/core/nodelibs/browser/async_hooks.js +14 -0
- package/node_modules/@jspm/core/nodelibs/browser/buffer.js +10 -0
- package/node_modules/@jspm/core/nodelibs/browser/child_process.js +17 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-B6-G-Ftj.js +158 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-B738Er4n.js +5524 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-BlJi4mNy.js +448 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-BsRZ0PEC.js +74 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-C4rKjYLo.js +20 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-CbQqNoLO.js +32 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-CcCWfKp1.js +360 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-CjPlbOtt.js +47 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-CkFCi-G1.js +36 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-D3uu3VYh.js +33 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-DEMDiNwt.js +275 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-DHWh-hmB.js +1344 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-DtDiafJB.js +96 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-DtcTpLWz.js +826 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-DtuTasat.js +1923 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-b0rmRow7.js +246 -0
- package/node_modules/@jspm/core/nodelibs/browser/chunk-tHuMsdT0.js +8 -0
- package/node_modules/@jspm/core/nodelibs/browser/cluster.js +33 -0
- package/node_modules/@jspm/core/nodelibs/browser/console.js +103 -0
- package/node_modules/@jspm/core/nodelibs/browser/constants.js +419 -0
- package/node_modules/@jspm/core/nodelibs/browser/crypto.js +109730 -0
- package/node_modules/@jspm/core/nodelibs/browser/dgram.js +11 -0
- package/node_modules/@jspm/core/nodelibs/browser/diagnostics_channel.js +153 -0
- package/node_modules/@jspm/core/nodelibs/browser/dns/promises.js +26 -0
- package/node_modules/@jspm/core/nodelibs/browser/dns.js +101 -0
- package/node_modules/@jspm/core/nodelibs/browser/domain.js +77 -0
- package/node_modules/@jspm/core/nodelibs/browser/events.js +491 -0
- package/node_modules/@jspm/core/nodelibs/browser/fs/promises.js +50 -0
- package/node_modules/@jspm/core/nodelibs/browser/fs.js +4139 -0
- package/node_modules/@jspm/core/nodelibs/browser/http.js +3513 -0
- package/node_modules/@jspm/core/nodelibs/browser/http2.js +88 -0
- package/node_modules/@jspm/core/nodelibs/browser/https.js +873 -0
- package/node_modules/@jspm/core/nodelibs/browser/module.js +58 -0
- package/node_modules/@jspm/core/nodelibs/browser/net.js +20 -0
- package/node_modules/@jspm/core/nodelibs/browser/os.js +94 -0
- package/node_modules/@jspm/core/nodelibs/browser/path/posix.js +40 -0
- package/node_modules/@jspm/core/nodelibs/browser/path/win32.js +27 -0
- package/node_modules/@jspm/core/nodelibs/browser/path.js +20 -0
- package/node_modules/@jspm/core/nodelibs/browser/perf_hooks.js +30 -0
- package/node_modules/@jspm/core/nodelibs/browser/process-production.js +274 -0
- package/node_modules/@jspm/core/nodelibs/browser/process.js +277 -0
- package/node_modules/@jspm/core/nodelibs/browser/punycode.js +436 -0
- package/node_modules/@jspm/core/nodelibs/browser/querystring.js +118 -0
- package/node_modules/@jspm/core/nodelibs/browser/readline.js +15 -0
- package/node_modules/@jspm/core/nodelibs/browser/repl.js +21 -0
- package/node_modules/@jspm/core/nodelibs/browser/stream/consumers.js +61 -0
- package/node_modules/@jspm/core/nodelibs/browser/stream/promises.js +12 -0
- package/node_modules/@jspm/core/nodelibs/browser/stream/web.js +35 -0
- package/node_modules/@jspm/core/nodelibs/browser/stream.js +6574 -0
- package/node_modules/@jspm/core/nodelibs/browser/string_decoder.js +2 -0
- package/node_modules/@jspm/core/nodelibs/browser/sys.js +9 -0
- package/node_modules/@jspm/core/nodelibs/browser/timers/promises.js +17 -0
- package/node_modules/@jspm/core/nodelibs/browser/timers.js +256 -0
- package/node_modules/@jspm/core/nodelibs/browser/tls.js +34 -0
- package/node_modules/@jspm/core/nodelibs/browser/tty.js +20 -0
- package/node_modules/@jspm/core/nodelibs/browser/url.js +2361 -0
- package/node_modules/@jspm/core/nodelibs/browser/util/types.js +51 -0
- package/node_modules/@jspm/core/nodelibs/browser/util.js +1345 -0
- package/node_modules/@jspm/core/nodelibs/browser/v8.js +21 -0
- package/node_modules/@jspm/core/nodelibs/browser/vm.js +139 -0
- package/node_modules/@jspm/core/nodelibs/browser/wasi.js +160 -0
- package/node_modules/@jspm/core/nodelibs/browser/worker_threads.js +140 -0
- package/node_modules/@jspm/core/nodelibs/browser/zlib.js +6545 -0
- package/node_modules/@jspm/core/nodelibs/deno/_stream_duplex.ts +5 -0
- package/node_modules/@jspm/core/nodelibs/deno/_stream_passthrough.ts +1 -0
- package/node_modules/@jspm/core/nodelibs/deno/_stream_readable.ts +5 -0
- package/node_modules/@jspm/core/nodelibs/deno/_stream_transform.ts +1 -0
- package/node_modules/@jspm/core/nodelibs/deno/_stream_writable.ts +5 -0
- package/node_modules/@jspm/core/nodelibs/deno/assert/strict.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/assert.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/async_hooks.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/buffer.ts +5 -0
- package/node_modules/@jspm/core/nodelibs/deno/child_process.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/cluster.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/console.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/constants.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/crypto.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/dgram.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/diagnostics_channel.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/dns/promises.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/dns.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/domain.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/events.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/fs/promises.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/fs.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/http.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/http2.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/https.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/inspector.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/module.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/net.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/os.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/path/posix.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/path/win32.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/path.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/perf_hooks.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/process-production.ts +4 -0
- package/node_modules/@jspm/core/nodelibs/deno/process.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/punycode.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/querystring.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/readline/promises.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/readline.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/repl.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/stream/consumers.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/stream/promises.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/stream/web.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/stream.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/string_decoder.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/timers/promises.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/timers.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/tls.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/tty.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/url.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/util/types.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/util.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/v8.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/vm.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/wasi.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/worker_threads.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/deno/zlib.ts +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_http_agent.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_http_client.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_http_common.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_http_incoming.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_http_outgoing.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_http_server.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_stream_duplex.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_stream_passthrough.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_stream_readable.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_stream_transform.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_stream_wrap.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_stream_writable.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_tls_common.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/_tls_wrap.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/assert/strict.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/assert.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/async_hooks.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/buffer.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/child_process.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/cluster.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/console.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/constants.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/crypto.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/dgram.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/diagnostics_channel.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/dns/promises.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/dns.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/domain.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/events.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/fs/promises.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/fs.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/http.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/http2.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/https.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/inspector/promises.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/inspector.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/module.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/net.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/os.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/path/posix.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/path/win32.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/path.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/perf_hooks.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/process-production.js +4 -0
- package/node_modules/@jspm/core/nodelibs/node/process.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/punycode.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/querystring.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/readline/promises.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/readline.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/repl.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/stream/consumers.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/stream/promises.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/stream/web.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/stream.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/string_decoder.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/sys.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/timers/promises.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/timers.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/tls.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/trace_events.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/tty.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/url.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/util/types.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/util.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/v8.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/vm.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/wasi.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/worker_threads.js +2 -0
- package/node_modules/@jspm/core/nodelibs/node/zlib.js +2 -0
- package/node_modules/@jspm/core/package.json +75 -0
- package/node_modules/@jspm/core/rollup.config.mjs +55 -0
- package/node_modules/@jspm/core/src-browser/__tty.js +11 -0
- package/node_modules/@jspm/core/src-browser/_stream_duplex.js +3 -0
- package/node_modules/@jspm/core/src-browser/_stream_passthrough.js +2 -0
- package/node_modules/@jspm/core/src-browser/_stream_readable.js +5 -0
- package/node_modules/@jspm/core/src-browser/_stream_transform.js +2 -0
- package/node_modules/@jspm/core/src-browser/_stream_writable.js +3 -0
- package/node_modules/@jspm/core/src-browser/assert/strict.js +26 -0
- package/node_modules/@jspm/core/src-browser/assert.js +19 -0
- package/node_modules/@jspm/core/src-browser/async_hooks.js +21 -0
- package/node_modules/@jspm/core/src-browser/buffer.js +5 -0
- package/node_modules/@jspm/core/src-browser/child_process.js +27 -0
- package/node_modules/@jspm/core/src-browser/cluster.js +38 -0
- package/node_modules/@jspm/core/src-browser/console.js +25 -0
- package/node_modules/@jspm/core/src-browser/constants.js +209 -0
- package/node_modules/@jspm/core/src-browser/crypto.js +63 -0
- package/node_modules/@jspm/core/src-browser/dgram.js +15 -0
- package/node_modules/@jspm/core/src-browser/diagnostics_channel.js +6 -0
- package/node_modules/@jspm/core/src-browser/dns/promises.js +45 -0
- package/node_modules/@jspm/core/src-browser/dns.js +121 -0
- package/node_modules/@jspm/core/src-browser/domain.js +4 -0
- package/node_modules/@jspm/core/src-browser/events.js +105 -0
- package/node_modules/@jspm/core/src-browser/fs/promises.js +34 -0
- package/node_modules/@jspm/core/src-browser/fs.js +209 -0
- package/node_modules/@jspm/core/src-browser/http.js +10 -0
- package/node_modules/@jspm/core/src-browser/http2.js +86 -0
- package/node_modules/@jspm/core/src-browser/https.js +10 -0
- package/node_modules/@jspm/core/src-browser/module.js +75 -0
- package/node_modules/@jspm/core/src-browser/net.js +33 -0
- package/node_modules/@jspm/core/src-browser/os.js +35 -0
- package/node_modules/@jspm/core/src-browser/path/posix.js +38 -0
- package/node_modules/@jspm/core/src-browser/path/win32.js +42 -0
- package/node_modules/@jspm/core/src-browser/path.js +17 -0
- package/node_modules/@jspm/core/src-browser/perf_hooks.js +30 -0
- package/node_modules/@jspm/core/src-browser/process-production.js +279 -0
- package/node_modules/@jspm/core/src-browser/process.js +282 -0
- package/node_modules/@jspm/core/src-browser/punycode.js +8 -0
- package/node_modules/@jspm/core/src-browser/querystring.js +6 -0
- package/node_modules/@jspm/core/src-browser/readline.js +23 -0
- package/node_modules/@jspm/core/src-browser/repl.js +26 -0
- package/node_modules/@jspm/core/src-browser/stream/consumers.js +57 -0
- package/node_modules/@jspm/core/src-browser/stream/promises.js +4 -0
- package/node_modules/@jspm/core/src-browser/stream/web.js +33 -0
- package/node_modules/@jspm/core/src-browser/stream.js +26 -0
- package/node_modules/@jspm/core/src-browser/string_decoder.js +3 -0
- package/node_modules/@jspm/core/src-browser/sys.js +3 -0
- package/node_modules/@jspm/core/src-browser/timers/promises.js +12 -0
- package/node_modules/@jspm/core/src-browser/timers.js +13 -0
- package/node_modules/@jspm/core/src-browser/tls.js +46 -0
- package/node_modules/@jspm/core/src-browser/tty.js +3 -0
- package/node_modules/@jspm/core/src-browser/url.js +154 -0
- package/node_modules/@jspm/core/src-browser/util/types.js +48 -0
- package/node_modules/@jspm/core/src-browser/util.js +30 -0
- package/node_modules/@jspm/core/src-browser/v8.js +35 -0
- package/node_modules/@jspm/core/src-browser/vm.js +9 -0
- package/node_modules/@jspm/core/src-browser/wasi.js +15 -0
- package/node_modules/@jspm/core/src-browser/worker_threads.js +139 -0
- package/node_modules/@jspm/core/src-browser/zlib.js +71 -0
- package/node_modules/@jspm/core/test/chrome-worker_threads.test.js +14 -0
- package/node_modules/@jspm/core/test/cowsay.wasm +0 -0
- package/node_modules/@jspm/core/test/exports.test.js +99 -0
- package/node_modules/@jspm/core/test/fs.test.js +13 -0
- package/node_modules/@jspm/core/test/os.test.js +7 -0
- package/node_modules/@jspm/core/test/process.test.js +15 -0
- package/node_modules/@jspm/core/test/server.js +177 -0
- package/node_modules/@jspm/core/test/test.html +29 -0
- package/node_modules/@jspm/core/test/wasi.test.js +13 -0
- package/package.json +38 -24
- package/esm/utils/helpers.js +0 -32
- package/esm/utils/helpers.js.map +0 -1
|
@@ -0,0 +1,1344 @@
|
|
|
1
|
+
import { T } from './chunk-D3uu3VYh.js';
|
|
2
|
+
import { p as process } from './chunk-b0rmRow7.js';
|
|
3
|
+
|
|
4
|
+
var exports$1 = {},
|
|
5
|
+
_dewExec$1 = false;
|
|
6
|
+
function dew$1() {
|
|
7
|
+
if (_dewExec$1) return exports$1;
|
|
8
|
+
_dewExec$1 = true;
|
|
9
|
+
var process$1 = process;
|
|
10
|
+
|
|
11
|
+
function assertPath(path) {
|
|
12
|
+
if (typeof path !== "string") {
|
|
13
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
|
|
14
|
+
}
|
|
15
|
+
} // Resolves . and .. elements in a path with directory names
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function normalizeStringPosix(path, allowAboveRoot) {
|
|
19
|
+
var res = "";
|
|
20
|
+
var lastSegmentLength = 0;
|
|
21
|
+
var lastSlash = -1;
|
|
22
|
+
var dots = 0;
|
|
23
|
+
var code;
|
|
24
|
+
|
|
25
|
+
for (var i = 0; i <= path.length; ++i) {
|
|
26
|
+
if (i < path.length) code = path.charCodeAt(i);else if (code === 47
|
|
27
|
+
/*/*/
|
|
28
|
+
) break;else code = 47
|
|
29
|
+
/*/*/
|
|
30
|
+
;
|
|
31
|
+
|
|
32
|
+
if (code === 47
|
|
33
|
+
/*/*/
|
|
34
|
+
) {
|
|
35
|
+
if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
|
|
36
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46
|
|
37
|
+
/*.*/
|
|
38
|
+
|| res.charCodeAt(res.length - 2) !== 46
|
|
39
|
+
/*.*/
|
|
40
|
+
) {
|
|
41
|
+
if (res.length > 2) {
|
|
42
|
+
var lastSlashIndex = res.lastIndexOf("/");
|
|
43
|
+
|
|
44
|
+
if (lastSlashIndex !== res.length - 1) {
|
|
45
|
+
if (lastSlashIndex === -1) {
|
|
46
|
+
res = "";
|
|
47
|
+
lastSegmentLength = 0;
|
|
48
|
+
} else {
|
|
49
|
+
res = res.slice(0, lastSlashIndex);
|
|
50
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
lastSlash = i;
|
|
54
|
+
dots = 0;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
} else if (res.length === 2 || res.length === 1) {
|
|
58
|
+
res = "";
|
|
59
|
+
lastSegmentLength = 0;
|
|
60
|
+
lastSlash = i;
|
|
61
|
+
dots = 0;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (allowAboveRoot) {
|
|
67
|
+
if (res.length > 0) res += "/..";else res = "..";
|
|
68
|
+
lastSegmentLength = 2;
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
if (res.length > 0) res += "/" + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);
|
|
72
|
+
lastSegmentLength = i - lastSlash - 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
lastSlash = i;
|
|
76
|
+
dots = 0;
|
|
77
|
+
} else if (code === 46
|
|
78
|
+
/*.*/
|
|
79
|
+
&& dots !== -1) {
|
|
80
|
+
++dots;
|
|
81
|
+
} else {
|
|
82
|
+
dots = -1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return res;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function _format(sep, pathObject) {
|
|
90
|
+
var dir = pathObject.dir || pathObject.root;
|
|
91
|
+
var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
|
|
92
|
+
|
|
93
|
+
if (!dir) {
|
|
94
|
+
return base;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (dir === pathObject.root) {
|
|
98
|
+
return dir + base;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return dir + sep + base;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
var posix = {
|
|
105
|
+
// path.resolve([from ...], to)
|
|
106
|
+
resolve: function resolve() {
|
|
107
|
+
var resolvedPath = "";
|
|
108
|
+
var resolvedAbsolute = false;
|
|
109
|
+
var cwd;
|
|
110
|
+
|
|
111
|
+
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
112
|
+
var path;
|
|
113
|
+
if (i >= 0) path = arguments[i];else {
|
|
114
|
+
if (cwd === undefined) cwd = process$1.cwd();
|
|
115
|
+
path = cwd;
|
|
116
|
+
}
|
|
117
|
+
assertPath(path); // Skip empty entries
|
|
118
|
+
|
|
119
|
+
if (path.length === 0) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
resolvedPath = path + "/" + resolvedPath;
|
|
124
|
+
resolvedAbsolute = path.charCodeAt(0) === 47
|
|
125
|
+
/*/*/
|
|
126
|
+
;
|
|
127
|
+
} // At this point the path should be resolved to a full absolute path, but
|
|
128
|
+
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
129
|
+
// Normalize the path
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
133
|
+
|
|
134
|
+
if (resolvedAbsolute) {
|
|
135
|
+
if (resolvedPath.length > 0) return "/" + resolvedPath;else return "/";
|
|
136
|
+
} else if (resolvedPath.length > 0) {
|
|
137
|
+
return resolvedPath;
|
|
138
|
+
} else {
|
|
139
|
+
return ".";
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
normalize: function normalize(path) {
|
|
143
|
+
assertPath(path);
|
|
144
|
+
if (path.length === 0) return ".";
|
|
145
|
+
var isAbsolute = path.charCodeAt(0) === 47
|
|
146
|
+
/*/*/
|
|
147
|
+
;
|
|
148
|
+
var trailingSeparator = path.charCodeAt(path.length - 1) === 47
|
|
149
|
+
/*/*/
|
|
150
|
+
; // Normalize the path
|
|
151
|
+
|
|
152
|
+
path = normalizeStringPosix(path, !isAbsolute);
|
|
153
|
+
if (path.length === 0 && !isAbsolute) path = ".";
|
|
154
|
+
if (path.length > 0 && trailingSeparator) path += "/";
|
|
155
|
+
if (isAbsolute) return "/" + path;
|
|
156
|
+
return path;
|
|
157
|
+
},
|
|
158
|
+
isAbsolute: function isAbsolute(path) {
|
|
159
|
+
assertPath(path);
|
|
160
|
+
return path.length > 0 && path.charCodeAt(0) === 47
|
|
161
|
+
/*/*/
|
|
162
|
+
;
|
|
163
|
+
},
|
|
164
|
+
join: function join() {
|
|
165
|
+
if (arguments.length === 0) return ".";
|
|
166
|
+
var joined;
|
|
167
|
+
|
|
168
|
+
for (var i = 0; i < arguments.length; ++i) {
|
|
169
|
+
var arg = arguments[i];
|
|
170
|
+
assertPath(arg);
|
|
171
|
+
|
|
172
|
+
if (arg.length > 0) {
|
|
173
|
+
if (joined === undefined) joined = arg;else joined += "/" + arg;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (joined === undefined) return ".";
|
|
178
|
+
return posix.normalize(joined);
|
|
179
|
+
},
|
|
180
|
+
relative: function relative(from, to) {
|
|
181
|
+
assertPath(from);
|
|
182
|
+
assertPath(to);
|
|
183
|
+
if (from === to) return "";
|
|
184
|
+
from = posix.resolve(from);
|
|
185
|
+
to = posix.resolve(to);
|
|
186
|
+
if (from === to) return ""; // Trim any leading backslashes
|
|
187
|
+
|
|
188
|
+
var fromStart = 1;
|
|
189
|
+
|
|
190
|
+
for (; fromStart < from.length; ++fromStart) {
|
|
191
|
+
if (from.charCodeAt(fromStart) !== 47
|
|
192
|
+
/*/*/
|
|
193
|
+
) break;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var fromEnd = from.length;
|
|
197
|
+
var fromLen = fromEnd - fromStart; // Trim any leading backslashes
|
|
198
|
+
|
|
199
|
+
var toStart = 1;
|
|
200
|
+
|
|
201
|
+
for (; toStart < to.length; ++toStart) {
|
|
202
|
+
if (to.charCodeAt(toStart) !== 47
|
|
203
|
+
/*/*/
|
|
204
|
+
) break;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var toEnd = to.length;
|
|
208
|
+
var toLen = toEnd - toStart; // Compare paths to find the longest common path from root
|
|
209
|
+
|
|
210
|
+
var length = fromLen < toLen ? fromLen : toLen;
|
|
211
|
+
var lastCommonSep = -1;
|
|
212
|
+
var i = 0;
|
|
213
|
+
|
|
214
|
+
for (; i <= length; ++i) {
|
|
215
|
+
if (i === length) {
|
|
216
|
+
if (toLen > length) {
|
|
217
|
+
if (to.charCodeAt(toStart + i) === 47
|
|
218
|
+
/*/*/
|
|
219
|
+
) {
|
|
220
|
+
// We get here if `from` is the exact base path for `to`.
|
|
221
|
+
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
|
222
|
+
return to.slice(toStart + i + 1);
|
|
223
|
+
} else if (i === 0) {
|
|
224
|
+
// We get here if `from` is the root
|
|
225
|
+
// For example: from='/'; to='/foo'
|
|
226
|
+
return to.slice(toStart + i);
|
|
227
|
+
}
|
|
228
|
+
} else if (fromLen > length) {
|
|
229
|
+
if (from.charCodeAt(fromStart + i) === 47
|
|
230
|
+
/*/*/
|
|
231
|
+
) {
|
|
232
|
+
// We get here if `to` is the exact base path for `from`.
|
|
233
|
+
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
|
234
|
+
lastCommonSep = i;
|
|
235
|
+
} else if (i === 0) {
|
|
236
|
+
// We get here if `to` is the root.
|
|
237
|
+
// For example: from='/foo'; to='/'
|
|
238
|
+
lastCommonSep = 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
var fromCode = from.charCodeAt(fromStart + i);
|
|
246
|
+
var toCode = to.charCodeAt(toStart + i);
|
|
247
|
+
if (fromCode !== toCode) break;else if (fromCode === 47
|
|
248
|
+
/*/*/
|
|
249
|
+
) lastCommonSep = i;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
var out = ""; // Generate the relative path based on the path difference between `to`
|
|
253
|
+
// and `from`
|
|
254
|
+
|
|
255
|
+
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
256
|
+
if (i === fromEnd || from.charCodeAt(i) === 47
|
|
257
|
+
/*/*/
|
|
258
|
+
) {
|
|
259
|
+
if (out.length === 0) out += "..";else out += "/..";
|
|
260
|
+
}
|
|
261
|
+
} // Lastly, append the rest of the destination (`to`) path that comes after
|
|
262
|
+
// the common path parts
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
if (out.length > 0) return out + to.slice(toStart + lastCommonSep);else {
|
|
266
|
+
toStart += lastCommonSep;
|
|
267
|
+
if (to.charCodeAt(toStart) === 47
|
|
268
|
+
/*/*/
|
|
269
|
+
) ++toStart;
|
|
270
|
+
return to.slice(toStart);
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
_makeLong: function _makeLong(path) {
|
|
274
|
+
return path;
|
|
275
|
+
},
|
|
276
|
+
dirname: function dirname(path) {
|
|
277
|
+
assertPath(path);
|
|
278
|
+
if (path.length === 0) return ".";
|
|
279
|
+
var code = path.charCodeAt(0);
|
|
280
|
+
var hasRoot = code === 47
|
|
281
|
+
/*/*/
|
|
282
|
+
;
|
|
283
|
+
var end = -1;
|
|
284
|
+
var matchedSlash = true;
|
|
285
|
+
|
|
286
|
+
for (var i = path.length - 1; i >= 1; --i) {
|
|
287
|
+
code = path.charCodeAt(i);
|
|
288
|
+
|
|
289
|
+
if (code === 47
|
|
290
|
+
/*/*/
|
|
291
|
+
) {
|
|
292
|
+
if (!matchedSlash) {
|
|
293
|
+
end = i;
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
// We saw the first non-path separator
|
|
298
|
+
matchedSlash = false;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (end === -1) return hasRoot ? "/" : ".";
|
|
303
|
+
if (hasRoot && end === 1) return "//";
|
|
304
|
+
return path.slice(0, end);
|
|
305
|
+
},
|
|
306
|
+
basename: function basename(path, ext) {
|
|
307
|
+
if (ext !== undefined && typeof ext !== "string") throw new TypeError("\"ext\" argument must be a string");
|
|
308
|
+
assertPath(path);
|
|
309
|
+
var start = 0;
|
|
310
|
+
var end = -1;
|
|
311
|
+
var matchedSlash = true;
|
|
312
|
+
var i;
|
|
313
|
+
|
|
314
|
+
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
|
|
315
|
+
if (ext.length === path.length && ext === path) return "";
|
|
316
|
+
var extIdx = ext.length - 1;
|
|
317
|
+
var firstNonSlashEnd = -1;
|
|
318
|
+
|
|
319
|
+
for (i = path.length - 1; i >= 0; --i) {
|
|
320
|
+
var code = path.charCodeAt(i);
|
|
321
|
+
|
|
322
|
+
if (code === 47
|
|
323
|
+
/*/*/
|
|
324
|
+
) {
|
|
325
|
+
// If we reached a path separator that was not part of a set of path
|
|
326
|
+
// separators at the end of the string, stop now
|
|
327
|
+
if (!matchedSlash) {
|
|
328
|
+
start = i + 1;
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
} else {
|
|
332
|
+
if (firstNonSlashEnd === -1) {
|
|
333
|
+
// We saw the first non-path separator, remember this index in case
|
|
334
|
+
// we need it if the extension ends up not matching
|
|
335
|
+
matchedSlash = false;
|
|
336
|
+
firstNonSlashEnd = i + 1;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (extIdx >= 0) {
|
|
340
|
+
// Try to match the explicit extension
|
|
341
|
+
if (code === ext.charCodeAt(extIdx)) {
|
|
342
|
+
if (--extIdx === -1) {
|
|
343
|
+
// We matched the extension, so mark this as the end of our path
|
|
344
|
+
// component
|
|
345
|
+
end = i;
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
// Extension does not match, so our result is the entire path
|
|
349
|
+
// component
|
|
350
|
+
extIdx = -1;
|
|
351
|
+
end = firstNonSlashEnd;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
|
|
358
|
+
return path.slice(start, end);
|
|
359
|
+
} else {
|
|
360
|
+
for (i = path.length - 1; i >= 0; --i) {
|
|
361
|
+
if (path.charCodeAt(i) === 47
|
|
362
|
+
/*/*/
|
|
363
|
+
) {
|
|
364
|
+
// If we reached a path separator that was not part of a set of path
|
|
365
|
+
// separators at the end of the string, stop now
|
|
366
|
+
if (!matchedSlash) {
|
|
367
|
+
start = i + 1;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
} else if (end === -1) {
|
|
371
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
372
|
+
// path component
|
|
373
|
+
matchedSlash = false;
|
|
374
|
+
end = i + 1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (end === -1) return "";
|
|
379
|
+
return path.slice(start, end);
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
extname: function extname(path) {
|
|
383
|
+
assertPath(path);
|
|
384
|
+
var startDot = -1;
|
|
385
|
+
var startPart = 0;
|
|
386
|
+
var end = -1;
|
|
387
|
+
var matchedSlash = true; // Track the state of characters (if any) we see before our first dot and
|
|
388
|
+
// after any path separator we find
|
|
389
|
+
|
|
390
|
+
var preDotState = 0;
|
|
391
|
+
|
|
392
|
+
for (var i = path.length - 1; i >= 0; --i) {
|
|
393
|
+
var code = path.charCodeAt(i);
|
|
394
|
+
|
|
395
|
+
if (code === 47
|
|
396
|
+
/*/*/
|
|
397
|
+
) {
|
|
398
|
+
// If we reached a path separator that was not part of a set of path
|
|
399
|
+
// separators at the end of the string, stop now
|
|
400
|
+
if (!matchedSlash) {
|
|
401
|
+
startPart = i + 1;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if (end === -1) {
|
|
409
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
410
|
+
// extension
|
|
411
|
+
matchedSlash = false;
|
|
412
|
+
end = i + 1;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (code === 46
|
|
416
|
+
/*.*/
|
|
417
|
+
) {
|
|
418
|
+
// If this is our first dot, mark it as the start of our extension
|
|
419
|
+
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
|
|
420
|
+
} else if (startDot !== -1) {
|
|
421
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
422
|
+
// have a good chance at having a non-empty extension
|
|
423
|
+
preDotState = -1;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
|
|
428
|
+
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
429
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
430
|
+
return "";
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return path.slice(startDot, end);
|
|
434
|
+
},
|
|
435
|
+
format: function format(pathObject) {
|
|
436
|
+
if (pathObject === null || typeof pathObject !== "object") {
|
|
437
|
+
throw new TypeError("The \"pathObject\" argument must be of type Object. Received type " + typeof pathObject);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return _format("/", pathObject);
|
|
441
|
+
},
|
|
442
|
+
parse: function parse(path) {
|
|
443
|
+
assertPath(path);
|
|
444
|
+
var ret = {
|
|
445
|
+
root: "",
|
|
446
|
+
dir: "",
|
|
447
|
+
base: "",
|
|
448
|
+
ext: "",
|
|
449
|
+
name: ""
|
|
450
|
+
};
|
|
451
|
+
if (path.length === 0) return ret;
|
|
452
|
+
var code = path.charCodeAt(0);
|
|
453
|
+
var isAbsolute = code === 47
|
|
454
|
+
/*/*/
|
|
455
|
+
;
|
|
456
|
+
var start;
|
|
457
|
+
|
|
458
|
+
if (isAbsolute) {
|
|
459
|
+
ret.root = "/";
|
|
460
|
+
start = 1;
|
|
461
|
+
} else {
|
|
462
|
+
start = 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
var startDot = -1;
|
|
466
|
+
var startPart = 0;
|
|
467
|
+
var end = -1;
|
|
468
|
+
var matchedSlash = true;
|
|
469
|
+
var i = path.length - 1; // Track the state of characters (if any) we see before our first dot and
|
|
470
|
+
// after any path separator we find
|
|
471
|
+
|
|
472
|
+
var preDotState = 0; // Get non-dir info
|
|
473
|
+
|
|
474
|
+
for (; i >= start; --i) {
|
|
475
|
+
code = path.charCodeAt(i);
|
|
476
|
+
|
|
477
|
+
if (code === 47
|
|
478
|
+
/*/*/
|
|
479
|
+
) {
|
|
480
|
+
// If we reached a path separator that was not part of a set of path
|
|
481
|
+
// separators at the end of the string, stop now
|
|
482
|
+
if (!matchedSlash) {
|
|
483
|
+
startPart = i + 1;
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
if (end === -1) {
|
|
491
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
492
|
+
// extension
|
|
493
|
+
matchedSlash = false;
|
|
494
|
+
end = i + 1;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (code === 46
|
|
498
|
+
/*.*/
|
|
499
|
+
) {
|
|
500
|
+
// If this is our first dot, mark it as the start of our extension
|
|
501
|
+
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
|
|
502
|
+
} else if (startDot !== -1) {
|
|
503
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
504
|
+
// have a good chance at having a non-empty extension
|
|
505
|
+
preDotState = -1;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
|
|
510
|
+
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
511
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
512
|
+
if (end !== -1) {
|
|
513
|
+
if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
|
|
514
|
+
}
|
|
515
|
+
} else {
|
|
516
|
+
if (startPart === 0 && isAbsolute) {
|
|
517
|
+
ret.name = path.slice(1, startDot);
|
|
518
|
+
ret.base = path.slice(1, end);
|
|
519
|
+
} else {
|
|
520
|
+
ret.name = path.slice(startPart, startDot);
|
|
521
|
+
ret.base = path.slice(startPart, end);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
ret.ext = path.slice(startDot, end);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = "/";
|
|
528
|
+
return ret;
|
|
529
|
+
},
|
|
530
|
+
sep: "/",
|
|
531
|
+
delimiter: ":",
|
|
532
|
+
win32: null,
|
|
533
|
+
posix: null
|
|
534
|
+
};
|
|
535
|
+
posix.posix = posix;
|
|
536
|
+
exports$1 = posix;
|
|
537
|
+
return exports$1;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
const exports$2 = dew$1();
|
|
541
|
+
|
|
542
|
+
const t$1=2147483647,o$2=/^xn--/,n$2=/[^\0-\x7E]/,e$2=/[\x2E\u3002\uFF0E\uFF61]/g,r$2={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c$1=Math.floor,s=String.fromCharCode;function i$1(t){throw new RangeError(r$2[t])}function f$1(t,o){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]);const c=function(t,o){const n=[];let e=t.length;for(;e--;)n[e]=o(t[e]);return n}((t=t.replace(e$2,".")).split("."),o).join(".");return r+c}function l$1(t){const o=[];let n=0;const e=t.length;for(;n<e;){const r=t.charCodeAt(n++);if(r>=55296&&r<=56319&&n<e){const e=t.charCodeAt(n++);56320==(64512&e)?o.push(((1023&r)<<10)+(1023&e)+65536):(o.push(r),n--);}else o.push(r);}return o}const u$1=function(t,o){return t+22+75*(t<26)-((0!=o)<<5)},a$1=function(t,o,n){let e=0;for(t=n?c$1(t/700):t>>1,t+=c$1(t/o);t>455;e+=36)t=c$1(t/35);return c$1(e+36*t/(t+38))},d=function(o){const n=[],e=o.length;let r=0,s=128,f=72,l=o.lastIndexOf("-");l<0&&(l=0);for(let t=0;t<l;++t)o.charCodeAt(t)>=128&&i$1("not-basic"),n.push(o.charCodeAt(t));for(let d=l>0?l+1:0;d<e;){let l=r;for(let n=1,s=36;;s+=36){d>=e&&i$1("invalid-input");const l=(u=o.charCodeAt(d++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:36;(l>=36||l>c$1((t$1-r)/n))&&i$1("overflow"),r+=l*n;const a=s<=f?1:s>=f+26?26:s-f;if(l<a)break;const h=36-a;n>c$1(t$1/h)&&i$1("overflow"),n*=h;}const h=n.length+1;f=a$1(r-l,h,0==l),c$1(r/h)>t$1-s&&i$1("overflow"),s+=c$1(r/h),r%=h,n.splice(r++,0,s);}var u;return String.fromCodePoint(...n)},h$1=function(o){const n=[];let e=(o=l$1(o)).length,r=128,f=0,d=72;for(const t of o)t<128&&n.push(s(t));let h=n.length,p=h;for(h&&n.push("-");p<e;){let e=t$1;for(const t of o)t>=r&&t<e&&(e=t);const l=p+1;e-r>c$1((t$1-f)/l)&&i$1("overflow"),f+=(e-r)*l,r=e;for(const e of o)if(e<r&&++f>t$1&&i$1("overflow"),e==r){let t=f;for(let o=36;;o+=36){const e=o<=d?1:o>=d+26?26:o-d;if(t<e)break;const r=t-e,i=36-e;n.push(s(u$1(e+r%i,0))),t=c$1(r/i);}n.push(s(u$1(t,0))),d=a$1(f,l,p==h),f=0,++p;}++f,++r;}return n.join("")};var p$1={version:"2.1.0",ucs2:{decode:l$1,encode:t=>String.fromCodePoint(...t)},decode:d,encode:h$1,toASCII:function(t){return f$1(t,(function(t){return n$2.test(t)?"xn--"+h$1(t):t}))},toUnicode:function(t){return f$1(t,(function(t){return o$2.test(t)?d(t.slice(4).toLowerCase()):t}))}};
|
|
543
|
+
|
|
544
|
+
function e$1(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var n$1=function(n,r,t,o){r=r||"&",t=t||"=";var a={};if("string"!=typeof n||0===n.length)return a;var u=/\+/g;n=n.split(r);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var i=n.length;c>0&&i>c&&(i=c);for(var s=0;s<i;++s){var p,f,d,y,m=n[s].replace(u,"%20"),l=m.indexOf(t);l>=0?(p=m.substr(0,l),f=m.substr(l+1)):(p=m,f=""),d=decodeURIComponent(p),y=decodeURIComponent(f),e$1(a,d)?Array.isArray(a[d])?a[d].push(y):a[d]=[a[d],y]:a[d]=y;}return a},r$1=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return ""}},t=function(e,n,t,o){return n=n||"&",t=t||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var a=encodeURIComponent(r$1(o))+t;return Array.isArray(e[o])?e[o].map((function(e){return a+encodeURIComponent(r$1(e))})).join(n):a+encodeURIComponent(r$1(e[o]))})).join(n):o?encodeURIComponent(r$1(o))+t+encodeURIComponent(r$1(e)):""},o$1={};o$1.decode=o$1.parse=n$1,o$1.encode=o$1.stringify=t;o$1.decode;o$1.encode;o$1.parse;o$1.stringify;
|
|
545
|
+
|
|
546
|
+
var h={},e=p$1,a={isString:function(t){return "string"==typeof t},isObject:function(t){return "object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null;}h.parse=O,h.resolve=function(t,s){return O(t,!1,!0).resolve(s)},h.resolveObject=function(t,s){return t?O(t,!1,!0).resolveObject(s):s},h.format=function(t){a.isString(t)&&(t=O(t));return t instanceof r?t.format():r.prototype.format.call(t)},h.Url=r;var o=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),p=["'"].concat(l),c=["%","/","?",";","#"].concat(p),u=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=o$1;function O(t,s,h){if(t&&a.isObject(t)&&t instanceof r)return t;var e=new r;return e.parse(t,s,h),e}r.prototype.parse=function(t,s,h){if(!a.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r<t.indexOf("#")?"?":"#",l=t.split(n);l[0]=l[0].replace(/\\/g,"/");var O=t=l.join(n);if(O=O.trim(),!h&&1===t.split("#").length){var d=i.exec(O);if(d)return this.path=O,this.href=O,this.pathname=d[1],d[2]?(this.search=d[2],this.query=s?b.parse(this.search.substr(1)):this.search.substr(1)):s&&(this.search="",this.query={}),this}var j=o.exec(O);if(j){var q=(j=j[0]).toLowerCase();this.protocol=q,O=O.substr(j.length);}if(h||j||O.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===O.substr(0,2);!x||j&&g[j]||(O=O.substr(2),this.slashes=!0);}if(!g[j]&&(x||j&&!y[j])){for(var A,C,I=-1,w=0;w<u.length;w++){-1!==(N=O.indexOf(u[w]))&&(-1===I||N<I)&&(I=N);}-1!==(C=-1===I?O.lastIndexOf("@"):O.lastIndexOf("@",I))&&(A=O.slice(0,C),O=O.slice(C+1),this.auth=decodeURIComponent(A)),I=-1;for(w=0;w<c.length;w++){var N;-1!==(N=O.indexOf(c[w]))&&(-1===I||N<I)&&(I=N);}-1===I&&(I=O.length),this.host=O.slice(0,I),O=O.slice(I),this.parseHost(),this.hostname=this.hostname||"";var U="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!U)for(var k=this.hostname.split(/\./),S=(w=0,k.length);w<S;w++){var R=k[w];if(R&&!R.match(f)){for(var $="",z=0,H=R.length;z<H;z++)R.charCodeAt(z)>127?$+="x":$+=R[z];if(!$.match(f)){var L=k.slice(0,w),Z=k.slice(w+1),_=R.match(m);_&&(L.push(_[1]),Z.unshift(_[2])),Z.length&&(O="/"+Z.join(".")+O),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=e.toASCII(this.hostname));var E=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+E,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==O[0]&&(O="/"+O));}if(!v[q])for(w=0,S=p.length;w<S;w++){var T=p[w];if(-1!==O.indexOf(T)){var B=encodeURIComponent(T);B===T&&(B=escape(T)),O=O.split(T).join(B);}}var D=O.indexOf("#");-1!==D&&(this.hash=O.substr(D),O=O.slice(0,D));var F=O.indexOf("?");if(-1!==F?(this.search=O.substr(F),this.query=O.substr(F+1),s&&(this.query=b.parse(this.query)),O=O.slice(0,F)):s&&(this.search="",this.query={}),O&&(this.pathname=O),y[q]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){E=this.pathname||"";var G=this.search||"";this.path=E+G;}return this.href=this.format(),this},r.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var s=this.protocol||"",h=this.pathname||"",e=this.hash||"",r=!1,o="";this.host?r=t+this.host:this.hostname&&(r=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&a.isObject(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var n=this.search||o&&"?"+o||"";return s&&":"!==s.substr(-1)&&(s+=":"),this.slashes||(!s||y[s])&&!1!==r?(r="//"+(r||""),h&&"/"!==h.charAt(0)&&(h="/"+h)):r||(r=""),e&&"#"!==e.charAt(0)&&(e="#"+e),n&&"?"!==n.charAt(0)&&(n="?"+n),s+r+(h=h.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(n=n.replace("#","%23"))+e},r.prototype.resolve=function(t){return this.resolveObject(O(t,!1,!0)).format()},r.prototype.resolveObject=function(t){if(a.isString(t)){var s=new r;s.parse(t,!1,!0),t=s;}for(var h=new r,e=Object.keys(this),o=0;o<e.length;o++){var n=e[o];h[n]=this[n];}if(h.hash=t.hash,""===t.href)return h.href=h.format(),h;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),l=0;l<i.length;l++){var p=i[l];"protocol"!==p&&(h[p]=t[p]);}return y[h.protocol]&&h.hostname&&!h.pathname&&(h.path=h.pathname="/"),h.href=h.format(),h}if(t.protocol&&t.protocol!==h.protocol){if(!y[t.protocol]){for(var c=Object.keys(t),u=0;u<c.length;u++){var f=c[u];h[f]=t[f];}return h.href=h.format(),h}if(h.protocol=t.protocol,t.host||g[t.protocol])h.pathname=t.pathname;else {for(var m=(t.pathname||"").split("/");m.length&&!(t.host=m.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==m[0]&&m.unshift(""),m.length<2&&m.unshift(""),h.pathname=m.join("/");}if(h.search=t.search,h.query=t.query,h.host=t.host||"",h.auth=t.auth,h.hostname=t.hostname||t.host,h.port=t.port,h.pathname||h.search){var v=h.pathname||"",b=h.search||"";h.path=v+b;}return h.slashes=h.slashes||t.slashes,h.href=h.format(),h}var O=h.pathname&&"/"===h.pathname.charAt(0),d=t.host||t.pathname&&"/"===t.pathname.charAt(0),j=d||O||h.host&&t.pathname,q=j,x=h.pathname&&h.pathname.split("/")||[],A=(m=t.pathname&&t.pathname.split("/")||[],h.protocol&&!y[h.protocol]);if(A&&(h.hostname="",h.port=null,h.host&&(""===x[0]?x[0]=h.host:x.unshift(h.host)),h.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===m[0]?m[0]=t.host:m.unshift(t.host)),t.host=null),j=j&&(""===m[0]||""===x[0])),d)h.host=t.host||""===t.host?t.host:h.host,h.hostname=t.hostname||""===t.hostname?t.hostname:h.hostname,h.search=t.search,h.query=t.query,x=m;else if(m.length)x||(x=[]),x.pop(),x=x.concat(m),h.search=t.search,h.query=t.query;else if(!a.isNullOrUndefined(t.search)){if(A)h.hostname=h.host=x.shift(),(U=!!(h.host&&h.host.indexOf("@")>0)&&h.host.split("@"))&&(h.auth=U.shift(),h.host=h.hostname=U.shift());return h.search=t.search,h.query=t.query,a.isNull(h.pathname)&&a.isNull(h.search)||(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.href=h.format(),h}if(!x.length)return h.pathname=null,h.search?h.path="/"+h.search:h.path=null,h.href=h.format(),h;for(var C=x.slice(-1)[0],I=(h.host||t.host||x.length>1)&&("."===C||".."===C)||""===C,w=0,N=x.length;N>=0;N--)"."===(C=x[N])?x.splice(N,1):".."===C?(x.splice(N,1),w++):w&&(x.splice(N,1),w--);if(!j&&!q)for(;w--;w)x.unshift("..");!j||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var U,k=""===x[0]||x[0]&&"/"===x[0].charAt(0);A&&(h.hostname=h.host=k?"":x.length?x.shift():"",(U=!!(h.host&&h.host.indexOf("@")>0)&&h.host.split("@"))&&(h.auth=U.shift(),h.host=h.hostname=U.shift()));return (j=j||h.host&&x.length)&&!k&&x.unshift(""),x.length?h.pathname=x.join("/"):(h.pathname=null,h.path=null),a.isNull(h.pathname)&&a.isNull(h.search)||(h.path=(h.pathname?h.pathname:"")+(h.search?h.search:"")),h.auth=t.auth||h.auth,h.slashes=h.slashes||t.slashes,h.href=h.format(),h},r.prototype.parseHost=function(){var t=this.host,s=n.exec(t);s&&(":"!==(s=s[0])&&(this.port=s.substr(1)),t=t.substr(0,t.length-s.length)),t&&(this.hostname=t);};
|
|
547
|
+
h.Url;h.format;h.resolve;h.resolveObject;
|
|
548
|
+
|
|
549
|
+
var exports = {},
|
|
550
|
+
_dewExec = false;
|
|
551
|
+
function dew() {
|
|
552
|
+
if (_dewExec) return exports;
|
|
553
|
+
_dewExec = true;
|
|
554
|
+
var process = T;
|
|
555
|
+
|
|
556
|
+
function assertPath(path) {
|
|
557
|
+
if (typeof path !== "string") {
|
|
558
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
|
|
559
|
+
}
|
|
560
|
+
} // Resolves . and .. elements in a path with directory names
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
function normalizeStringPosix(path, allowAboveRoot) {
|
|
564
|
+
var res = "";
|
|
565
|
+
var lastSegmentLength = 0;
|
|
566
|
+
var lastSlash = -1;
|
|
567
|
+
var dots = 0;
|
|
568
|
+
var code;
|
|
569
|
+
|
|
570
|
+
for (var i = 0; i <= path.length; ++i) {
|
|
571
|
+
if (i < path.length) code = path.charCodeAt(i);else if (code === 47
|
|
572
|
+
/*/*/
|
|
573
|
+
) break;else code = 47
|
|
574
|
+
/*/*/
|
|
575
|
+
;
|
|
576
|
+
|
|
577
|
+
if (code === 47
|
|
578
|
+
/*/*/
|
|
579
|
+
) {
|
|
580
|
+
if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
|
|
581
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46
|
|
582
|
+
/*.*/
|
|
583
|
+
|| res.charCodeAt(res.length - 2) !== 46
|
|
584
|
+
/*.*/
|
|
585
|
+
) {
|
|
586
|
+
if (res.length > 2) {
|
|
587
|
+
var lastSlashIndex = res.lastIndexOf("/");
|
|
588
|
+
|
|
589
|
+
if (lastSlashIndex !== res.length - 1) {
|
|
590
|
+
if (lastSlashIndex === -1) {
|
|
591
|
+
res = "";
|
|
592
|
+
lastSegmentLength = 0;
|
|
593
|
+
} else {
|
|
594
|
+
res = res.slice(0, lastSlashIndex);
|
|
595
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
lastSlash = i;
|
|
599
|
+
dots = 0;
|
|
600
|
+
continue;
|
|
601
|
+
}
|
|
602
|
+
} else if (res.length === 2 || res.length === 1) {
|
|
603
|
+
res = "";
|
|
604
|
+
lastSegmentLength = 0;
|
|
605
|
+
lastSlash = i;
|
|
606
|
+
dots = 0;
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if (allowAboveRoot) {
|
|
612
|
+
if (res.length > 0) res += "/..";else res = "..";
|
|
613
|
+
lastSegmentLength = 2;
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
if (res.length > 0) res += "/" + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);
|
|
617
|
+
lastSegmentLength = i - lastSlash - 1;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
lastSlash = i;
|
|
621
|
+
dots = 0;
|
|
622
|
+
} else if (code === 46
|
|
623
|
+
/*.*/
|
|
624
|
+
&& dots !== -1) {
|
|
625
|
+
++dots;
|
|
626
|
+
} else {
|
|
627
|
+
dots = -1;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return res;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function _format(sep, pathObject) {
|
|
635
|
+
var dir = pathObject.dir || pathObject.root;
|
|
636
|
+
var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
|
|
637
|
+
|
|
638
|
+
if (!dir) {
|
|
639
|
+
return base;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
if (dir === pathObject.root) {
|
|
643
|
+
return dir + base;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
return dir + sep + base;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
var posix = {
|
|
650
|
+
// path.resolve([from ...], to)
|
|
651
|
+
resolve: function resolve() {
|
|
652
|
+
var resolvedPath = "";
|
|
653
|
+
var resolvedAbsolute = false;
|
|
654
|
+
var cwd;
|
|
655
|
+
|
|
656
|
+
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
657
|
+
var path;
|
|
658
|
+
if (i >= 0) path = arguments[i];else {
|
|
659
|
+
if (cwd === undefined) cwd = process.cwd();
|
|
660
|
+
path = cwd;
|
|
661
|
+
}
|
|
662
|
+
assertPath(path); // Skip empty entries
|
|
663
|
+
|
|
664
|
+
if (path.length === 0) {
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
resolvedPath = path + "/" + resolvedPath;
|
|
669
|
+
resolvedAbsolute = path.charCodeAt(0) === 47
|
|
670
|
+
/*/*/
|
|
671
|
+
;
|
|
672
|
+
} // At this point the path should be resolved to a full absolute path, but
|
|
673
|
+
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
674
|
+
// Normalize the path
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
678
|
+
|
|
679
|
+
if (resolvedAbsolute) {
|
|
680
|
+
if (resolvedPath.length > 0) return "/" + resolvedPath;else return "/";
|
|
681
|
+
} else if (resolvedPath.length > 0) {
|
|
682
|
+
return resolvedPath;
|
|
683
|
+
} else {
|
|
684
|
+
return ".";
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
normalize: function normalize(path) {
|
|
688
|
+
assertPath(path);
|
|
689
|
+
if (path.length === 0) return ".";
|
|
690
|
+
var isAbsolute = path.charCodeAt(0) === 47
|
|
691
|
+
/*/*/
|
|
692
|
+
;
|
|
693
|
+
var trailingSeparator = path.charCodeAt(path.length - 1) === 47
|
|
694
|
+
/*/*/
|
|
695
|
+
; // Normalize the path
|
|
696
|
+
|
|
697
|
+
path = normalizeStringPosix(path, !isAbsolute);
|
|
698
|
+
if (path.length === 0 && !isAbsolute) path = ".";
|
|
699
|
+
if (path.length > 0 && trailingSeparator) path += "/";
|
|
700
|
+
if (isAbsolute) return "/" + path;
|
|
701
|
+
return path;
|
|
702
|
+
},
|
|
703
|
+
isAbsolute: function isAbsolute(path) {
|
|
704
|
+
assertPath(path);
|
|
705
|
+
return path.length > 0 && path.charCodeAt(0) === 47
|
|
706
|
+
/*/*/
|
|
707
|
+
;
|
|
708
|
+
},
|
|
709
|
+
join: function join() {
|
|
710
|
+
if (arguments.length === 0) return ".";
|
|
711
|
+
var joined;
|
|
712
|
+
|
|
713
|
+
for (var i = 0; i < arguments.length; ++i) {
|
|
714
|
+
var arg = arguments[i];
|
|
715
|
+
assertPath(arg);
|
|
716
|
+
|
|
717
|
+
if (arg.length > 0) {
|
|
718
|
+
if (joined === undefined) joined = arg;else joined += "/" + arg;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (joined === undefined) return ".";
|
|
723
|
+
return posix.normalize(joined);
|
|
724
|
+
},
|
|
725
|
+
relative: function relative(from, to) {
|
|
726
|
+
assertPath(from);
|
|
727
|
+
assertPath(to);
|
|
728
|
+
if (from === to) return "";
|
|
729
|
+
from = posix.resolve(from);
|
|
730
|
+
to = posix.resolve(to);
|
|
731
|
+
if (from === to) return ""; // Trim any leading backslashes
|
|
732
|
+
|
|
733
|
+
var fromStart = 1;
|
|
734
|
+
|
|
735
|
+
for (; fromStart < from.length; ++fromStart) {
|
|
736
|
+
if (from.charCodeAt(fromStart) !== 47
|
|
737
|
+
/*/*/
|
|
738
|
+
) break;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
var fromEnd = from.length;
|
|
742
|
+
var fromLen = fromEnd - fromStart; // Trim any leading backslashes
|
|
743
|
+
|
|
744
|
+
var toStart = 1;
|
|
745
|
+
|
|
746
|
+
for (; toStart < to.length; ++toStart) {
|
|
747
|
+
if (to.charCodeAt(toStart) !== 47
|
|
748
|
+
/*/*/
|
|
749
|
+
) break;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
var toEnd = to.length;
|
|
753
|
+
var toLen = toEnd - toStart; // Compare paths to find the longest common path from root
|
|
754
|
+
|
|
755
|
+
var length = fromLen < toLen ? fromLen : toLen;
|
|
756
|
+
var lastCommonSep = -1;
|
|
757
|
+
var i = 0;
|
|
758
|
+
|
|
759
|
+
for (; i <= length; ++i) {
|
|
760
|
+
if (i === length) {
|
|
761
|
+
if (toLen > length) {
|
|
762
|
+
if (to.charCodeAt(toStart + i) === 47
|
|
763
|
+
/*/*/
|
|
764
|
+
) {
|
|
765
|
+
// We get here if `from` is the exact base path for `to`.
|
|
766
|
+
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
|
767
|
+
return to.slice(toStart + i + 1);
|
|
768
|
+
} else if (i === 0) {
|
|
769
|
+
// We get here if `from` is the root
|
|
770
|
+
// For example: from='/'; to='/foo'
|
|
771
|
+
return to.slice(toStart + i);
|
|
772
|
+
}
|
|
773
|
+
} else if (fromLen > length) {
|
|
774
|
+
if (from.charCodeAt(fromStart + i) === 47
|
|
775
|
+
/*/*/
|
|
776
|
+
) {
|
|
777
|
+
// We get here if `to` is the exact base path for `from`.
|
|
778
|
+
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
|
779
|
+
lastCommonSep = i;
|
|
780
|
+
} else if (i === 0) {
|
|
781
|
+
// We get here if `to` is the root.
|
|
782
|
+
// For example: from='/foo'; to='/'
|
|
783
|
+
lastCommonSep = 0;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
var fromCode = from.charCodeAt(fromStart + i);
|
|
791
|
+
var toCode = to.charCodeAt(toStart + i);
|
|
792
|
+
if (fromCode !== toCode) break;else if (fromCode === 47
|
|
793
|
+
/*/*/
|
|
794
|
+
) lastCommonSep = i;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
var out = ""; // Generate the relative path based on the path difference between `to`
|
|
798
|
+
// and `from`
|
|
799
|
+
|
|
800
|
+
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
801
|
+
if (i === fromEnd || from.charCodeAt(i) === 47
|
|
802
|
+
/*/*/
|
|
803
|
+
) {
|
|
804
|
+
if (out.length === 0) out += "..";else out += "/..";
|
|
805
|
+
}
|
|
806
|
+
} // Lastly, append the rest of the destination (`to`) path that comes after
|
|
807
|
+
// the common path parts
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
if (out.length > 0) return out + to.slice(toStart + lastCommonSep);else {
|
|
811
|
+
toStart += lastCommonSep;
|
|
812
|
+
if (to.charCodeAt(toStart) === 47
|
|
813
|
+
/*/*/
|
|
814
|
+
) ++toStart;
|
|
815
|
+
return to.slice(toStart);
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
_makeLong: function _makeLong(path) {
|
|
819
|
+
return path;
|
|
820
|
+
},
|
|
821
|
+
dirname: function dirname(path) {
|
|
822
|
+
assertPath(path);
|
|
823
|
+
if (path.length === 0) return ".";
|
|
824
|
+
var code = path.charCodeAt(0);
|
|
825
|
+
var hasRoot = code === 47
|
|
826
|
+
/*/*/
|
|
827
|
+
;
|
|
828
|
+
var end = -1;
|
|
829
|
+
var matchedSlash = true;
|
|
830
|
+
|
|
831
|
+
for (var i = path.length - 1; i >= 1; --i) {
|
|
832
|
+
code = path.charCodeAt(i);
|
|
833
|
+
|
|
834
|
+
if (code === 47
|
|
835
|
+
/*/*/
|
|
836
|
+
) {
|
|
837
|
+
if (!matchedSlash) {
|
|
838
|
+
end = i;
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
} else {
|
|
842
|
+
// We saw the first non-path separator
|
|
843
|
+
matchedSlash = false;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
if (end === -1) return hasRoot ? "/" : ".";
|
|
848
|
+
if (hasRoot && end === 1) return "//";
|
|
849
|
+
return path.slice(0, end);
|
|
850
|
+
},
|
|
851
|
+
basename: function basename(path, ext) {
|
|
852
|
+
if (ext !== undefined && typeof ext !== "string") throw new TypeError("\"ext\" argument must be a string");
|
|
853
|
+
assertPath(path);
|
|
854
|
+
var start = 0;
|
|
855
|
+
var end = -1;
|
|
856
|
+
var matchedSlash = true;
|
|
857
|
+
var i;
|
|
858
|
+
|
|
859
|
+
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
|
|
860
|
+
if (ext.length === path.length && ext === path) return "";
|
|
861
|
+
var extIdx = ext.length - 1;
|
|
862
|
+
var firstNonSlashEnd = -1;
|
|
863
|
+
|
|
864
|
+
for (i = path.length - 1; i >= 0; --i) {
|
|
865
|
+
var code = path.charCodeAt(i);
|
|
866
|
+
|
|
867
|
+
if (code === 47
|
|
868
|
+
/*/*/
|
|
869
|
+
) {
|
|
870
|
+
// If we reached a path separator that was not part of a set of path
|
|
871
|
+
// separators at the end of the string, stop now
|
|
872
|
+
if (!matchedSlash) {
|
|
873
|
+
start = i + 1;
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
} else {
|
|
877
|
+
if (firstNonSlashEnd === -1) {
|
|
878
|
+
// We saw the first non-path separator, remember this index in case
|
|
879
|
+
// we need it if the extension ends up not matching
|
|
880
|
+
matchedSlash = false;
|
|
881
|
+
firstNonSlashEnd = i + 1;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
if (extIdx >= 0) {
|
|
885
|
+
// Try to match the explicit extension
|
|
886
|
+
if (code === ext.charCodeAt(extIdx)) {
|
|
887
|
+
if (--extIdx === -1) {
|
|
888
|
+
// We matched the extension, so mark this as the end of our path
|
|
889
|
+
// component
|
|
890
|
+
end = i;
|
|
891
|
+
}
|
|
892
|
+
} else {
|
|
893
|
+
// Extension does not match, so our result is the entire path
|
|
894
|
+
// component
|
|
895
|
+
extIdx = -1;
|
|
896
|
+
end = firstNonSlashEnd;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
|
|
903
|
+
return path.slice(start, end);
|
|
904
|
+
} else {
|
|
905
|
+
for (i = path.length - 1; i >= 0; --i) {
|
|
906
|
+
if (path.charCodeAt(i) === 47
|
|
907
|
+
/*/*/
|
|
908
|
+
) {
|
|
909
|
+
// If we reached a path separator that was not part of a set of path
|
|
910
|
+
// separators at the end of the string, stop now
|
|
911
|
+
if (!matchedSlash) {
|
|
912
|
+
start = i + 1;
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
} else if (end === -1) {
|
|
916
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
917
|
+
// path component
|
|
918
|
+
matchedSlash = false;
|
|
919
|
+
end = i + 1;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if (end === -1) return "";
|
|
924
|
+
return path.slice(start, end);
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
extname: function extname(path) {
|
|
928
|
+
assertPath(path);
|
|
929
|
+
var startDot = -1;
|
|
930
|
+
var startPart = 0;
|
|
931
|
+
var end = -1;
|
|
932
|
+
var matchedSlash = true; // Track the state of characters (if any) we see before our first dot and
|
|
933
|
+
// after any path separator we find
|
|
934
|
+
|
|
935
|
+
var preDotState = 0;
|
|
936
|
+
|
|
937
|
+
for (var i = path.length - 1; i >= 0; --i) {
|
|
938
|
+
var code = path.charCodeAt(i);
|
|
939
|
+
|
|
940
|
+
if (code === 47
|
|
941
|
+
/*/*/
|
|
942
|
+
) {
|
|
943
|
+
// If we reached a path separator that was not part of a set of path
|
|
944
|
+
// separators at the end of the string, stop now
|
|
945
|
+
if (!matchedSlash) {
|
|
946
|
+
startPart = i + 1;
|
|
947
|
+
break;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
if (end === -1) {
|
|
954
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
955
|
+
// extension
|
|
956
|
+
matchedSlash = false;
|
|
957
|
+
end = i + 1;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
if (code === 46
|
|
961
|
+
/*.*/
|
|
962
|
+
) {
|
|
963
|
+
// If this is our first dot, mark it as the start of our extension
|
|
964
|
+
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
|
|
965
|
+
} else if (startDot !== -1) {
|
|
966
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
967
|
+
// have a good chance at having a non-empty extension
|
|
968
|
+
preDotState = -1;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
|
|
973
|
+
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
974
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
975
|
+
return "";
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
return path.slice(startDot, end);
|
|
979
|
+
},
|
|
980
|
+
format: function format(pathObject) {
|
|
981
|
+
if (pathObject === null || typeof pathObject !== "object") {
|
|
982
|
+
throw new TypeError("The \"pathObject\" argument must be of type Object. Received type " + typeof pathObject);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
return _format("/", pathObject);
|
|
986
|
+
},
|
|
987
|
+
parse: function parse(path) {
|
|
988
|
+
assertPath(path);
|
|
989
|
+
var ret = {
|
|
990
|
+
root: "",
|
|
991
|
+
dir: "",
|
|
992
|
+
base: "",
|
|
993
|
+
ext: "",
|
|
994
|
+
name: ""
|
|
995
|
+
};
|
|
996
|
+
if (path.length === 0) return ret;
|
|
997
|
+
var code = path.charCodeAt(0);
|
|
998
|
+
var isAbsolute = code === 47
|
|
999
|
+
/*/*/
|
|
1000
|
+
;
|
|
1001
|
+
var start;
|
|
1002
|
+
|
|
1003
|
+
if (isAbsolute) {
|
|
1004
|
+
ret.root = "/";
|
|
1005
|
+
start = 1;
|
|
1006
|
+
} else {
|
|
1007
|
+
start = 0;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
var startDot = -1;
|
|
1011
|
+
var startPart = 0;
|
|
1012
|
+
var end = -1;
|
|
1013
|
+
var matchedSlash = true;
|
|
1014
|
+
var i = path.length - 1; // Track the state of characters (if any) we see before our first dot and
|
|
1015
|
+
// after any path separator we find
|
|
1016
|
+
|
|
1017
|
+
var preDotState = 0; // Get non-dir info
|
|
1018
|
+
|
|
1019
|
+
for (; i >= start; --i) {
|
|
1020
|
+
code = path.charCodeAt(i);
|
|
1021
|
+
|
|
1022
|
+
if (code === 47
|
|
1023
|
+
/*/*/
|
|
1024
|
+
) {
|
|
1025
|
+
// If we reached a path separator that was not part of a set of path
|
|
1026
|
+
// separators at the end of the string, stop now
|
|
1027
|
+
if (!matchedSlash) {
|
|
1028
|
+
startPart = i + 1;
|
|
1029
|
+
break;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
continue;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
if (end === -1) {
|
|
1036
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
1037
|
+
// extension
|
|
1038
|
+
matchedSlash = false;
|
|
1039
|
+
end = i + 1;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
if (code === 46
|
|
1043
|
+
/*.*/
|
|
1044
|
+
) {
|
|
1045
|
+
// If this is our first dot, mark it as the start of our extension
|
|
1046
|
+
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
|
|
1047
|
+
} else if (startDot !== -1) {
|
|
1048
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
1049
|
+
// have a good chance at having a non-empty extension
|
|
1050
|
+
preDotState = -1;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
|
|
1055
|
+
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
1056
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
1057
|
+
if (end !== -1) {
|
|
1058
|
+
if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
|
|
1059
|
+
}
|
|
1060
|
+
} else {
|
|
1061
|
+
if (startPart === 0 && isAbsolute) {
|
|
1062
|
+
ret.name = path.slice(1, startDot);
|
|
1063
|
+
ret.base = path.slice(1, end);
|
|
1064
|
+
} else {
|
|
1065
|
+
ret.name = path.slice(startPart, startDot);
|
|
1066
|
+
ret.base = path.slice(startPart, end);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
ret.ext = path.slice(startDot, end);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = "/";
|
|
1073
|
+
return ret;
|
|
1074
|
+
},
|
|
1075
|
+
sep: "/",
|
|
1076
|
+
delimiter: ":",
|
|
1077
|
+
win32: null,
|
|
1078
|
+
posix: null
|
|
1079
|
+
};
|
|
1080
|
+
posix.posix = posix;
|
|
1081
|
+
exports = posix;
|
|
1082
|
+
return exports;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
var path = dew();
|
|
1086
|
+
|
|
1087
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
1088
|
+
|
|
1089
|
+
const processPlatform$1 = typeof Deno !== 'undefined' ? (Deno.build.os === "windows" ? "win32" : Deno.build.os) : undefined;
|
|
1090
|
+
|
|
1091
|
+
h.URL = typeof URL !== 'undefined' ? URL : null;
|
|
1092
|
+
h.pathToFileURL = pathToFileURL$1;
|
|
1093
|
+
h.fileURLToPath = fileURLToPath$1;
|
|
1094
|
+
|
|
1095
|
+
h.Url;
|
|
1096
|
+
h.format;
|
|
1097
|
+
h.resolve;
|
|
1098
|
+
h.resolveObject;
|
|
1099
|
+
|
|
1100
|
+
h.URL;
|
|
1101
|
+
|
|
1102
|
+
const CHAR_BACKWARD_SLASH$1 = 92;
|
|
1103
|
+
const CHAR_FORWARD_SLASH$1 = 47;
|
|
1104
|
+
const CHAR_LOWERCASE_A$1 = 97;
|
|
1105
|
+
const CHAR_LOWERCASE_Z$1 = 122;
|
|
1106
|
+
|
|
1107
|
+
const isWindows$1 = processPlatform$1 === 'win32';
|
|
1108
|
+
|
|
1109
|
+
const forwardSlashRegEx$1 = /\//g;
|
|
1110
|
+
const percentRegEx$1 = /%/g;
|
|
1111
|
+
const backslashRegEx$1 = /\\/g;
|
|
1112
|
+
const newlineRegEx$1 = /\n/g;
|
|
1113
|
+
const carriageReturnRegEx$1 = /\r/g;
|
|
1114
|
+
const tabRegEx$1 = /\t/g;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Get fully resolved platform-specific file path from the given URL string/ object
|
|
1118
|
+
* @param path The file URL string or URL object to convert to a path
|
|
1119
|
+
*/
|
|
1120
|
+
function fileURLToPath$1(path) {
|
|
1121
|
+
if (typeof path === "string") path = new URL(path);
|
|
1122
|
+
else if (!(path instanceof URL)) {
|
|
1123
|
+
throw new Deno.errors.InvalidData(
|
|
1124
|
+
"invalid argument path , must be a string or URL",
|
|
1125
|
+
);
|
|
1126
|
+
}
|
|
1127
|
+
if (path.protocol !== "file:") {
|
|
1128
|
+
throw new Deno.errors.InvalidData("invalid url scheme");
|
|
1129
|
+
}
|
|
1130
|
+
return isWindows$1 ? getPathFromURLWin$1(path) : getPathFromURLPosix$1(path);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
function getPathFromURLWin$1(url) {
|
|
1134
|
+
const hostname = url.hostname;
|
|
1135
|
+
let pathname = url.pathname;
|
|
1136
|
+
for (let n = 0; n < pathname.length; n++) {
|
|
1137
|
+
if (pathname[n] === "%") {
|
|
1138
|
+
const third = pathname.codePointAt(n + 2) || 0x20;
|
|
1139
|
+
if (
|
|
1140
|
+
(pathname[n + 1] === "2" && third === 102) || // 2f 2F /
|
|
1141
|
+
(pathname[n + 1] === "5" && third === 99)
|
|
1142
|
+
) {
|
|
1143
|
+
// 5c 5C \
|
|
1144
|
+
throw new Deno.errors.InvalidData(
|
|
1145
|
+
"must not include encoded \\ or / characters",
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
pathname = pathname.replace(forwardSlashRegEx$1, "\\");
|
|
1152
|
+
pathname = decodeURIComponent(pathname);
|
|
1153
|
+
if (hostname !== "") {
|
|
1154
|
+
//TODO add support for punycode encodings
|
|
1155
|
+
return `\\\\${hostname}${pathname}`;
|
|
1156
|
+
} else {
|
|
1157
|
+
// Otherwise, it's a local path that requires a drive letter
|
|
1158
|
+
const letter = pathname.codePointAt(1) | 0x20;
|
|
1159
|
+
const sep = pathname[2];
|
|
1160
|
+
if (
|
|
1161
|
+
letter < CHAR_LOWERCASE_A$1 ||
|
|
1162
|
+
letter > CHAR_LOWERCASE_Z$1 || // a..z A..Z
|
|
1163
|
+
sep !== ":"
|
|
1164
|
+
) {
|
|
1165
|
+
throw new Deno.errors.InvalidData("file url path must be absolute");
|
|
1166
|
+
}
|
|
1167
|
+
return pathname.slice(1);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
function getPathFromURLPosix$1(url) {
|
|
1171
|
+
if (url.hostname !== "") {
|
|
1172
|
+
throw new Deno.errors.InvalidData("invalid file url hostname");
|
|
1173
|
+
}
|
|
1174
|
+
const pathname = url.pathname;
|
|
1175
|
+
for (let n = 0; n < pathname.length; n++) {
|
|
1176
|
+
if (pathname[n] === "%") {
|
|
1177
|
+
const third = pathname.codePointAt(n + 2) || 0x20;
|
|
1178
|
+
if (pathname[n + 1] === "2" && third === 102) {
|
|
1179
|
+
throw new Deno.errors.InvalidData(
|
|
1180
|
+
"must not include encoded / characters",
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
return decodeURIComponent(pathname);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
/** Get fully resolved platform-specific File URL from the given file path */
|
|
1189
|
+
function pathToFileURL$1(filepath) {
|
|
1190
|
+
let resolved = path.resolve(filepath);
|
|
1191
|
+
// path.resolve strips trailing slashes so we must add them back
|
|
1192
|
+
const filePathLast = filepath.charCodeAt(filepath.length - 1);
|
|
1193
|
+
if (
|
|
1194
|
+
(filePathLast === CHAR_FORWARD_SLASH$1 ||
|
|
1195
|
+
(isWindows$1 && filePathLast === CHAR_BACKWARD_SLASH$1)) &&
|
|
1196
|
+
resolved[resolved.length - 1] !== path.sep
|
|
1197
|
+
) {
|
|
1198
|
+
resolved += "/";
|
|
1199
|
+
}
|
|
1200
|
+
const outURL = new URL("file://");
|
|
1201
|
+
if (resolved.includes("%")) resolved = resolved.replace(percentRegEx$1, "%25");
|
|
1202
|
+
// In posix, "/" is a valid character in paths
|
|
1203
|
+
if (!isWindows$1 && resolved.includes("\\")) {
|
|
1204
|
+
resolved = resolved.replace(backslashRegEx$1, "%5C");
|
|
1205
|
+
}
|
|
1206
|
+
if (resolved.includes("\n")) resolved = resolved.replace(newlineRegEx$1, "%0A");
|
|
1207
|
+
if (resolved.includes("\r")) {
|
|
1208
|
+
resolved = resolved.replace(carriageReturnRegEx$1, "%0D");
|
|
1209
|
+
}
|
|
1210
|
+
if (resolved.includes("\t")) resolved = resolved.replace(tabRegEx$1, "%09");
|
|
1211
|
+
outURL.pathname = resolved;
|
|
1212
|
+
return outURL;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
1216
|
+
|
|
1217
|
+
const processPlatform = typeof Deno !== 'undefined' ? (Deno.build.os === "windows" ? "win32" : Deno.build.os) : undefined;
|
|
1218
|
+
|
|
1219
|
+
h.URL = typeof URL !== 'undefined' ? URL : null;
|
|
1220
|
+
h.pathToFileURL = pathToFileURL;
|
|
1221
|
+
h.fileURLToPath = fileURLToPath;
|
|
1222
|
+
|
|
1223
|
+
h.Url;
|
|
1224
|
+
h.format;
|
|
1225
|
+
h.resolve;
|
|
1226
|
+
h.resolveObject;
|
|
1227
|
+
h.parse;
|
|
1228
|
+
|
|
1229
|
+
h.URL;
|
|
1230
|
+
|
|
1231
|
+
const CHAR_BACKWARD_SLASH = 92;
|
|
1232
|
+
const CHAR_FORWARD_SLASH = 47;
|
|
1233
|
+
const CHAR_LOWERCASE_A = 97;
|
|
1234
|
+
const CHAR_LOWERCASE_Z = 122;
|
|
1235
|
+
|
|
1236
|
+
const isWindows = processPlatform === 'win32';
|
|
1237
|
+
|
|
1238
|
+
const forwardSlashRegEx = /\//g;
|
|
1239
|
+
const percentRegEx = /%/g;
|
|
1240
|
+
const backslashRegEx = /\\/g;
|
|
1241
|
+
const newlineRegEx = /\n/g;
|
|
1242
|
+
const carriageReturnRegEx = /\r/g;
|
|
1243
|
+
const tabRegEx = /\t/g;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Get fully resolved platform-specific file path from the given URL string/ object
|
|
1247
|
+
* @param path The file URL string or URL object to convert to a path
|
|
1248
|
+
*/
|
|
1249
|
+
function fileURLToPath(path) {
|
|
1250
|
+
if (typeof path === "string") path = new URL(path);
|
|
1251
|
+
else if (!(path instanceof URL)) {
|
|
1252
|
+
throw new Deno.errors.InvalidData(
|
|
1253
|
+
"invalid argument path , must be a string or URL",
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
if (path.protocol !== "file:") {
|
|
1257
|
+
throw new Deno.errors.InvalidData("invalid url scheme");
|
|
1258
|
+
}
|
|
1259
|
+
return isWindows ? getPathFromURLWin(path) : getPathFromURLPosix(path);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
function getPathFromURLWin(url) {
|
|
1263
|
+
const hostname = url.hostname;
|
|
1264
|
+
let pathname = url.pathname;
|
|
1265
|
+
for (let n = 0; n < pathname.length; n++) {
|
|
1266
|
+
if (pathname[n] === "%") {
|
|
1267
|
+
const third = pathname.codePointAt(n + 2) || 0x20;
|
|
1268
|
+
if (
|
|
1269
|
+
(pathname[n + 1] === "2" && third === 102) || // 2f 2F /
|
|
1270
|
+
(pathname[n + 1] === "5" && third === 99)
|
|
1271
|
+
) {
|
|
1272
|
+
// 5c 5C \
|
|
1273
|
+
throw new Deno.errors.InvalidData(
|
|
1274
|
+
"must not include encoded \\ or / characters",
|
|
1275
|
+
);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
pathname = pathname.replace(forwardSlashRegEx, "\\");
|
|
1281
|
+
pathname = decodeURIComponent(pathname);
|
|
1282
|
+
if (hostname !== "") {
|
|
1283
|
+
//TODO add support for punycode encodings
|
|
1284
|
+
return `\\\\${hostname}${pathname}`;
|
|
1285
|
+
} else {
|
|
1286
|
+
// Otherwise, it's a local path that requires a drive letter
|
|
1287
|
+
const letter = pathname.codePointAt(1) | 0x20;
|
|
1288
|
+
const sep = pathname[2];
|
|
1289
|
+
if (
|
|
1290
|
+
letter < CHAR_LOWERCASE_A ||
|
|
1291
|
+
letter > CHAR_LOWERCASE_Z || // a..z A..Z
|
|
1292
|
+
sep !== ":"
|
|
1293
|
+
) {
|
|
1294
|
+
throw new Deno.errors.InvalidData("file url path must be absolute");
|
|
1295
|
+
}
|
|
1296
|
+
return pathname.slice(1);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
function getPathFromURLPosix(url) {
|
|
1300
|
+
if (url.hostname !== "") {
|
|
1301
|
+
throw new Deno.errors.InvalidData("invalid file url hostname");
|
|
1302
|
+
}
|
|
1303
|
+
const pathname = url.pathname;
|
|
1304
|
+
for (let n = 0; n < pathname.length; n++) {
|
|
1305
|
+
if (pathname[n] === "%") {
|
|
1306
|
+
const third = pathname.codePointAt(n + 2) || 0x20;
|
|
1307
|
+
if (pathname[n + 1] === "2" && third === 102) {
|
|
1308
|
+
throw new Deno.errors.InvalidData(
|
|
1309
|
+
"must not include encoded / characters",
|
|
1310
|
+
);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
return decodeURIComponent(pathname);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/** Get fully resolved platform-specific File URL from the given file path */
|
|
1318
|
+
function pathToFileURL(filepath) {
|
|
1319
|
+
let resolved = exports$2.resolve(filepath);
|
|
1320
|
+
// path.resolve strips trailing slashes so we must add them back
|
|
1321
|
+
const filePathLast = filepath.charCodeAt(filepath.length - 1);
|
|
1322
|
+
if (
|
|
1323
|
+
(filePathLast === CHAR_FORWARD_SLASH ||
|
|
1324
|
+
(isWindows && filePathLast === CHAR_BACKWARD_SLASH)) &&
|
|
1325
|
+
resolved[resolved.length - 1] !== exports$2.sep
|
|
1326
|
+
) {
|
|
1327
|
+
resolved += "/";
|
|
1328
|
+
}
|
|
1329
|
+
const outURL = new URL("file://");
|
|
1330
|
+
if (resolved.includes("%")) resolved = resolved.replace(percentRegEx, "%25");
|
|
1331
|
+
// In posix, "/" is a valid character in paths
|
|
1332
|
+
if (!isWindows && resolved.includes("\\")) {
|
|
1333
|
+
resolved = resolved.replace(backslashRegEx, "%5C");
|
|
1334
|
+
}
|
|
1335
|
+
if (resolved.includes("\n")) resolved = resolved.replace(newlineRegEx, "%0A");
|
|
1336
|
+
if (resolved.includes("\r")) {
|
|
1337
|
+
resolved = resolved.replace(carriageReturnRegEx, "%0D");
|
|
1338
|
+
}
|
|
1339
|
+
if (resolved.includes("\t")) resolved = resolved.replace(tabRegEx, "%09");
|
|
1340
|
+
outURL.pathname = resolved;
|
|
1341
|
+
return outURL;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
export { exports$2 as e, h };
|