@capsule-run/sdk 0.8.4 → 0.8.6
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/dist/polyfills/fs.d.ts.map +1 -1
- package/dist/polyfills/fs.js +4 -3
- package/dist/polyfills/fs.js.map +1 -1
- package/dist/polyfills/process.d.ts.map +1 -1
- package/dist/polyfills/process.js +10 -8
- package/dist/polyfills/process.js.map +1 -1
- package/dist/polyfills/unenv-runtime/_internal/types.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/_internal/types.mjs +1 -0
- package/dist/polyfills/unenv-runtime/_internal/utils.d.mts +14 -0
- package/dist/polyfills/unenv-runtime/_internal/utils.mjs +49 -0
- package/dist/polyfills/unenv-runtime/mock/empty.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/mock/empty.mjs +1 -0
- package/dist/polyfills/unenv-runtime/mock/noop.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/mock/noop.mjs +1 -0
- package/dist/polyfills/unenv-runtime/mock/proxy.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/mock/proxy.mjs +43 -0
- package/dist/polyfills/unenv-runtime/node/assert/strict.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/assert/strict.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/assert.d.mts +165 -0
- package/dist/polyfills/unenv-runtime/node/assert.mjs +737 -0
- package/dist/polyfills/unenv-runtime/node/async_hooks.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/async_hooks.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/buffer.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/buffer.mjs +35 -0
- package/dist/polyfills/unenv-runtime/node/child_process.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/child_process.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/cluster.d.mts +33 -0
- package/dist/polyfills/unenv-runtime/node/cluster.mjs +71 -0
- package/dist/polyfills/unenv-runtime/node/console.d.mts +38 -0
- package/dist/polyfills/unenv-runtime/node/console.mjs +74 -0
- package/dist/polyfills/unenv-runtime/node/constants.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/constants.mjs +254 -0
- package/dist/polyfills/unenv-runtime/node/crypto.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/crypto.mjs +138 -0
- package/dist/polyfills/unenv-runtime/node/dgram.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/dgram.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/diagnostics_channel.d.mts +11 -0
- package/dist/polyfills/unenv-runtime/node/diagnostics_channel.mjs +34 -0
- package/dist/polyfills/unenv-runtime/node/dns/promises.d.mts +27 -0
- package/dist/polyfills/unenv-runtime/node/dns/promises.mjs +75 -0
- package/dist/polyfills/unenv-runtime/node/dns.d.mts +29 -0
- package/dist/polyfills/unenv-runtime/node/dns.mjs +81 -0
- package/dist/polyfills/unenv-runtime/node/domain.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/domain.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/events.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/events.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/fs/promises.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/fs/promises.mjs +38 -0
- package/dist/polyfills/unenv-runtime/node/fs.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/fs.mjs +117 -0
- package/dist/polyfills/unenv-runtime/node/http.d.mts +23 -0
- package/dist/polyfills/unenv-runtime/node/http.mjs +45 -0
- package/dist/polyfills/unenv-runtime/node/http2.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/http2.mjs +284 -0
- package/dist/polyfills/unenv-runtime/node/https.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/https.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/inspector/promises.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/inspector/promises.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/inspector.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/inspector.mjs +53 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-hook.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-hook.mjs +115 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-local-storage.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-local-storage.mjs +36 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-resource.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-resource.mjs +37 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/base64.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/base64.mjs +97 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/buffer.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/buffer.mjs +1846 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/file.d.mts +14 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/file.mjs +26 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/ieee754.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/ieee754.mjs +89 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/constants.d.mts +58 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/constants.mjs +58 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/node.d.mts +78 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/node.mjs +110 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/web.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/web.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/dgram/socket.d.mts +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/dgram/socket.mjs +61 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/channel.d.mts +18 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/channel.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/tracing-channel.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/tracing-channel.mjs +48 -0
- package/dist/polyfills/unenv-runtime/node/internal/dns/constants.d.mts +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/dns/constants.mjs +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/domain/domain.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/domain/domain.mjs +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/events/events.d.mts +207 -0
- package/dist/polyfills/unenv-runtime/node/internal/events/events.mjs +1097 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/classes.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/classes.mjs +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/constants.d.mts +59 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/constants.mjs +59 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/fs.d.mts +96 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/fs.mjs +106 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/promises.d.mts +32 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/promises.mjs +32 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/agent.d.mts +14 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/agent.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/constants.d.mts +67 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/constants.mjs +103 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/request.d.mts +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/request.mjs +53 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/response.d.mts +42 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/response.mjs +101 -0
- package/dist/polyfills/unenv-runtime/node/internal/http2/constants.d.mts +241 -0
- package/dist/polyfills/unenv-runtime/node/internal/http2/constants.mjs +241 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/server.d.mts +17 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/server.mjs +33 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/socket.d.mts +45 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/socket.mjs +83 -0
- package/dist/polyfills/unenv-runtime/node/internal/os/constants.d.mts +133 -0
- package/dist/polyfills/unenv-runtime/node/internal/os/constants.mjs +133 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/constants.d.mts +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/constants.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/histogram.d.mts +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/histogram.mjs +43 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/performance.d.mts +103 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/performance.mjs +232 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/env.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/env.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/hrtime.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/hrtime.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/nexttick.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/nexttick.mjs +55 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/node-version.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/node-version.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/process.d.mts +113 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/process.mjs +238 -0
- package/dist/polyfills/unenv-runtime/node/internal/punycode/punycode.d.mts +59 -0
- package/dist/polyfills/unenv-runtime/node/internal/punycode/punycode.mjs +410 -0
- package/dist/polyfills/unenv-runtime/node/internal/querystring/querystring.d.mts +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/querystring/querystring.mjs +320 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/interface.d.mts +20 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/interface.mjs +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/interface.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/interface.mjs +6 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/readline.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/readline.mjs +20 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/duplex.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/duplex.mjs +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/readable.d.mts +67 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/readable.mjs +112 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/transform.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/transform.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/writable.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/writable.mjs +87 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/immediate.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/immediate.mjs +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/scheduler.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/scheduler.mjs +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-immediate.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-immediate.mjs +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-interval.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-interval.mjs +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-timeout.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-timeout.mjs +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/timeout.d.mts +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/timeout.mjs +30 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/constants.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/constants.mjs +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/secure-context.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/secure-context.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/server.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/server.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/tls-socket.d.mts +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/tls-socket.mjs +48 -0
- package/dist/polyfills/unenv-runtime/node/internal/trace_events/tracing.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/trace_events/tracing.mjs +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/read-stream.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/read-stream.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/write-stream.d.mts +20 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/write-stream.mjs +44 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/constants.d.mts +44 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/constants.mjs +44 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/errors.d.mts +26 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/errors.mjs +54 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/url.d.mts +22 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/url.mjs +181 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/util.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/util.mjs +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/inherits.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/inherits.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/legacy-types.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/legacy-types.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/log.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/log.mjs +55 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/mime.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/mime.mjs +35 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/promisify.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/promisify.mjs +23 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/types.d.mts +45 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/types.mjs +45 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/deserializer.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/deserializer.mjs +23 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/profiler.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/profiler.mjs +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/serializer.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/serializer.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/constants.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/constants.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/script.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/script.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/broadcast-channel.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/broadcast-channel.mjs +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-channel.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-channel.mjs +5 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-port.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-port.mjs +17 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/worker.d.mts +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/worker.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/codes.d.mts +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/codes.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/constants.d.mts +108 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/constants.mjs +108 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/_shared.d.mts +22 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/_shared.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/brotli.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/brotli.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/deflate.d.mts +29 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/deflate.mjs +36 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/gzip.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/gzip.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/zip.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/zip.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/module.d.mts +54 -0
- package/dist/polyfills/unenv-runtime/node/module.mjs +191 -0
- package/dist/polyfills/unenv-runtime/node/net.d.mts +22 -0
- package/dist/polyfills/unenv-runtime/node/net.mjs +52 -0
- package/dist/polyfills/unenv-runtime/node/os.d.mts +26 -0
- package/dist/polyfills/unenv-runtime/node/os.mjs +118 -0
- package/dist/polyfills/unenv-runtime/node/path/posix.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/path/posix.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/path/win32.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/path/win32.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/path.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/path.mjs +31 -0
- package/dist/polyfills/unenv-runtime/node/perf_hooks.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/perf_hooks.mjs +51 -0
- package/dist/polyfills/unenv-runtime/node/process.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/process.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/punycode.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/punycode.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/querystring.d.mts +49 -0
- package/dist/polyfills/unenv-runtime/node/querystring.mjs +766 -0
- package/dist/polyfills/unenv-runtime/node/readline/promises.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/readline/promises.mjs +10 -0
- package/dist/polyfills/unenv-runtime/node/readline.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/readline.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/repl.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/repl.mjs +20 -0
- package/dist/polyfills/unenv-runtime/node/sqlite.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/sqlite.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/stream/consumers.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/stream/consumers.mjs +13 -0
- package/dist/polyfills/unenv-runtime/node/stream/promises.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/stream/promises.mjs +7 -0
- package/dist/polyfills/unenv-runtime/node/stream/web.d.mts +24 -0
- package/dist/polyfills/unenv-runtime/node/stream/web.mjs +41 -0
- package/dist/polyfills/unenv-runtime/node/stream.d.mts +42 -0
- package/dist/polyfills/unenv-runtime/node/stream.mjs +54 -0
- package/dist/polyfills/unenv-runtime/node/string_decoder.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/string_decoder.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/sys.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/sys.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/timers/promises.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/timers/promises.mjs +14 -0
- package/dist/polyfills/unenv-runtime/node/timers.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/timers.mjs +32 -0
- package/dist/polyfills/unenv-runtime/node/tls.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/tls.mjs +41 -0
- package/dist/polyfills/unenv-runtime/node/trace_events.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/trace_events.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/tty.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/tty.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/url.d.mts +61 -0
- package/dist/polyfills/unenv-runtime/node/url.mjs +1044 -0
- package/dist/polyfills/unenv-runtime/node/util/types.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/util/types.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/util.d.mts +32 -0
- package/dist/polyfills/unenv-runtime/node/util.mjs +84 -0
- package/dist/polyfills/unenv-runtime/node/v8.d.mts +29 -0
- package/dist/polyfills/unenv-runtime/node/v8.mjs +108 -0
- package/dist/polyfills/unenv-runtime/node/vm.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/vm.mjs +41 -0
- package/dist/polyfills/unenv-runtime/node/wasi.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/wasi.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/worker_threads.d.mts +23 -0
- package/dist/polyfills/unenv-runtime/node/worker_threads.mjs +55 -0
- package/dist/polyfills/unenv-runtime/node/zlib.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/node/zlib.mjs +212 -0
- package/dist/polyfills/unenv-runtime/npm/cross-fetch.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/npm/cross-fetch.mjs +6 -0
- package/dist/polyfills/unenv-runtime/npm/debug.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/npm/debug.mjs +43 -0
- package/dist/polyfills/unenv-runtime/npm/fsevents.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/npm/fsevents.mjs +20 -0
- package/dist/polyfills/unenv-runtime/npm/inherits.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/npm/inherits.mjs +2 -0
- package/dist/polyfills/unenv-runtime/npm/node-fetch.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/npm/node-fetch.mjs +23 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/index.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/index.mjs +15 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/webidl2js-wrapper.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/webidl2js-wrapper.mjs +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/buffer.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/polyfill/buffer.mjs +4 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis-global.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis-global.mjs +5 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis.mjs +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/package.json +3 -0
- package/dist/polyfills/unenv-runtime/polyfill/performance.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/performance.mjs +10 -0
- package/dist/polyfills/unenv-runtime/polyfill/process.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/process.mjs +10 -0
- package/dist/polyfills/unenv-runtime/polyfill/source-maps.mjs +15 -0
- package/dist/polyfills/unenv-runtime/polyfill/timers.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/polyfill/timers.mjs +7 -0
- package/dist/polyfills/unenv-runtime/web/performance/_polyfills.d.mts +100 -0
- package/dist/polyfills/unenv-runtime/web/performance/_polyfills.mjs +184 -0
- package/dist/polyfills/unenv-runtime/web/performance/index.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/web/performance/index.mjs +14 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +39 -10
- package/dist/run.js.map +1 -1
- package/package.json +2 -2
- package/src/polyfills/fs.ts +5 -3
- package/src/polyfills/process.ts +10 -8
- package/src/run.ts +41 -11
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Protocols that can allow "unsafe" and "unwise" chars.
|
|
2
|
+
export declare const unsafeProtocol: unknown;
|
|
3
|
+
// Protocols that never have a hostname.
|
|
4
|
+
export declare const hostlessProtocol: unknown;
|
|
5
|
+
// Protocols that always contain a // bit.
|
|
6
|
+
export declare const slashedProtocol: unknown;
|
|
7
|
+
export declare function pathToFileURL(filepath: string, options?: {
|
|
8
|
+
windows?: boolean;
|
|
9
|
+
});
|
|
10
|
+
export declare function fileURLToPath(path: string | URL, options?: {
|
|
11
|
+
windows?: boolean;
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Utility function that converts a URL object into an ordinary options object
|
|
15
|
+
* as expected by the `http.request` and `https.request` APIs.
|
|
16
|
+
* @param {URL} url
|
|
17
|
+
* @returns {Record<string, unknown>}
|
|
18
|
+
*/
|
|
19
|
+
export declare function urlToHttpOptions(url: URL): {
|
|
20
|
+
__proto__: null;
|
|
21
|
+
path: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// Source: https://github.com/nodejs/node/blob/v22.7.0/lib/internal/url.js
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import * as punnycode from "../../punycode.mjs";
|
|
4
|
+
import { CHAR_FORWARD_SLASH, CHAR_BACKWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z } from "./constants.mjs";
|
|
5
|
+
import { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_INVALID_URL_SCHEME, ERR_INVALID_FILE_URL_PATH, ERR_INVALID_FILE_URL_HOST } from "./errors.mjs";
|
|
6
|
+
// Protocols that can allow "unsafe" and "unwise" chars.
|
|
7
|
+
export const unsafeProtocol = new Set(["javascript", "javascript:"]);
|
|
8
|
+
// Protocols that never have a hostname.
|
|
9
|
+
export const hostlessProtocol = new Set(["javascript", "javascript:"]);
|
|
10
|
+
// Protocols that always contain a // bit.
|
|
11
|
+
export const slashedProtocol = new Set([
|
|
12
|
+
"http",
|
|
13
|
+
"http:",
|
|
14
|
+
"https",
|
|
15
|
+
"https:",
|
|
16
|
+
"ftp",
|
|
17
|
+
"ftp:",
|
|
18
|
+
"gopher",
|
|
19
|
+
"gopher:",
|
|
20
|
+
"file",
|
|
21
|
+
"file:",
|
|
22
|
+
"ws",
|
|
23
|
+
"ws:",
|
|
24
|
+
"wss",
|
|
25
|
+
"wss:"
|
|
26
|
+
]);
|
|
27
|
+
const FORWARD_SLASH = /\//g;
|
|
28
|
+
export function pathToFileURL(filepath, options) {
|
|
29
|
+
const windows = options?.windows;
|
|
30
|
+
if (windows && String.prototype.startsWith.call(filepath, "\\\\")) {
|
|
31
|
+
const outURL = new URL("file://");
|
|
32
|
+
// UNC path format: \\server\share\resource
|
|
33
|
+
// Handle extended UNC path and standard UNC path
|
|
34
|
+
// "\\?\UNC\" path prefix should be ignored.
|
|
35
|
+
// Ref: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
|
|
36
|
+
const isExtendedUNC = String.prototype.startsWith.call(filepath, "\\\\?\\UNC\\");
|
|
37
|
+
const prefixLength = isExtendedUNC ? 8 : 2;
|
|
38
|
+
const hostnameEndIndex = String.prototype.indexOf.call(filepath, "\\", prefixLength);
|
|
39
|
+
if (hostnameEndIndex === -1) {
|
|
40
|
+
throw new ERR_INVALID_ARG_VALUE("path", filepath, "Missing UNC resource path");
|
|
41
|
+
}
|
|
42
|
+
const hostname = String.prototype.slice.call(filepath, prefixLength, hostnameEndIndex);
|
|
43
|
+
outURL.hostname = punnycode.toASCII(hostname);
|
|
44
|
+
outURL.pathname = encodePathChars(filepath.slice(hostnameEndIndex).replace(backslashRegEx, "/"), { windows });
|
|
45
|
+
return outURL;
|
|
46
|
+
}
|
|
47
|
+
let resolved = windows ? path.win32.resolve(filepath) : path.posix.resolve(filepath);
|
|
48
|
+
// path.resolve strips trailing slashes so we must add them back
|
|
49
|
+
const filePathLast = String.prototype.charCodeAt.call(filepath, filepath.length - 1);
|
|
50
|
+
if ((filePathLast === CHAR_FORWARD_SLASH || windows && filePathLast === CHAR_BACKWARD_SLASH) && resolved.at(-1) !== path.sep) resolved += "/";
|
|
51
|
+
// Call encodePathChars first to avoid encoding % again for ? and #.
|
|
52
|
+
resolved = encodePathChars(resolved, { windows });
|
|
53
|
+
// Question and hash character should be included in pathname.
|
|
54
|
+
// Therefore, encoding is required to eliminate parsing them in different states.
|
|
55
|
+
// This is done as an optimization to not creating a URL instance and
|
|
56
|
+
// later triggering pathname setter, which impacts performance
|
|
57
|
+
if (String.prototype.indexOf.call(resolved, "?") !== -1) resolved = resolved.replace(questionRegex, "%3F");
|
|
58
|
+
if (String.prototype.indexOf.call(resolved, "#") !== -1) resolved = resolved.replace(hashRegex, "%23");
|
|
59
|
+
return new URL(`file://${resolved}`);
|
|
60
|
+
}
|
|
61
|
+
export function fileURLToPath(path, options) {
|
|
62
|
+
const windows = options?.windows;
|
|
63
|
+
if (typeof path === "string") path = new URL(path);
|
|
64
|
+
else if (!isURL(path)) throw new ERR_INVALID_ARG_TYPE("path", ["string", "URL"], path);
|
|
65
|
+
if (path.protocol !== "file:") throw new ERR_INVALID_URL_SCHEME("file");
|
|
66
|
+
return windows ? getPathFromURLWin32(path) : getPathFromURLPosix(path);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Utility function that converts a URL object into an ordinary options object
|
|
70
|
+
* as expected by the `http.request` and `https.request` APIs.
|
|
71
|
+
* @param {URL} url
|
|
72
|
+
* @returns {Record<string, unknown>}
|
|
73
|
+
*/
|
|
74
|
+
export function urlToHttpOptions(url) {
|
|
75
|
+
const { hostname, pathname, port, username, password, search } = url;
|
|
76
|
+
return {
|
|
77
|
+
__proto__: null,
|
|
78
|
+
...url,
|
|
79
|
+
protocol: url.protocol,
|
|
80
|
+
hostname: hostname && String.prototype.startsWith.call(hostname, "[") ? String.prototype.slice.call(hostname, 1, -1) : hostname,
|
|
81
|
+
hash: url.hash,
|
|
82
|
+
search,
|
|
83
|
+
pathname,
|
|
84
|
+
path: `${pathname || ""}${search || ""}`,
|
|
85
|
+
href: url.href,
|
|
86
|
+
port: port === "" ? undefined : Number(port),
|
|
87
|
+
auth: username || password ? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : undefined
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// The following characters are percent-encoded when converting from file path
|
|
91
|
+
// to URL:
|
|
92
|
+
// - %: The percent character is the only character not encoded by the
|
|
93
|
+
// `pathname` setter.
|
|
94
|
+
// - \: Backslash is encoded on non-windows platforms since it's a valid
|
|
95
|
+
// character but the `pathname` setters replaces it by a forward slash.
|
|
96
|
+
// - LF: The newline character is stripped out by the `pathname` setter.
|
|
97
|
+
// (See whatwg/url#419)
|
|
98
|
+
// - CR: The carriage return character is also stripped out by the `pathname`
|
|
99
|
+
// setter.
|
|
100
|
+
// - TAB: The tab character is also stripped out by the `pathname` setter.
|
|
101
|
+
const percentRegEx = /%/g;
|
|
102
|
+
const backslashRegEx = /\\/g;
|
|
103
|
+
const newlineRegEx = /\n/g;
|
|
104
|
+
const carriageReturnRegEx = /\r/g;
|
|
105
|
+
const tabRegEx = /\t/g;
|
|
106
|
+
const questionRegex = /\?/g;
|
|
107
|
+
const hashRegex = /#/g;
|
|
108
|
+
function encodePathChars(filepath, options) {
|
|
109
|
+
const windows = options?.windows;
|
|
110
|
+
if (String.prototype.indexOf.call(filepath, "%") !== -1) filepath = filepath.replace(percentRegEx, "%25");
|
|
111
|
+
// In posix, backslash is a valid character in paths:
|
|
112
|
+
if (!windows && String.prototype.indexOf.call(filepath, "\\") !== -1) filepath = filepath.replace(backslashRegEx, "%5C");
|
|
113
|
+
if (String.prototype.indexOf.call(filepath, "\n") !== -1) filepath = filepath.replace(newlineRegEx, "%0A");
|
|
114
|
+
if (String.prototype.indexOf.call(filepath, "\r") !== -1) filepath = filepath.replace(carriageReturnRegEx, "%0D");
|
|
115
|
+
if (String.prototype.indexOf.call(filepath, " ") !== -1) filepath = filepath.replace(tabRegEx, "%09");
|
|
116
|
+
return filepath;
|
|
117
|
+
}
|
|
118
|
+
function getPathFromURLWin32(url) {
|
|
119
|
+
const hostname = url.hostname;
|
|
120
|
+
let pathname = url.pathname;
|
|
121
|
+
for (let n = 0; n < pathname.length; n++) {
|
|
122
|
+
if (pathname[n] === "%") {
|
|
123
|
+
const third = pathname.codePointAt(n + 2) | 32;
|
|
124
|
+
if (pathname[n + 1] === "2" && third === 102 || pathname[n + 1] === "5" && third === 99) {
|
|
125
|
+
// 5c 5C \
|
|
126
|
+
throw new ERR_INVALID_FILE_URL_PATH(String.raw`must not include encoded \ or / characters`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
pathname = pathname.replace(FORWARD_SLASH, "\\");
|
|
131
|
+
pathname = decodeURIComponent(pathname);
|
|
132
|
+
if (hostname !== "") {
|
|
133
|
+
// If hostname is set, then we have a UNC path
|
|
134
|
+
// Pass the hostname through domainToUnicode just in case
|
|
135
|
+
// it is an IDN using punycode encoding. We do not need to worry
|
|
136
|
+
// about percent encoding because the URL parser will have
|
|
137
|
+
// already taken care of that for us. Note that this only
|
|
138
|
+
// causes IDNs with an appropriate `xn--` prefix to be decoded.
|
|
139
|
+
return `\\\\${punnycode.toUnicode(hostname)}${pathname}`;
|
|
140
|
+
}
|
|
141
|
+
// Otherwise, it's a local path that requires a drive letter
|
|
142
|
+
const letter = String.prototype.codePointAt.call(pathname, 1) | 32;
|
|
143
|
+
const sep = String.prototype.charAt.call(pathname, 2);
|
|
144
|
+
if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z || sep !== ":") {
|
|
145
|
+
throw new ERR_INVALID_FILE_URL_PATH("must be absolute");
|
|
146
|
+
}
|
|
147
|
+
return String.prototype.slice.call(pathname, 1);
|
|
148
|
+
}
|
|
149
|
+
function getPathFromURLPosix(url) {
|
|
150
|
+
if (url.hostname !== "") {
|
|
151
|
+
throw new ERR_INVALID_FILE_URL_HOST("??");
|
|
152
|
+
}
|
|
153
|
+
const pathname = url.pathname;
|
|
154
|
+
for (let n = 0; n < pathname.length; n++) {
|
|
155
|
+
if (pathname[n] === "%") {
|
|
156
|
+
const third = String.prototype.codePointAt.call(pathname, n + 2) | 32;
|
|
157
|
+
if (pathname[n + 1] === "2" && third === 102) {
|
|
158
|
+
throw new ERR_INVALID_FILE_URL_PATH("must not include encoded / characters");
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return decodeURIComponent(pathname);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Checks if a value has the shape of a WHATWG URL object.
|
|
166
|
+
*
|
|
167
|
+
* Using a symbol or instanceof would not be able to recognize URL objects
|
|
168
|
+
* coming from other implementations (e.g. in Electron), so instead we are
|
|
169
|
+
* checking some well known properties for a lack of a better test.
|
|
170
|
+
*
|
|
171
|
+
* We use `href` and `protocol` as they are the only properties that are
|
|
172
|
+
* easy to retrieve and calculate due to the lazy nature of the getters.
|
|
173
|
+
*
|
|
174
|
+
* We check for `auth` and `path` attribute to distinguish legacy url instance with
|
|
175
|
+
* WHATWG URL instance.
|
|
176
|
+
* @param {*} self
|
|
177
|
+
* @returns {self is URL}
|
|
178
|
+
*/
|
|
179
|
+
function isURL(self) {
|
|
180
|
+
return Boolean(self?.href && self.protocol && self.auth === undefined && self.path === undefined);
|
|
181
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Source: https://github.com/nodejs/node/blob/v22.7.0/lib/internal/util.js
|
|
2
|
+
// As of V8 6.6, depending on the size of the array, this is anywhere
|
|
3
|
+
// between 1.5-10x faster than the two-arg version of Array#splice()
|
|
4
|
+
export declare function spliceOne(list: unknown[], index: number);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Source: https://github.com/nodejs/node/blob/v22.7.0/lib/internal/util.js
|
|
2
|
+
// As of V8 6.6, depending on the size of the array, this is anywhere
|
|
3
|
+
// between 1.5-10x faster than the two-arg version of Array#splice()
|
|
4
|
+
export function spliceOne(list, index) {
|
|
5
|
+
for (; index + 1 < list.length; index++) list[index] = list[index + 1];
|
|
6
|
+
list.pop();
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function inherits(ctor: any, superCtor: any);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function inherits(ctor, superCtor) {
|
|
2
|
+
if (!superCtor) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
ctor.super_ = superCtor;
|
|
6
|
+
ctor.prototype = Object.create(superCtor.prototype, { constructor: {
|
|
7
|
+
value: ctor,
|
|
8
|
+
enumerable: false,
|
|
9
|
+
writable: true,
|
|
10
|
+
configurable: true
|
|
11
|
+
} });
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type nodeUtil from "node:util";
|
|
2
|
+
export declare const isRegExp: typeof nodeUtil.isRegExp;
|
|
3
|
+
export declare const isDate: typeof nodeUtil.isDate;
|
|
4
|
+
export declare const isArray: typeof nodeUtil.isArray;
|
|
5
|
+
export declare const isBoolean: typeof nodeUtil.isBoolean;
|
|
6
|
+
export declare const isNull: typeof nodeUtil.isNull;
|
|
7
|
+
export declare const isNullOrUndefined: typeof nodeUtil.isNullOrUndefined;
|
|
8
|
+
export declare const isNumber: typeof nodeUtil.isNumber;
|
|
9
|
+
export declare const isString: typeof nodeUtil.isString;
|
|
10
|
+
export declare const isSymbol: typeof nodeUtil.isSymbol;
|
|
11
|
+
export declare const isUndefined: typeof nodeUtil.isUndefined;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
13
|
+
export declare const isFunction: typeof nodeUtil.isFunction;
|
|
14
|
+
export declare const isBuffer: typeof nodeUtil.isBuffer;
|
|
15
|
+
export declare const isDeepStrictEqual: typeof nodeUtil.isDeepStrictEqual;
|
|
16
|
+
export declare const isObject: typeof nodeUtil.isObject;
|
|
17
|
+
export declare const isError: typeof nodeUtil.isError;
|
|
18
|
+
// Source https://github.com/jonschlinkert/is-primitive/blob/b22c524da5cbac075f14145780ec4b3637afd7dc/index.js
|
|
19
|
+
export declare const isPrimitive: typeof nodeUtil.isPrimitive;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const isRegExp = (val) => val instanceof RegExp;
|
|
2
|
+
export const isDate = (val) => val instanceof Date;
|
|
3
|
+
export const isArray = (val) => Array.isArray(val);
|
|
4
|
+
export const isBoolean = (val) => typeof val === "boolean";
|
|
5
|
+
export const isNull = (val) => val === null;
|
|
6
|
+
export const isNullOrUndefined = (val) => val === null || val === undefined;
|
|
7
|
+
export const isNumber = (val) => typeof val === "number";
|
|
8
|
+
export const isString = (val) => typeof val === "string";
|
|
9
|
+
export const isSymbol = (val) => typeof val === "symbol";
|
|
10
|
+
export const isUndefined = (val) => val === undefined;
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
12
|
+
export const isFunction = (val) => typeof val === "function";
|
|
13
|
+
export const isBuffer = (val) => {
|
|
14
|
+
return val && typeof val === "object" && typeof val.copy === "function" && typeof val.fill === "function" && typeof val.readUInt8 === "function";
|
|
15
|
+
};
|
|
16
|
+
export const isDeepStrictEqual = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
17
|
+
export const isObject = (val) => val !== null && typeof val === "object" && Object.getPrototypeOf(val).isPrototypeOf(Object);
|
|
18
|
+
export const isError = (val) => val instanceof Error;
|
|
19
|
+
// Source https://github.com/jonschlinkert/is-primitive/blob/b22c524da5cbac075f14145780ec4b3637afd7dc/index.js
|
|
20
|
+
export const isPrimitive = (val) => {
|
|
21
|
+
if (typeof val === "object") {
|
|
22
|
+
return val === null;
|
|
23
|
+
}
|
|
24
|
+
return typeof val !== "function";
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type nodeUtil from "node:util";
|
|
2
|
+
export declare const log: unknown;
|
|
3
|
+
export declare const debuglog: typeof nodeUtil.debuglog;
|
|
4
|
+
export declare const debug: typeof nodeUtil.debug;
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
export declare const inspect: typeof nodeUtil.inspect;
|
|
7
|
+
export declare const format: typeof nodeUtil.format;
|
|
8
|
+
export declare const formatWithOptions: typeof nodeUtil.formatWithOptions;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const log = (...args) => {
|
|
2
|
+
console.log(...args);
|
|
3
|
+
};
|
|
4
|
+
export const debuglog = (section, _cb) => {
|
|
5
|
+
const fn = (msg, ...params) => {
|
|
6
|
+
if (fn.enabled) {
|
|
7
|
+
console.debug(`[${section}] ${msg}`, ...params);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
fn.enabled = true;
|
|
11
|
+
return fn;
|
|
12
|
+
};
|
|
13
|
+
export const debug = debuglog;
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
export const inspect = (object) => JSON.stringify(object, null, 2);
|
|
16
|
+
export const format = (...args) => _format(...args);
|
|
17
|
+
export const formatWithOptions = (_options, ...args) => _format(...args);
|
|
18
|
+
// Source: https://github.com/tmpfs/format-util/blob/0c989942c959b179eec294a4e725afd63e743f18/format.js
|
|
19
|
+
function _format(fmt, ...args) {
|
|
20
|
+
const re = /(%?)(%([djos]))/g;
|
|
21
|
+
if (args.length > 0) {
|
|
22
|
+
fmt = fmt.replace(re, (match, escaped, ptn, flag) => {
|
|
23
|
+
let arg = args.shift();
|
|
24
|
+
switch (flag) {
|
|
25
|
+
case "o":
|
|
26
|
+
if (Array.isArray(arg)) {
|
|
27
|
+
arg = JSON.stringify(arg);
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
break;
|
|
31
|
+
case "s":
|
|
32
|
+
arg = "" + arg;
|
|
33
|
+
break;
|
|
34
|
+
case "d":
|
|
35
|
+
arg = Number(arg);
|
|
36
|
+
break;
|
|
37
|
+
case "j":
|
|
38
|
+
arg = JSON.stringify(arg);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
if (!escaped) {
|
|
42
|
+
return arg;
|
|
43
|
+
}
|
|
44
|
+
args.unshift(arg);
|
|
45
|
+
return match;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// arguments remain after formatting
|
|
49
|
+
if (args.length > 0) {
|
|
50
|
+
fmt += " " + args.join(" ");
|
|
51
|
+
}
|
|
52
|
+
// update escaped %% values
|
|
53
|
+
fmt = fmt.replace(/%{2}/g, "%");
|
|
54
|
+
return "" + fmt;
|
|
55
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MIMEType as MIMETypeT, MIMEParams as MIMEParamsT } from "node:util";
|
|
2
|
+
// https://nodejs.org/api/util.html#class-utilmimetype
|
|
3
|
+
export declare class MIMEType implements MIMETypeT {
|
|
4
|
+
readonly __unenv__: true;
|
|
5
|
+
params;
|
|
6
|
+
type: string;
|
|
7
|
+
subtype: string;
|
|
8
|
+
constructor(input: string | {
|
|
9
|
+
toString: () => string;
|
|
10
|
+
});
|
|
11
|
+
get essence();
|
|
12
|
+
toString();
|
|
13
|
+
}
|
|
14
|
+
// https://nodejs.org/api/util.html#util_class_util_mimeparams
|
|
15
|
+
export declare class MIMEParams extends Map<string, string> implements MIMEParamsT {
|
|
16
|
+
readonly __unenv__: true;
|
|
17
|
+
get(name: string): any;
|
|
18
|
+
toString();
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// https://nodejs.org/api/util.html#class-utilmimetype
|
|
2
|
+
export class MIMEType {
|
|
3
|
+
__unenv__ = true;
|
|
4
|
+
params = new MIMEParams();
|
|
5
|
+
type;
|
|
6
|
+
subtype;
|
|
7
|
+
constructor(input) {
|
|
8
|
+
const [essence = "", ...params] = String(input).split(";");
|
|
9
|
+
const [type = "", subtype = ""] = essence.split("/");
|
|
10
|
+
this.type = type;
|
|
11
|
+
this.subtype = subtype;
|
|
12
|
+
this.params = new MIMEParams();
|
|
13
|
+
for (const param of params) {
|
|
14
|
+
const [name, value] = param.split("=");
|
|
15
|
+
this.params.set(name, value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
get essence() {
|
|
19
|
+
return this.type + "/" + this.subtype;
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
const paramsStr = this.params.toString();
|
|
23
|
+
return this.essence + (paramsStr ? `;${paramsStr}` : "");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// https://nodejs.org/api/util.html#util_class_util_mimeparams
|
|
27
|
+
export class MIMEParams extends Map {
|
|
28
|
+
__unenv__ = true;
|
|
29
|
+
get(name) {
|
|
30
|
+
return super.get(name) || null;
|
|
31
|
+
}
|
|
32
|
+
toString() {
|
|
33
|
+
return [...this.entries()].map(([name, value]) => `${name}=${value}`).join("&");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const customSymbol = /* @__PURE__ */ Symbol("customPromisify");
|
|
2
|
+
function _promisify(fn) {
|
|
3
|
+
if (fn[customSymbol]) {
|
|
4
|
+
return fn[customSymbol];
|
|
5
|
+
}
|
|
6
|
+
return function(...args) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
try {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
fn.call(this, ...args, (err, val) => {
|
|
11
|
+
if (err) {
|
|
12
|
+
return reject(err);
|
|
13
|
+
}
|
|
14
|
+
resolve(val);
|
|
15
|
+
});
|
|
16
|
+
} catch (error) {
|
|
17
|
+
reject(error);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
export const promisify = /* @__PURE__ */ Object.assign(_promisify, { custom: customSymbol });
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type nodeUtilTypes from "node:util/types";
|
|
2
|
+
export declare const isExternal: typeof nodeUtilTypes.isExternal;
|
|
3
|
+
export declare const isDate: typeof nodeUtilTypes.isDate;
|
|
4
|
+
export declare const isArgumentsObject: unknown;
|
|
5
|
+
export declare const isBigIntObject: (val: any) => val is bigint;
|
|
6
|
+
export declare const isBooleanObject: typeof nodeUtilTypes.isBooleanObject;
|
|
7
|
+
export declare const isNumberObject: typeof nodeUtilTypes.isNumberObject;
|
|
8
|
+
export declare const isStringObject: typeof nodeUtilTypes.isStringObject;
|
|
9
|
+
export declare const isSymbolObject: typeof nodeUtilTypes.isSymbolObject;
|
|
10
|
+
export declare const isNativeError: unknown;
|
|
11
|
+
export declare const isRegExp: typeof nodeUtilTypes.isRegExp;
|
|
12
|
+
export declare const isAsyncFunction: unknown;
|
|
13
|
+
export declare const isGeneratorFunction: unknown;
|
|
14
|
+
export declare const isGeneratorObject: unknown;
|
|
15
|
+
export declare const isPromise: typeof nodeUtilTypes.isPromise;
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
export declare const isMap: typeof nodeUtilTypes.isMap;
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
export declare const isSet: typeof nodeUtilTypes.isSet;
|
|
20
|
+
export declare const isMapIterator: unknown;
|
|
21
|
+
export declare const isSetIterator: unknown;
|
|
22
|
+
export declare const isWeakMap: typeof nodeUtilTypes.isWeakMap;
|
|
23
|
+
export declare const isWeakSet: typeof nodeUtilTypes.isWeakSet;
|
|
24
|
+
export declare const isArrayBuffer: typeof nodeUtilTypes.isArrayBuffer;
|
|
25
|
+
export declare const isDataView: typeof nodeUtilTypes.isDataView;
|
|
26
|
+
export declare const isSharedArrayBuffer: typeof nodeUtilTypes.isSharedArrayBuffer;
|
|
27
|
+
export declare const isProxy: unknown;
|
|
28
|
+
export declare const isModuleNamespaceObject: unknown;
|
|
29
|
+
export declare const isAnyArrayBuffer: unknown;
|
|
30
|
+
export declare const isBoxedPrimitive: unknown;
|
|
31
|
+
export declare const isArrayBufferView: unknown;
|
|
32
|
+
export declare const isTypedArray: unknown;
|
|
33
|
+
export declare const isUint8Array: unknown;
|
|
34
|
+
export declare const isUint8ClampedArray: unknown;
|
|
35
|
+
export declare const isUint16Array: unknown;
|
|
36
|
+
export declare const isUint32Array: unknown;
|
|
37
|
+
export declare const isInt8Array: unknown;
|
|
38
|
+
export declare const isInt16Array: unknown;
|
|
39
|
+
export declare const isInt32Array: unknown;
|
|
40
|
+
export declare const isFloat32Array: unknown;
|
|
41
|
+
export declare const isFloat64Array: unknown;
|
|
42
|
+
export declare const isBigInt64Array: unknown;
|
|
43
|
+
export declare const isBigUint64Array: unknown;
|
|
44
|
+
export declare const isKeyObject: unknown;
|
|
45
|
+
export declare const isCryptoKey: unknown;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { notImplemented } from "../../../_internal/utils.mjs";
|
|
2
|
+
export const isExternal = (_obj) => false;
|
|
3
|
+
export const isDate = (val) => val instanceof Date;
|
|
4
|
+
export const isArgumentsObject = /* @__PURE__ */ notImplemented("util.types.isArgumentsObject");
|
|
5
|
+
export const isBigIntObject = (val) => typeof val === "bigint";
|
|
6
|
+
export const isBooleanObject = (val) => typeof val === "boolean";
|
|
7
|
+
export const isNumberObject = (val) => typeof val === "number";
|
|
8
|
+
export const isStringObject = (val) => typeof val === "string";
|
|
9
|
+
export const isSymbolObject = (val) => typeof val === "symbol";
|
|
10
|
+
export const isNativeError = /* @__PURE__ */ notImplemented("util.types.isNativeError");
|
|
11
|
+
export const isRegExp = (val) => val instanceof RegExp;
|
|
12
|
+
export const isAsyncFunction = /* @__PURE__ */ notImplemented("util.types.isAsyncFunction");
|
|
13
|
+
export const isGeneratorFunction = /* @__PURE__ */ notImplemented("util.types.isGeneratorFunction");
|
|
14
|
+
export const isGeneratorObject = /* @__PURE__ */ notImplemented("util.types.isGeneratorObject");
|
|
15
|
+
export const isPromise = (val) => val instanceof Promise;
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
export const isMap = (val) => val instanceof Map;
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
export const isSet = (val) => val instanceof Set;
|
|
20
|
+
export const isMapIterator = /* @__PURE__ */ notImplemented("util.types.isMapIterator");
|
|
21
|
+
export const isSetIterator = /* @__PURE__ */ notImplemented("util.types.isSetIterator");
|
|
22
|
+
export const isWeakMap = (val) => val instanceof WeakMap;
|
|
23
|
+
export const isWeakSet = (val) => val instanceof WeakSet;
|
|
24
|
+
export const isArrayBuffer = (val) => val instanceof ArrayBuffer;
|
|
25
|
+
export const isDataView = (val) => val instanceof DataView;
|
|
26
|
+
export const isSharedArrayBuffer = (val) => val instanceof SharedArrayBuffer;
|
|
27
|
+
export const isProxy = /* @__PURE__ */ notImplemented("util.types.isProxy");
|
|
28
|
+
export const isModuleNamespaceObject = /* @__PURE__ */ notImplemented("util.types.isModuleNamespaceObject");
|
|
29
|
+
export const isAnyArrayBuffer = /* @__PURE__ */ notImplemented("util.types.isAnyArrayBuffer");
|
|
30
|
+
export const isBoxedPrimitive = /* @__PURE__ */ notImplemented("util.types.isBoxedPrimitive");
|
|
31
|
+
export const isArrayBufferView = /* @__PURE__ */ notImplemented("util.types.isArrayBufferView");
|
|
32
|
+
export const isTypedArray = /* @__PURE__ */ notImplemented("util.types.isTypedArray");
|
|
33
|
+
export const isUint8Array = /* @__PURE__ */ notImplemented("util.types.isUint8Array");
|
|
34
|
+
export const isUint8ClampedArray = /* @__PURE__ */ notImplemented("util.types.isUint8ClampedArray");
|
|
35
|
+
export const isUint16Array = /* @__PURE__ */ notImplemented("util.types.isUint16Array");
|
|
36
|
+
export const isUint32Array = /* @__PURE__ */ notImplemented("util.types.isUint32Array");
|
|
37
|
+
export const isInt8Array = /* @__PURE__ */ notImplemented("util.types.isInt8Array");
|
|
38
|
+
export const isInt16Array = /* @__PURE__ */ notImplemented("util.types.isInt16Array");
|
|
39
|
+
export const isInt32Array = /* @__PURE__ */ notImplemented("util.types.isInt32Array");
|
|
40
|
+
export const isFloat32Array = /* @__PURE__ */ notImplemented("util.types.isFloat32Array");
|
|
41
|
+
export const isFloat64Array = /* @__PURE__ */ notImplemented("util.types.isFloat64Array");
|
|
42
|
+
export const isBigInt64Array = /* @__PURE__ */ notImplemented("util.types.isBigInt64Array");
|
|
43
|
+
export const isBigUint64Array = /* @__PURE__ */ notImplemented("util.types.isBigUint64Array");
|
|
44
|
+
export const isKeyObject = /* @__PURE__ */ notImplemented("util.types.isKeyObject");
|
|
45
|
+
export const isCryptoKey = /* @__PURE__ */ notImplemented("util.types.isCryptoKey");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type nodeV8 from "node:v8";
|
|
2
|
+
export declare class Deserializer implements nodeV8.Deserializer {
|
|
3
|
+
readHeader(): boolean;
|
|
4
|
+
readValue();
|
|
5
|
+
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer);
|
|
6
|
+
getWireFormatVersion(): number;
|
|
7
|
+
readUint32(): number;
|
|
8
|
+
readUint64(): [number, number];
|
|
9
|
+
readDouble(): number;
|
|
10
|
+
readRawBytes(length: number): Buffer;
|
|
11
|
+
}
|
|
12
|
+
export declare class DefaultDeserializer extends Deserializer {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class Deserializer {
|
|
2
|
+
readHeader() {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
readValue() {}
|
|
6
|
+
transferArrayBuffer(id, arrayBuffer) {}
|
|
7
|
+
getWireFormatVersion() {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
readUint32() {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
readUint64() {
|
|
14
|
+
return [0, 0];
|
|
15
|
+
}
|
|
16
|
+
readDouble() {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
readRawBytes(length) {
|
|
20
|
+
return Buffer.from("");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class DefaultDeserializer extends Deserializer {}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type nodeV8 from "node:v8";
|
|
2
|
+
export declare class Serializer implements nodeV8.Serializer {
|
|
3
|
+
writeHeader();
|
|
4
|
+
writeValue(val: any): boolean;
|
|
5
|
+
releaseBuffer(): Buffer;
|
|
6
|
+
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer);
|
|
7
|
+
writeDouble(value: number);
|
|
8
|
+
writeUint32(value: number);
|
|
9
|
+
writeUint64(hi: number, lo: number);
|
|
10
|
+
writeRawBytes(buffer: NodeJS.TypedArray);
|
|
11
|
+
}
|
|
12
|
+
export declare class DefaultSerializer extends Serializer {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class Serializer {
|
|
2
|
+
writeHeader() {}
|
|
3
|
+
writeValue(val) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
releaseBuffer() {
|
|
7
|
+
return Buffer.from("");
|
|
8
|
+
}
|
|
9
|
+
transferArrayBuffer(id, arrayBuffer) {}
|
|
10
|
+
writeDouble(value) {}
|
|
11
|
+
writeUint32(value) {}
|
|
12
|
+
writeUint64(hi, lo) {}
|
|
13
|
+
writeRawBytes(buffer) {}
|
|
14
|
+
}
|
|
15
|
+
export class DefaultSerializer extends Serializer {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type nodeVm from "node:vm";
|
|
2
|
+
export declare class Script implements nodeVm.Script {
|
|
3
|
+
runInContext(contextifiedObject: nodeVm.Context, options?: nodeVm.RunningScriptOptions | undefined);
|
|
4
|
+
runInNewContext(contextObject?: nodeVm.Context | undefined, options?: nodeVm.RunningScriptInNewContextOptions | undefined);
|
|
5
|
+
runInThisContext(options?: nodeVm.RunningScriptOptions | undefined);
|
|
6
|
+
createCachedData(): Buffer;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createNotImplementedError } from "../../../_internal/utils.mjs";
|
|
2
|
+
export class Script {
|
|
3
|
+
runInContext(contextifiedObject, options) {
|
|
4
|
+
throw createNotImplementedError("Script.runInContext");
|
|
5
|
+
}
|
|
6
|
+
runInNewContext(contextObject, options) {
|
|
7
|
+
throw createNotImplementedError("Script.runInNewContext");
|
|
8
|
+
}
|
|
9
|
+
runInThisContext(options) {
|
|
10
|
+
throw createNotImplementedError("Script.runInThisContext");
|
|
11
|
+
}
|
|
12
|
+
createCachedData() {
|
|
13
|
+
throw createNotImplementedError("Script.createCachedData");
|
|
14
|
+
}
|
|
15
|
+
}
|