cf-workers-native 0.0.0-stage → 0.1.2-beta.local.sha2f5e4e6956f4
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/LICENSE +21 -0
- package/Package.swift +25 -0
- package/README.md +92 -2
- package/dist/android.d.ts +2 -0
- package/dist/android.js +1 -0
- package/dist/browser/abort/index.d.ts +13 -0
- package/dist/browser/abort/index.js +66 -0
- package/dist/browser/body/index.d.ts +24 -0
- package/dist/browser/body/index.js +116 -0
- package/dist/browser/body/stream-body.d.ts +13 -0
- package/dist/browser/body/stream-body.js +84 -0
- package/dist/browser/documents/body.d.ts +3 -0
- package/dist/browser/documents/body.js +48 -0
- package/dist/browser/documents/form-body.d.ts +1 -0
- package/dist/browser/documents/form-body.js +54 -0
- package/dist/browser/documents/host.d.ts +11 -0
- package/dist/browser/documents/host.js +256 -0
- package/dist/browser/documents/links-source.d.ts +1 -0
- package/dist/browser/documents/links-source.js +1 -0
- package/dist/browser/documents/links.d.ts +1 -0
- package/dist/browser/documents/links.js +33 -0
- package/dist/browser/documents/page-config.d.ts +5 -0
- package/dist/browser/documents/page-config.js +5 -0
- package/dist/browser/documents/page-source.d.ts +1 -0
- package/dist/browser/documents/page-source.js +1 -0
- package/dist/browser/documents/page.d.ts +2 -0
- package/dist/browser/documents/page.js +153 -0
- package/dist/browser/documents/registration.d.ts +5 -0
- package/dist/browser/documents/registration.js +75 -0
- package/dist/browser/documents/runtime.d.ts +7 -0
- package/dist/browser/documents/runtime.js +161 -0
- package/dist/browser/documents/service-worker.js +285 -0
- package/dist/browser/encoding/index.d.ts +7 -0
- package/dist/browser/encoding/index.js +3 -0
- package/dist/browser/fetch/LICENSE-3RD-PARTY.md +9 -0
- package/dist/browser/fetch/LICENSE-APACHE +177 -0
- package/dist/browser/fetch/host-call.d.ts +3 -0
- package/dist/browser/fetch/host-call.js +67 -0
- package/dist/browser/fetch/index.d.ts +5 -0
- package/dist/browser/fetch/index.js +96 -0
- package/dist/browser/fetch/interop.d.ts +6 -0
- package/dist/browser/fetch/interop.js +48 -0
- package/dist/browser/fetch/native-network.d.ts +20 -0
- package/dist/browser/fetch/native-network.js +233 -0
- package/dist/browser/fetch/outbound.d.ts +2 -0
- package/dist/browser/fetch/outbound.js +11 -0
- package/dist/browser/fetch/relay.d.ts +7 -0
- package/dist/browser/fetch/relay.js +100 -0
- package/dist/browser/fetch/scope.d.ts +8 -0
- package/dist/browser/fetch/scope.js +108 -0
- package/dist/browser/fetch/transport.d.ts +39 -0
- package/dist/browser/fetch/transport.js +136 -0
- package/dist/browser/headers/LICENSE-3RD-PARTY.md +9 -0
- package/dist/browser/headers/LICENSE-APACHE +177 -0
- package/dist/browser/headers/index.d.ts +20 -0
- package/dist/browser/headers/index.js +194 -0
- package/dist/browser/isolated/bridge.d.ts +8 -0
- package/dist/browser/isolated/bridge.js +267 -0
- package/dist/browser/isolated/protocol.d.ts +40 -0
- package/dist/browser/isolated/protocol.js +1 -0
- package/dist/browser/isolated/transport.d.ts +2 -0
- package/dist/browser/isolated/transport.js +157 -0
- package/dist/browser/request/LICENSE-3RD-PARTY.md +10 -0
- package/dist/browser/request/LICENSE-APACHE +177 -0
- package/dist/browser/request/index.d.ts +48 -0
- package/dist/browser/request/index.js +182 -0
- package/dist/browser/response/LICENSE-3RD-PARTY.md +10 -0
- package/dist/browser/response/LICENSE-APACHE +177 -0
- package/dist/browser/response/index.d.ts +43 -0
- package/dist/browser/response/index.js +192 -0
- package/dist/browser/response/status.d.ts +1 -0
- package/dist/browser/response/status.js +75 -0
- package/dist/browser/structured-clone/index.d.ts +1 -0
- package/dist/browser/structured-clone/index.js +479 -0
- package/dist/cloudflare/apis/cloudflare-node/index.d.ts +18 -0
- package/dist/cloudflare/apis/cloudflare-node/index.js +150 -0
- package/dist/cloudflare/apis/cloudflare-workers/index.d.ts +8 -0
- package/dist/cloudflare/apis/cloudflare-workers/index.js +37 -0
- package/dist/cloudflare/apis/types.d.ts +7 -0
- package/dist/cloudflare/apis/types.js +1 -0
- package/dist/cloudflare/bindings/config.d.ts +42 -0
- package/dist/cloudflare/bindings/config.js +280 -0
- package/dist/cloudflare/bindings/kv/contract.d.ts +6 -0
- package/dist/cloudflare/bindings/kv/contract.js +181 -0
- package/dist/cloudflare/bindings/kv/index.d.ts +18 -0
- package/dist/cloudflare/bindings/kv/index.js +61 -0
- package/dist/cloudflare/bindings/kv/storage.d.ts +25 -0
- package/dist/cloudflare/bindings/kv/storage.js +320 -0
- package/dist/cloudflare/bindings/kv/types.d.ts +50 -0
- package/dist/cloudflare/bindings/kv/types.js +1 -0
- package/dist/cloudflare/bindings/remote.d.ts +8 -0
- package/dist/cloudflare/bindings/remote.js +261 -0
- package/dist/cloudflare/workers/contract.d.ts +8 -0
- package/dist/cloudflare/workers/contract.js +65 -0
- package/dist/cloudflare/workers/feature.d.ts +10 -0
- package/dist/cloudflare/workers/feature.js +28 -0
- package/dist/cloudflare/workers/runtime.d.ts +23 -0
- package/dist/cloudflare/workers/runtime.js +121 -0
- package/dist/cloudflare/workers/types.d.ts +49 -0
- package/dist/cloudflare/workers/types.js +1 -0
- package/dist/cloudflare/workers/worker-runtime.d.ts +44 -0
- package/dist/cloudflare/workers/worker-runtime.js +267 -0
- package/dist/compat/assert/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/assert/LICENSE-APACHE +177 -0
- package/dist/compat/assert/assertion-error.d.ts +26 -0
- package/dist/compat/assert/assertion-error.js +468 -0
- package/dist/compat/assert/diff.d.ts +26 -0
- package/dist/compat/assert/diff.js +329 -0
- package/dist/compat/assert/errors.d.ts +11 -0
- package/dist/compat/assert/errors.js +55 -0
- package/dist/compat/assert/index.cjs +24 -0
- package/dist/compat/assert/index.d.cts +43 -0
- package/dist/compat/assert/index.d.ts +50 -0
- package/dist/compat/assert/index.js +858 -0
- package/dist/compat/async-hooks/LICENSE-APACHE +177 -0
- package/dist/compat/async-hooks/NOTICE.md +8 -0
- package/dist/compat/async-hooks/callbacks.d.ts +7 -0
- package/dist/compat/async-hooks/callbacks.js +18 -0
- package/dist/compat/async-hooks/hooks.d.ts +10 -0
- package/dist/compat/async-hooks/hooks.js +111 -0
- package/dist/compat/async-hooks/index.d.ts +41 -0
- package/dist/compat/async-hooks/index.js +298 -0
- package/dist/compat/buffer/LICENSE-3RD-PARTY.md +15 -0
- package/dist/compat/buffer/LICENSE-APACHE +177 -0
- package/dist/compat/buffer/blob.d.ts +22 -0
- package/dist/compat/buffer/blob.js +210 -0
- package/dist/compat/buffer/bytes.d.ts +34 -0
- package/dist/compat/buffer/bytes.js +228 -0
- package/dist/compat/buffer/errors.d.ts +41 -0
- package/dist/compat/buffer/errors.js +265 -0
- package/dist/compat/buffer/index.d.ts +25 -0
- package/dist/compat/buffer/index.js +24 -0
- package/dist/compat/buffer/internal-buffer.d.ts +148 -0
- package/dist/compat/buffer/internal-buffer.js +1809 -0
- package/dist/compat/buffer/support.d.ts +13 -0
- package/dist/compat/buffer/support.js +65 -0
- package/dist/compat/child-process/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/child-process/LICENSE-APACHE +177 -0
- package/dist/compat/child-process/errors.d.ts +4 -0
- package/dist/compat/child-process/errors.js +6 -0
- package/dist/compat/child-process/index.d.ts +49 -0
- package/dist/compat/child-process/index.js +96 -0
- package/dist/compat/cluster/LICENSE-3RD-PARTY.md +40 -0
- package/dist/compat/cluster/LICENSE-APACHE +177 -0
- package/dist/compat/cluster/errors.d.ts +4 -0
- package/dist/compat/cluster/errors.js +6 -0
- package/dist/compat/cluster/index.d.ts +47 -0
- package/dist/compat/cluster/index.js +88 -0
- package/dist/compat/constants/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/constants/LICENSE-APACHE +177 -0
- package/dist/compat/constants/index.d.ts +481 -0
- package/dist/compat/constants/index.js +488 -0
- package/dist/compat/dgram/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/dgram/LICENSE-APACHE +177 -0
- package/dist/compat/dgram/index.d.ts +10 -0
- package/dist/compat/dgram/index.js +132 -0
- package/dist/compat/diagnostics-channel/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/diagnostics-channel/LICENSE-APACHE +177 -0
- package/dist/compat/diagnostics-channel/index.d.ts +73 -0
- package/dist/compat/diagnostics-channel/index.js +261 -0
- package/dist/compat/diagnostics-channel/native.d.ts +26 -0
- package/dist/compat/diagnostics-channel/native.js +154 -0
- package/dist/compat/dns/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/dns/LICENSE-APACHE +177 -0
- package/dist/compat/dns/client.d.ts +72 -0
- package/dist/compat/dns/client.js +161 -0
- package/dist/compat/dns/constants.d.ts +27 -0
- package/dist/compat/dns/constants.js +31 -0
- package/dist/compat/dns/errors.d.ts +8 -0
- package/dist/compat/dns/errors.js +12 -0
- package/dist/compat/dns/index.d.ts +97 -0
- package/dist/compat/dns/index.js +127 -0
- package/dist/compat/dns/parser.d.ts +18 -0
- package/dist/compat/dns/parser.js +144 -0
- package/dist/compat/dns/promise-resolver.d.ts +82 -0
- package/dist/compat/dns/promise-resolver.js +113 -0
- package/dist/compat/dns/promises.d.ts +50 -0
- package/dist/compat/dns/promises.js +53 -0
- package/dist/compat/dns/resolver.d.ts +34 -0
- package/dist/compat/dns/resolver.js +415 -0
- package/dist/compat/domain/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/domain/LICENSE-APACHE +177 -0
- package/dist/compat/domain/index.d.ts +22 -0
- package/dist/compat/domain/index.js +79 -0
- package/dist/compat/fs/index.d.ts +85 -0
- package/dist/compat/fs/index.js +255 -0
- package/dist/compat/fs/promises/index.d.ts +3 -0
- package/dist/compat/fs/promises/index.js +3 -0
- package/dist/compat/http/index.d.ts +322 -0
- package/dist/compat/http/index.js +1356 -0
- package/dist/compat/http/registry.d.ts +19 -0
- package/dist/compat/http/registry.js +13 -0
- package/dist/compat/http-agent/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-agent/LICENSE-APACHE +177 -0
- package/dist/compat/http-agent/index.d.ts +7 -0
- package/dist/compat/http-agent/index.js +10 -0
- package/dist/compat/http-client/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-client/LICENSE-APACHE +177 -0
- package/dist/compat/http-client/index.d.ts +6 -0
- package/dist/compat/http-client/index.js +7 -0
- package/dist/compat/http-incoming/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-incoming/LICENSE-APACHE +177 -0
- package/dist/compat/http-incoming/index.d.ts +6 -0
- package/dist/compat/http-incoming/index.js +9 -0
- package/dist/compat/http2/LICENSE-3RD-PARTY.md +29 -0
- package/dist/compat/http2/LICENSE-APACHE +177 -0
- package/dist/compat/http2/constants.d.ts +255 -0
- package/dist/compat/http2/constants.js +515 -0
- package/dist/compat/http2/errors.d.ts +4 -0
- package/dist/compat/http2/errors.js +6 -0
- package/dist/compat/http2/index.d.ts +283 -0
- package/dist/compat/http2/index.js +68 -0
- package/dist/compat/https/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/https/LICENSE-APACHE +177 -0
- package/dist/compat/https/agent.d.ts +10 -0
- package/dist/compat/https/agent.js +99 -0
- package/dist/compat/https/errors.d.ts +4 -0
- package/dist/compat/https/errors.js +6 -0
- package/dist/compat/https/index.d.ts +20 -0
- package/dist/compat/https/index.js +50 -0
- package/dist/compat/https/server.d.ts +8 -0
- package/dist/compat/https/server.js +27 -0
- package/dist/compat/immediate/index.d.ts +11 -0
- package/dist/compat/immediate/index.js +58 -0
- package/dist/compat/inspector/LICENSE-3RD-PARTY.md +34 -0
- package/dist/compat/inspector/LICENSE-APACHE +177 -0
- package/dist/compat/inspector/errors.d.ts +4 -0
- package/dist/compat/inspector/errors.js +6 -0
- package/dist/compat/inspector/index.d.ts +18 -0
- package/dist/compat/inspector/index.js +117 -0
- package/dist/compat/inspector/promises.d.ts +18 -0
- package/dist/compat/inspector/promises.js +114 -0
- package/dist/compat/module/index.cjs +2 -0
- package/dist/compat/module/index.d.cts +2 -0
- package/dist/compat/module/index.d.ts +11 -0
- package/dist/compat/module/index.js +44 -0
- package/dist/compat/module/resolve-unavailable.d.ts +1 -0
- package/dist/compat/module/resolve-unavailable.js +3 -0
- package/dist/compat/net/LICENSE-3RD-PARTY.md +15 -0
- package/dist/compat/net/LICENSE-APACHE +177 -0
- package/dist/compat/net/error-base.d.ts +14 -0
- package/dist/compat/net/error-base.js +62 -0
- package/dist/compat/net/errors.d.ts +76 -0
- package/dist/compat/net/errors.js +333 -0
- package/dist/compat/net/index.d.ts +23 -0
- package/dist/compat/net/index.js +46 -0
- package/dist/compat/net/internal-net.d.ts +236 -0
- package/dist/compat/net/internal-net.js +2292 -0
- package/dist/compat/net/ports.d.ts +32 -0
- package/dist/compat/net/ports.js +149 -0
- package/dist/compat/net/reader.d.ts +8 -0
- package/dist/compat/net/reader.js +36 -0
- package/dist/compat/net/sockets.d.ts +20 -0
- package/dist/compat/net/sockets.js +195 -0
- package/dist/compat/net/validators.d.ts +18 -0
- package/dist/compat/net/validators.js +154 -0
- package/dist/compat/os/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/os/LICENSE-APACHE +177 -0
- package/dist/compat/os/index.d.ts +329 -0
- package/dist/compat/os/index.js +278 -0
- package/dist/compat/path/LICENSE-3RD-PARTY.md +35 -0
- package/dist/compat/path/LICENSE-APACHE +177 -0
- package/dist/compat/path/index.d.ts +4 -0
- package/dist/compat/path/index.js +11 -0
- package/dist/compat/path/internal-path.d.ts +95 -0
- package/dist/compat/path/internal-path.js +1542 -0
- package/dist/compat/path/posix/index.d.ts +4 -0
- package/dist/compat/path/posix/index.js +5 -0
- package/dist/compat/path/win32/index.d.ts +4 -0
- package/dist/compat/path/win32/index.js +5 -0
- package/dist/compat/perf-hooks/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/perf-hooks/LICENSE-APACHE +177 -0
- package/dist/compat/perf-hooks/index.d.ts +85 -0
- package/dist/compat/perf-hooks/index.js +79 -0
- package/dist/compat/perf-hooks/performance.d.ts +96 -0
- package/dist/compat/perf-hooks/performance.js +445 -0
- package/dist/compat/punycode/LICENSE-3RD-PARTY.md +7 -0
- package/dist/compat/punycode/LICENSE-APACHE +177 -0
- package/dist/compat/punycode/index.d.ts +93 -0
- package/dist/compat/punycode/index.js +410 -0
- package/dist/compat/querystring/LICENSE-3RD-PARTY.md +35 -0
- package/dist/compat/querystring/LICENSE-APACHE +177 -0
- package/dist/compat/querystring/index.d.ts +14 -0
- package/dist/compat/querystring/index.js +18 -0
- package/dist/compat/querystring/internal-querystring.d.ts +22 -0
- package/dist/compat/querystring/internal-querystring.js +498 -0
- package/dist/compat/readline/LICENSE-3RD-PARTY.md +37 -0
- package/dist/compat/readline/LICENSE-APACHE +177 -0
- package/dist/compat/readline/index.d.ts +21 -0
- package/dist/compat/readline/index.js +56 -0
- package/dist/compat/readline/interface.d.ts +22 -0
- package/dist/compat/readline/interface.js +85 -0
- package/dist/compat/readline/internal-promises.d.ts +32 -0
- package/dist/compat/readline/internal-promises.js +104 -0
- package/dist/compat/readline/promises.d.ts +8 -0
- package/dist/compat/readline/promises.js +32 -0
- package/dist/compat/repl/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/repl/LICENSE-APACHE +177 -0
- package/dist/compat/repl/builtin-modules.d.ts +1 -0
- package/dist/compat/repl/builtin-modules.js +101 -0
- package/dist/compat/repl/errors.d.ts +4 -0
- package/dist/compat/repl/errors.js +6 -0
- package/dist/compat/repl/index.d.ts +53 -0
- package/dist/compat/repl/index.js +106 -0
- package/dist/compat/sqlite/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/sqlite/LICENSE-APACHE +177 -0
- package/dist/compat/sqlite/index.d.ts +12 -0
- package/dist/compat/sqlite/index.js +101 -0
- package/dist/compat/sqlite/native.d.ts +16 -0
- package/dist/compat/sqlite/native.js +33 -0
- package/dist/compat/stream/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream/LICENSE-APACHE +177 -0
- package/dist/compat/stream/add-abort-signal.d.ts +4 -0
- package/dist/compat/stream/add-abort-signal.js +73 -0
- package/dist/compat/stream/compose.d.ts +1 -0
- package/dist/compat/stream/compose.js +313 -0
- package/dist/compat/stream/destroy.d.ts +5 -0
- package/dist/compat/stream/destroy.js +315 -0
- package/dist/compat/stream/duplex.d.ts +48 -0
- package/dist/compat/stream/duplex.js +789 -0
- package/dist/compat/stream/end-of-stream.d.ts +16 -0
- package/dist/compat/stream/end-of-stream.js +269 -0
- package/dist/compat/stream/errors.d.ts +40 -0
- package/dist/compat/stream/errors.js +86 -0
- package/dist/compat/stream/events.d.ts +6 -0
- package/dist/compat/stream/events.js +28 -0
- package/dist/compat/stream/index.cjs +27 -0
- package/dist/compat/stream/index.d.cts +25 -0
- package/dist/compat/stream/index.d.ts +20 -0
- package/dist/compat/stream/index.js +55 -0
- package/dist/compat/stream/legacy.d.ts +8 -0
- package/dist/compat/stream/legacy.js +105 -0
- package/dist/compat/stream/once.d.ts +7 -0
- package/dist/compat/stream/once.js +13 -0
- package/dist/compat/stream/pipeline.d.ts +5 -0
- package/dist/compat/stream/pipeline.js +567 -0
- package/dist/compat/stream/process.d.ts +1 -0
- package/dist/compat/stream/process.js +4 -0
- package/dist/compat/stream/promises.d.ts +7 -0
- package/dist/compat/stream/promises.js +60 -0
- package/dist/compat/stream/readable.d.ts +29 -0
- package/dist/compat/stream/readable.js +2267 -0
- package/dist/compat/stream/state.d.ts +8 -0
- package/dist/compat/stream/state.js +63 -0
- package/dist/compat/stream/transform.d.ts +2 -0
- package/dist/compat/stream/transform.js +202 -0
- package/dist/compat/stream/util.d.ts +55 -0
- package/dist/compat/stream/util.js +345 -0
- package/dist/compat/stream/validators.d.ts +2 -0
- package/dist/compat/stream/validators.js +14 -0
- package/dist/compat/stream/writable.d.ts +21 -0
- package/dist/compat/stream/writable.js +1325 -0
- package/dist/compat/stream-consumers/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/stream-consumers/LICENSE-APACHE +177 -0
- package/dist/compat/stream-consumers/index.d.ts +14 -0
- package/dist/compat/stream-consumers/index.js +62 -0
- package/dist/compat/stream-consumers/iterable.d.ts +1 -0
- package/dist/compat/stream-consumers/iterable.js +34 -0
- package/dist/compat/stream-duplex/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-duplex/LICENSE-APACHE +177 -0
- package/dist/compat/stream-duplex/index.cjs +3 -0
- package/dist/compat/stream-duplex/index.d.cts +2 -0
- package/dist/compat/stream-duplex/index.d.ts +3 -0
- package/dist/compat/stream-duplex/index.js +8 -0
- package/dist/compat/stream-passthrough/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-passthrough/LICENSE-APACHE +177 -0
- package/dist/compat/stream-passthrough/index.cjs +3 -0
- package/dist/compat/stream-passthrough/index.d.cts +2 -0
- package/dist/compat/stream-passthrough/index.d.ts +3 -0
- package/dist/compat/stream-passthrough/index.js +8 -0
- package/dist/compat/stream-promises/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-promises/LICENSE-APACHE +177 -0
- package/dist/compat/stream-promises/index.d.ts +1 -0
- package/dist/compat/stream-promises/index.js +1 -0
- package/dist/compat/stream-readable/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-readable/LICENSE-APACHE +177 -0
- package/dist/compat/stream-readable/index.cjs +3 -0
- package/dist/compat/stream-readable/index.d.cts +2 -0
- package/dist/compat/stream-readable/index.d.ts +3 -0
- package/dist/compat/stream-readable/index.js +8 -0
- package/dist/compat/stream-transform/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-transform/LICENSE-APACHE +177 -0
- package/dist/compat/stream-transform/index.cjs +3 -0
- package/dist/compat/stream-transform/index.d.cts +2 -0
- package/dist/compat/stream-transform/index.d.ts +3 -0
- package/dist/compat/stream-transform/index.js +8 -0
- package/dist/compat/stream-web/LICENSE-MIT +22 -0
- package/dist/compat/stream-web/NOTICE.md +3 -0
- package/dist/compat/stream-web/context.d.ts +2 -0
- package/dist/compat/stream-web/context.js +35 -0
- package/dist/compat/stream-web/index.d.ts +80 -0
- package/dist/compat/stream-web/index.js +129 -0
- package/dist/compat/stream-web/interop.d.ts +6 -0
- package/dist/compat/stream-web/interop.js +72 -0
- package/dist/compat/stream-web/ponyfill.d.ts +1 -0
- package/dist/compat/stream-web/ponyfill.js +2093 -0
- package/dist/compat/stream-web/runtime.d.ts +16 -0
- package/dist/compat/stream-web/runtime.js +51 -0
- package/dist/compat/stream-writable/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-writable/LICENSE-APACHE +177 -0
- package/dist/compat/stream-writable/index.cjs +3 -0
- package/dist/compat/stream-writable/index.d.cts +2 -0
- package/dist/compat/stream-writable/index.d.ts +3 -0
- package/dist/compat/stream-writable/index.js +8 -0
- package/dist/compat/string-decoder/LICENSE-3RD-PARTY.md +38 -0
- package/dist/compat/string-decoder/LICENSE-APACHE +177 -0
- package/dist/compat/string-decoder/index.d.ts +33 -0
- package/dist/compat/string-decoder/index.js +518 -0
- package/dist/compat/test/LICENSE-3RD-PARTY.md +37 -0
- package/dist/compat/test/LICENSE-APACHE +177 -0
- package/dist/compat/test/index.d.ts +9 -0
- package/dist/compat/test/index.js +11 -0
- package/dist/compat/test/mock.d.ts +103 -0
- package/dist/compat/test/mock.js +397 -0
- package/dist/compat/test/validators.d.ts +2 -0
- package/dist/compat/test/validators.js +14 -0
- package/dist/compat/timers/LICENSE-3RD-PARTY.md +7 -0
- package/dist/compat/timers/LICENSE-APACHE +177 -0
- package/dist/compat/timers/errors.d.ts +28 -0
- package/dist/compat/timers/errors.js +206 -0
- package/dist/compat/timers/host.d.ts +11 -0
- package/dist/compat/timers/host.js +60 -0
- package/dist/compat/timers/index.cjs +3 -0
- package/dist/compat/timers/index.d.cts +23 -0
- package/dist/compat/timers/index.d.ts +36 -0
- package/dist/compat/timers/index.js +20 -0
- package/dist/compat/timers/installation.d.ts +4 -0
- package/dist/compat/timers/installation.js +61 -0
- package/dist/compat/timers/internal-promises.d.ts +19 -0
- package/dist/compat/timers/internal-promises.js +173 -0
- package/dist/compat/timers/promises.cjs +2 -0
- package/dist/compat/timers/promises.d.cts +12 -0
- package/dist/compat/timers/promises.d.ts +14 -0
- package/dist/compat/timers/promises.js +3 -0
- package/dist/compat/timers/timers.d.ts +32 -0
- package/dist/compat/timers/timers.js +147 -0
- package/dist/compat/timers/validation.d.ts +5 -0
- package/dist/compat/timers/validation.js +22 -0
- package/dist/compat/timers/wait.d.ts +4 -0
- package/dist/compat/timers/wait.js +91 -0
- package/dist/compat/tls-common/LICENSE-3RD-PARTY.md +11 -0
- package/dist/compat/tls-common/LICENSE-APACHE +177 -0
- package/dist/compat/tls-common/index.d.ts +14 -0
- package/dist/compat/tls-common/index.js +88 -0
- package/dist/compat/trace-events/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/trace-events/LICENSE-APACHE +177 -0
- package/dist/compat/trace-events/index.d.ts +18 -0
- package/dist/compat/trace-events/index.js +88 -0
- package/dist/compat/tty/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/tty/LICENSE-APACHE +177 -0
- package/dist/compat/tty/index.d.ts +17 -0
- package/dist/compat/tty/index.js +101 -0
- package/dist/compat/url/LICENSE-3RD-PARTY.md +63 -0
- package/dist/compat/url/LICENSE-ADA +18 -0
- package/dist/compat/url/LICENSE-APACHE +177 -0
- package/dist/compat/url/LICENSE-UNICODE +39 -0
- package/dist/compat/url/LICENSE-WHATWG-URL +21 -0
- package/dist/compat/url/brand.d.ts +4 -0
- package/dist/compat/url/brand.js +10 -0
- package/dist/compat/url/constants.d.ts +27 -0
- package/dist/compat/url/constants.js +28 -0
- package/dist/compat/url/errors.d.ts +44 -0
- package/dist/compat/url/errors.js +248 -0
- package/dist/compat/url/idna-data.d.ts +3958 -0
- package/dist/compat/url/idna-data.js +22 -0
- package/dist/compat/url/idna.d.ts +9 -0
- package/dist/compat/url/idna.js +47 -0
- package/dist/compat/url/index.d.ts +48 -0
- package/dist/compat/url/index.js +39 -0
- package/dist/compat/url/installation.d.ts +4 -0
- package/dist/compat/url/installation.js +61 -0
- package/dist/compat/url/internal-url.d.ts +34 -0
- package/dist/compat/url/internal-url.js +264 -0
- package/dist/compat/url/legacy-url.d.ts +28 -0
- package/dist/compat/url/legacy-url.js +870 -0
- package/dist/compat/url/parser-platform.d.ts +3 -0
- package/dist/compat/url/parser-platform.js +26 -0
- package/dist/compat/url/standard-url.d.ts +2 -0
- package/dist/compat/url/standard-url.js +3189 -0
- package/dist/compat/url/unicode.d.ts +2 -0
- package/dist/compat/url/unicode.js +119 -0
- package/dist/compat/url/validation.d.ts +2 -0
- package/dist/compat/url/validation.js +9 -0
- package/dist/compat/url/web-url.d.ts +27 -0
- package/dist/compat/url/web-url.js +119 -0
- package/dist/compat/util/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/util/LICENSE-APACHE +177 -0
- package/dist/compat/util/additional.d.ts +11 -0
- package/dist/compat/util/additional.js +121 -0
- package/dist/compat/util/comparison-types.d.ts +16 -0
- package/dist/compat/util/comparison-types.js +50 -0
- package/dist/compat/util/comparisons.d.ts +1 -0
- package/dist/compat/util/comparisons.js +527 -0
- package/dist/compat/util/core.d.ts +18 -0
- package/dist/compat/util/core.js +265 -0
- package/dist/compat/util/debuglog.d.ts +1 -0
- package/dist/compat/util/debuglog.js +78 -0
- package/dist/compat/util/index.d.ts +35 -0
- package/dist/compat/util/index.js +77 -0
- package/dist/compat/util/inspect-binding.d.ts +13 -0
- package/dist/compat/util/inspect-binding.js +39 -0
- package/dist/compat/util/inspect-types.d.ts +13 -0
- package/dist/compat/util/inspect-types.js +30 -0
- package/dist/compat/util/inspect.d.ts +152 -0
- package/dist/compat/util/inspect.js +2503 -0
- package/dist/compat/util/mime.d.ts +24 -0
- package/dist/compat/util/mime.js +284 -0
- package/dist/compat/util/properties.d.ts +9 -0
- package/dist/compat/util/properties.js +76 -0
- package/dist/compat/v8/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/v8/LICENSE-APACHE +177 -0
- package/dist/compat/v8/errors.d.ts +5 -0
- package/dist/compat/v8/errors.js +7 -0
- package/dist/compat/v8/index.d.ts +106 -0
- package/dist/compat/v8/index.js +280 -0
- package/dist/compat/vm/LICENSE-3RD-PARTY.md +39 -0
- package/dist/compat/vm/LICENSE-APACHE +177 -0
- package/dist/compat/vm/errors.d.ts +5 -0
- package/dist/compat/vm/errors.js +7 -0
- package/dist/compat/vm/index.d.ts +47 -0
- package/dist/compat/vm/index.js +231 -0
- package/dist/compat/vm/validation.d.ts +3 -0
- package/dist/compat/vm/validation.js +14 -0
- package/dist/compat/wasi/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/wasi/LICENSE-APACHE +177 -0
- package/dist/compat/wasi/errors.d.ts +4 -0
- package/dist/compat/wasi/errors.js +6 -0
- package/dist/compat/wasi/index.d.ts +15 -0
- package/dist/compat/wasi/index.js +44 -0
- package/dist/compat/worker-threads/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/worker-threads/LICENSE-APACHE +177 -0
- package/dist/compat/worker-threads/errors.d.ts +4 -0
- package/dist/compat/worker-threads/errors.js +6 -0
- package/dist/compat/worker-threads/index.d.ts +71 -0
- package/dist/compat/worker-threads/index.js +138 -0
- package/dist/compat/worker-threads/message-channel.d.ts +18 -0
- package/dist/compat/worker-threads/message-channel.js +157 -0
- package/dist/configured.d.ts +3 -0
- package/dist/configured.js +4 -0
- package/dist/environment.d.ts +4 -0
- package/dist/environment.js +18 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +107 -0
- package/dist/ios.d.ts +2 -0
- package/dist/ios.js +1 -0
- package/dist/native-entry.d.ts +8 -0
- package/dist/native-entry.js +67 -0
- package/dist/shared/brotli/LICENSE-APACHE +201 -0
- package/dist/shared/brotli/LICENSE-MIT +9 -0
- package/dist/shared/brotli/NOTICE +3 -0
- package/dist/shared/brotli/index.d.ts +2 -0
- package/dist/shared/brotli/index.js +288 -0
- package/dist/shared/contracts/index.d.ts +42 -0
- package/dist/shared/contracts/index.js +88 -0
- package/dist/shared/contracts/testing.d.ts +22 -0
- package/dist/shared/contracts/testing.js +57 -0
- package/dist/shared/globals/index.d.ts +3 -0
- package/dist/shared/globals/index.js +87 -0
- package/dist/shared/globals/inject.d.ts +2 -0
- package/dist/shared/globals/inject.js +3 -0
- package/dist/shared/globals/install.d.ts +1 -0
- package/dist/shared/globals/install.js +15 -0
- package/dist/shared/globals/node-install.d.ts +1 -0
- package/dist/shared/globals/node-install.js +4 -0
- package/dist/shared/globals/platform.d.ts +104 -0
- package/dist/shared/globals/platform.js +37 -0
- package/dist/shared/globals/runtime.d.ts +6 -0
- package/dist/shared/globals/runtime.js +8 -0
- package/dist/shared/globals/symbols.d.ts +4 -0
- package/dist/shared/globals/symbols.js +35 -0
- package/dist/shared/globals/web.d.ts +4 -0
- package/dist/shared/globals/web.js +108 -0
- package/dist/shared/http-wire/LICENSE.llhttp +22 -0
- package/dist/shared/http-wire/LICENSE.undici +21 -0
- package/dist/shared/http-wire/NOTICE.md +14 -0
- package/dist/shared/http-wire/index.d.ts +27 -0
- package/dist/shared/http-wire/index.js +132 -0
- package/dist/shared/http-wire/wasm.d.ts +2 -0
- package/dist/shared/http-wire/wasm.js +2 -0
- package/dist/tooling/async.d.ts +7 -0
- package/dist/tooling/async.js +99 -0
- package/dist/tooling/build-isolation.d.ts +4 -0
- package/dist/tooling/build-isolation.js +34 -0
- package/dist/tooling/documents.d.ts +7 -0
- package/dist/tooling/documents.js +26 -0
- package/dist/tooling/esbuild.d.ts +15 -0
- package/dist/tooling/esbuild.js +193 -0
- package/dist/tooling/files.d.ts +2 -0
- package/dist/tooling/files.js +18 -0
- package/dist/tooling/opennext/build.d.ts +1 -0
- package/dist/tooling/opennext/build.js +121 -0
- package/dist/tooling/opennext/index.d.ts +3 -0
- package/dist/tooling/opennext/index.js +213 -0
- package/dist/tooling/opennext/plan.d.ts +9 -0
- package/dist/tooling/opennext/plan.js +36 -0
- package/dist/tooling/opennext/safety.d.ts +4 -0
- package/dist/tooling/opennext/safety.js +36 -0
- package/dist/tooling/route-permissions.d.ts +3 -0
- package/dist/tooling/route-permissions.js +15 -0
- package/dist/tooling/server-modules.d.ts +30 -0
- package/dist/tooling/server-modules.js +98 -0
- package/dist/tooling/server-only-html.d.ts +1 -0
- package/dist/tooling/server-only-html.js +66 -0
- package/dist/tooling/server-only.d.ts +6 -0
- package/dist/tooling/server-only.js +53 -0
- package/dist/tooling/server.d.ts +25 -0
- package/dist/tooling/server.js +981 -0
- package/dist/tooling/shared.d.ts +13 -0
- package/dist/tooling/shared.js +130 -0
- package/dist/tooling/vite.d.ts +18 -0
- package/dist/tooling/vite.js +448 -0
- package/dist/tooling/void/index.d.ts +3 -0
- package/dist/tooling/void/index.js +205 -0
- package/dist/tooling/void/plan.d.ts +17 -0
- package/dist/tooling/void/plan.js +288 -0
- package/native/android/build.gradle +68 -0
- package/native/android/consumer-rules.pro +2 -0
- package/native/android/src/main/AndroidManifest.xml +6 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkerSockets.java +202 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersCapacitorPlugin.java +256 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNative.java +22 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeActivity.java +178 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeBridge.java +45 -0
- package/native/ios/DocumentBridge.swift +330 -0
- package/native/ios/NetworkBridge.swift +51 -0
- package/native/ios/SocketBridge.swift +180 -0
- package/native/ios/WorkersCapacitorPlugin.swift +152 -0
- package/native/ios-host/WorkersView.swift +194 -0
- package/package.json +154 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface FetchHandler {
|
|
2
|
+
fetch: (request: Request, env?: unknown, ctx?: unknown) => Promise<Response>;
|
|
3
|
+
}
|
|
4
|
+
export interface InboundSocket {
|
|
5
|
+
opened: Promise<{
|
|
6
|
+
remoteAddress?: string | null;
|
|
7
|
+
localAddress?: string | null;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export interface ConnectHandler {
|
|
11
|
+
connect: (socket: InboundSocket, env?: unknown, ctx?: unknown) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export type PortHandler = import("../http/registry.js").LogicalPortHandler;
|
|
14
|
+
export declare const HOST_ADDRESS = "240.1.0.1";
|
|
15
|
+
export declare const GATEWAY_ADDRESS = "240.1.255.254";
|
|
16
|
+
export declare class PortTable {
|
|
17
|
+
#private;
|
|
18
|
+
ephemeral(): number;
|
|
19
|
+
isBound(port: number): boolean;
|
|
20
|
+
declare(port: number): void;
|
|
21
|
+
hasDeclared(): boolean;
|
|
22
|
+
isDeclared(port: number): boolean;
|
|
23
|
+
unclaimedDeclared(): number;
|
|
24
|
+
tryBind(port: number, reusePort?: boolean): boolean;
|
|
25
|
+
release(port: number): void;
|
|
26
|
+
register(owner: object, port: number): void;
|
|
27
|
+
unregister(owner: object): void;
|
|
28
|
+
setHandler(port: number, handler: PortHandler): void;
|
|
29
|
+
clearHandler(port: number, handler: PortHandler): void;
|
|
30
|
+
getHandler(port: number): PortHandler | undefined;
|
|
31
|
+
}
|
|
32
|
+
export declare const tcpPorts: PortTable;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Copyright (c) 2026 Cloudflare, Inc.
|
|
2
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
3
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4
|
+
const EPHEMERAL_PORT_MIN = 49152;
|
|
5
|
+
const EPHEMERAL_PORT_MAX = 65535;
|
|
6
|
+
// Synthetic addresses from 240.1.0.0/16, a reserved block that is never routed
|
|
7
|
+
// (Hyperdrive's synthetic hosts use 240.0.0.0/16). The isolate has a host
|
|
8
|
+
// address so that a connected or accepted socket never reports the unspecified
|
|
9
|
+
// address as its own, and peers the platform does not identify appear behind a
|
|
10
|
+
// single gateway address with distinct ports, as they would behind a NAT.
|
|
11
|
+
export const HOST_ADDRESS = "240.1.0.1";
|
|
12
|
+
export const GATEWAY_ADDRESS = "240.1.255.254";
|
|
13
|
+
// Virtual local port table for one protocol. The underlying transport does not
|
|
14
|
+
// honor local binding, but explicitly bound ports are recorded and
|
|
15
|
+
// conflict-checked so that they are unique within the isolate, and an entry may
|
|
16
|
+
// carry the handlers that inbound sockets on that port are routed to.
|
|
17
|
+
export class PortTable {
|
|
18
|
+
#entries = new Map();
|
|
19
|
+
#nextEphemeral = EPHEMERAL_PORT_MIN;
|
|
20
|
+
// Backstop for socket owners that are never closed: a request's IoContext
|
|
21
|
+
// teardown runs no JS, so a socket it strands would otherwise hold its entry
|
|
22
|
+
// for the isolate's lifetime. Deterministic release by the owner remains
|
|
23
|
+
// primary. Listening servers are not registered; their entry is meant to
|
|
24
|
+
// outlive any reference to them.
|
|
25
|
+
// FinalizationRegistry is absent on compat dates before enable_weak_ref.
|
|
26
|
+
#registry;
|
|
27
|
+
// Next ephemeral port that is not recorded. This is a label, not a
|
|
28
|
+
// reservation: autobound sockets whose request ends before they are destroyed
|
|
29
|
+
// never run cleanup, so recording them would leak entries. Returns 0 when the
|
|
30
|
+
// range is exhausted.
|
|
31
|
+
ephemeral() {
|
|
32
|
+
for (let i = EPHEMERAL_PORT_MIN; i <= EPHEMERAL_PORT_MAX; i++) {
|
|
33
|
+
const candidate = this.#nextEphemeral;
|
|
34
|
+
this.#nextEphemeral =
|
|
35
|
+
candidate === EPHEMERAL_PORT_MAX ? EPHEMERAL_PORT_MIN : candidate + 1;
|
|
36
|
+
if (!this.#entries.has(candidate))
|
|
37
|
+
return candidate;
|
|
38
|
+
}
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
// Marks port as one the platform delivers inbound connections on.
|
|
42
|
+
isBound(port) {
|
|
43
|
+
return (this.#entries.get(port)?.refs ?? 0) > 0;
|
|
44
|
+
}
|
|
45
|
+
declare(port) {
|
|
46
|
+
if (!this.#entries.has(port)) {
|
|
47
|
+
this.#entries.set(port, {
|
|
48
|
+
refs: 0,
|
|
49
|
+
reusePort: false,
|
|
50
|
+
declared: true,
|
|
51
|
+
handlers: [],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
hasDeclared() {
|
|
56
|
+
for (const entry of this.#entries.values()) {
|
|
57
|
+
if (entry.declared)
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
isDeclared(port) {
|
|
63
|
+
return this.#entries.get(port)?.declared ?? false;
|
|
64
|
+
}
|
|
65
|
+
// The first declared port with no binder, or 0.
|
|
66
|
+
unclaimedDeclared() {
|
|
67
|
+
for (const [port, entry] of this.#entries) {
|
|
68
|
+
if (entry.declared && entry.refs === 0)
|
|
69
|
+
return port;
|
|
70
|
+
}
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
// Records port, or shares it when both the holder and this binder set
|
|
74
|
+
// reusePort. An unclaimed declared port is claimable. Returns false on
|
|
75
|
+
// conflict.
|
|
76
|
+
tryBind(port, reusePort = false) {
|
|
77
|
+
const entry = this.#entries.get(port);
|
|
78
|
+
if (entry === undefined) {
|
|
79
|
+
this.#entries.set(port, {
|
|
80
|
+
refs: 1,
|
|
81
|
+
reusePort,
|
|
82
|
+
declared: false,
|
|
83
|
+
handlers: [],
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else if (entry.refs === 0) {
|
|
87
|
+
entry.refs = 1;
|
|
88
|
+
entry.reusePort = reusePort;
|
|
89
|
+
}
|
|
90
|
+
else if (entry.reusePort && reusePort) {
|
|
91
|
+
entry.refs++;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
release(port) {
|
|
99
|
+
const entry = this.#entries.get(port);
|
|
100
|
+
if (entry !== undefined && --entry.refs === 0) {
|
|
101
|
+
if (entry.declared) {
|
|
102
|
+
entry.handlers = [];
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.#entries.delete(port);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Releases port when owner is collected without having released it. An owner
|
|
110
|
+
// must unregister before releasing so the entry is never decremented twice.
|
|
111
|
+
register(owner, port) {
|
|
112
|
+
if (this.#registry === undefined) {
|
|
113
|
+
if (typeof FinalizationRegistry !== "function")
|
|
114
|
+
return;
|
|
115
|
+
this.#registry = new FinalizationRegistry((p) => {
|
|
116
|
+
this.release(p);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
this.#registry.register(owner, port, owner);
|
|
120
|
+
}
|
|
121
|
+
unregister(owner) {
|
|
122
|
+
this.#registry?.unregister(owner);
|
|
123
|
+
}
|
|
124
|
+
setHandler(port, handler) {
|
|
125
|
+
this.#entries.get(port)?.handlers.push(handler);
|
|
126
|
+
}
|
|
127
|
+
clearHandler(port, handler) {
|
|
128
|
+
const entry = this.#entries.get(port);
|
|
129
|
+
if (entry === undefined)
|
|
130
|
+
return;
|
|
131
|
+
const i = entry.handlers.indexOf(handler);
|
|
132
|
+
if (i !== -1)
|
|
133
|
+
entry.handlers.splice(i, 1);
|
|
134
|
+
}
|
|
135
|
+
getHandler(port) {
|
|
136
|
+
const entry = this.#entries.get(port);
|
|
137
|
+
if (entry === undefined || entry.handlers.length === 0)
|
|
138
|
+
return undefined;
|
|
139
|
+
const handler = entry.handlers.shift();
|
|
140
|
+
entry.handlers.push(handler);
|
|
141
|
+
return handler;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// The isolate is the port namespace: it is the one unit that shares module
|
|
145
|
+
// state, and the platform routes between isolates before a port is consulted,
|
|
146
|
+
// so every request and every Durable Object instance in it sees one table, as
|
|
147
|
+
// processes on one host do. It is seeded with the ports the platform delivers
|
|
148
|
+
// inbound connections on.
|
|
149
|
+
export const tcpPorts = new PortTable();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function observeConsumption(stream: ReadableStream<Uint8Array>, callback: (count: number) => void): void;
|
|
2
|
+
/** Bounded adapter for engines (including WKWebView) without byte streams. */
|
|
3
|
+
export declare function socketReader(stream: ReadableStream<Uint8Array>): {
|
|
4
|
+
readonly closed: Promise<void>;
|
|
5
|
+
cancel(reason?: unknown): Promise<void>;
|
|
6
|
+
releaseLock(): void;
|
|
7
|
+
read(view: Uint8Array<ArrayBuffer>): Promise<ReadableStreamReadResult<Uint8Array<ArrayBuffer>>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const consumed = new WeakMap();
|
|
2
|
+
export function observeConsumption(stream, callback) {
|
|
3
|
+
consumed.set(stream, callback);
|
|
4
|
+
}
|
|
5
|
+
/** Bounded adapter for engines (including WKWebView) without byte streams. */
|
|
6
|
+
export function socketReader(stream) {
|
|
7
|
+
const reader = stream.getReader();
|
|
8
|
+
let remainder;
|
|
9
|
+
return {
|
|
10
|
+
get closed() {
|
|
11
|
+
return reader.closed;
|
|
12
|
+
},
|
|
13
|
+
cancel(reason) {
|
|
14
|
+
remainder = undefined;
|
|
15
|
+
return reader.cancel(reason);
|
|
16
|
+
},
|
|
17
|
+
releaseLock() {
|
|
18
|
+
reader.releaseLock();
|
|
19
|
+
},
|
|
20
|
+
async read(view) {
|
|
21
|
+
// Match BYOB ownership even on WebViews without byte streams.
|
|
22
|
+
const transferred = structuredClone(view, { transfer: [view.buffer] });
|
|
23
|
+
while (!remainder?.byteLength) {
|
|
24
|
+
const next = await reader.read();
|
|
25
|
+
if (next.done)
|
|
26
|
+
return { done: true, value: undefined };
|
|
27
|
+
remainder = next.value;
|
|
28
|
+
}
|
|
29
|
+
const count = Math.min(transferred.byteLength, remainder.byteLength);
|
|
30
|
+
transferred.set(remainder.subarray(0, count));
|
|
31
|
+
remainder = remainder.subarray(count);
|
|
32
|
+
consumed.get(stream)?.(count);
|
|
33
|
+
return { done: false, value: transferred.subarray(0, count) };
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SocketInfo {
|
|
2
|
+
localAddress?: string | null;
|
|
3
|
+
remoteAddress?: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface PlatformSocket {
|
|
6
|
+
upgraded?: boolean;
|
|
7
|
+
opened: Promise<SocketInfo>;
|
|
8
|
+
closed: Promise<void>;
|
|
9
|
+
readable: ReadableStream<Uint8Array>;
|
|
10
|
+
writable: WritableStream<Uint8Array>;
|
|
11
|
+
close(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare function connect(address: string, options?: {
|
|
14
|
+
allowHalfOpen?: boolean;
|
|
15
|
+
secureTransport?: "on" | "off" | "starttls";
|
|
16
|
+
}): PlatformSocket;
|
|
17
|
+
declare const _default: {
|
|
18
|
+
connect: typeof connect;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { observeConsumption } from "./reader.js";
|
|
2
|
+
import { getNativeCall } from "../../browser/fetch/native-network.js";
|
|
3
|
+
function bytes(value) {
|
|
4
|
+
const decoded = atob(value);
|
|
5
|
+
return Uint8Array.from(decoded, (character) => character.charCodeAt(0));
|
|
6
|
+
}
|
|
7
|
+
function encoded(value) {
|
|
8
|
+
let result = "";
|
|
9
|
+
for (let offset = 0; offset < value.length; offset += 8192)
|
|
10
|
+
result += String.fromCharCode(...value.subarray(offset, offset + 8192));
|
|
11
|
+
return btoa(result);
|
|
12
|
+
}
|
|
13
|
+
export function connect(address, options = {}) {
|
|
14
|
+
const call = getNativeCall();
|
|
15
|
+
if (!call)
|
|
16
|
+
throw new Error("TCP sockets require the Capacitor native transport");
|
|
17
|
+
const separator = address.lastIndexOf(":");
|
|
18
|
+
const hostname = address.slice(0, separator).replace(/^\[|\]$/g, "");
|
|
19
|
+
const portText = address.slice(separator + 1);
|
|
20
|
+
if (separator < 1 || !/^\d+$/.test(portText))
|
|
21
|
+
throw new TypeError("Invalid TCP address");
|
|
22
|
+
const url = new URL(`tcp://${hostname.includes(":") ? `[${hostname}]` : hostname}:${portText}`);
|
|
23
|
+
const port = Number(url.port);
|
|
24
|
+
if (!url.hostname ||
|
|
25
|
+
!port ||
|
|
26
|
+
url.username ||
|
|
27
|
+
url.password ||
|
|
28
|
+
(url.pathname && url.pathname !== "/"))
|
|
29
|
+
throw new TypeError("Invalid TCP address");
|
|
30
|
+
const id = crypto.randomUUID();
|
|
31
|
+
let readableController;
|
|
32
|
+
let writableController;
|
|
33
|
+
let readEnded = false, writeEnded = false, stopped = false;
|
|
34
|
+
let resolveClosed, rejectClosed;
|
|
35
|
+
const closed = new Promise((resolve, reject) => {
|
|
36
|
+
resolveClosed = resolve;
|
|
37
|
+
rejectClosed = reject;
|
|
38
|
+
});
|
|
39
|
+
void closed.catch(() => { });
|
|
40
|
+
let terminal = false, readPending = false, pendingBytes = 0;
|
|
41
|
+
const notifyTerminal = () => {
|
|
42
|
+
if (!terminal || stopped || readPending || pendingBytes !== 0)
|
|
43
|
+
return;
|
|
44
|
+
if (!readEnded) {
|
|
45
|
+
readEnded = true;
|
|
46
|
+
readableController.close();
|
|
47
|
+
}
|
|
48
|
+
resolveClosed();
|
|
49
|
+
};
|
|
50
|
+
let closing;
|
|
51
|
+
const close = () => {
|
|
52
|
+
if (!closing) {
|
|
53
|
+
stopped = true;
|
|
54
|
+
closing = call("WorkersCapacitor", "socketClose", { id }).then(() => {
|
|
55
|
+
if (!readEnded) {
|
|
56
|
+
readEnded = true;
|
|
57
|
+
readableController.error(new Error("Socket closed"));
|
|
58
|
+
}
|
|
59
|
+
if (!writeEnded) {
|
|
60
|
+
writeEnded = true;
|
|
61
|
+
writableController.error(new Error("Socket closed"));
|
|
62
|
+
}
|
|
63
|
+
resolveClosed();
|
|
64
|
+
}, (error) => {
|
|
65
|
+
rejectClosed(error);
|
|
66
|
+
throw error;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return closing;
|
|
70
|
+
};
|
|
71
|
+
const fail = (error) => {
|
|
72
|
+
if (!stopped) {
|
|
73
|
+
readableController.error(error);
|
|
74
|
+
writableController.error(error);
|
|
75
|
+
rejectClosed(error);
|
|
76
|
+
void close().catch(() => { });
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const finish = async () => {
|
|
80
|
+
if (readEnded && writeEnded)
|
|
81
|
+
await close();
|
|
82
|
+
};
|
|
83
|
+
const opened = Promise.resolve()
|
|
84
|
+
.then(() => {
|
|
85
|
+
if (stopped)
|
|
86
|
+
throw new Error("Socket closed before connection");
|
|
87
|
+
return call("WorkersCapacitor", "socketOpen", {
|
|
88
|
+
id,
|
|
89
|
+
host: url.hostname.replace(/^\[|\]$/g, ""),
|
|
90
|
+
port,
|
|
91
|
+
tls: options.secureTransport === "on",
|
|
92
|
+
});
|
|
93
|
+
})
|
|
94
|
+
.then(async (value) => {
|
|
95
|
+
if (stopped) {
|
|
96
|
+
await call("WorkersCapacitor", "socketClose", { id });
|
|
97
|
+
throw new Error("Socket closed before connection");
|
|
98
|
+
}
|
|
99
|
+
return value;
|
|
100
|
+
});
|
|
101
|
+
void opened
|
|
102
|
+
.then(async () => {
|
|
103
|
+
if (stopped)
|
|
104
|
+
return;
|
|
105
|
+
await call("WorkersCapacitor", "socketWatch", { id });
|
|
106
|
+
terminal = true;
|
|
107
|
+
notifyTerminal();
|
|
108
|
+
})
|
|
109
|
+
.catch(fail);
|
|
110
|
+
const readable = new ReadableStream({
|
|
111
|
+
start(controller) {
|
|
112
|
+
readableController =
|
|
113
|
+
controller;
|
|
114
|
+
},
|
|
115
|
+
async pull(genericController) {
|
|
116
|
+
const controller = genericController;
|
|
117
|
+
try {
|
|
118
|
+
await opened;
|
|
119
|
+
readPending = true;
|
|
120
|
+
const result = (await call("WorkersCapacitor", "socketRead", {
|
|
121
|
+
id,
|
|
122
|
+
maxBytes: 65536,
|
|
123
|
+
}));
|
|
124
|
+
if (stopped)
|
|
125
|
+
return;
|
|
126
|
+
if (result.eof) {
|
|
127
|
+
if (!readEnded) {
|
|
128
|
+
readEnded = true;
|
|
129
|
+
controller.close();
|
|
130
|
+
}
|
|
131
|
+
await finish();
|
|
132
|
+
}
|
|
133
|
+
else if (typeof result.chunk === "string") {
|
|
134
|
+
const chunk = bytes(result.chunk);
|
|
135
|
+
pendingBytes += chunk.byteLength;
|
|
136
|
+
controller.enqueue(chunk);
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
throw new Error("Invalid native socket read result");
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
fail(error);
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
readPending = false;
|
|
146
|
+
notifyTerminal();
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
cancel() {
|
|
150
|
+
readEnded = true;
|
|
151
|
+
return close();
|
|
152
|
+
},
|
|
153
|
+
}, { highWaterMark: 0 });
|
|
154
|
+
const writable = new WritableStream({
|
|
155
|
+
start(controller) {
|
|
156
|
+
writableController = controller;
|
|
157
|
+
},
|
|
158
|
+
async write(chunk) {
|
|
159
|
+
try {
|
|
160
|
+
await opened;
|
|
161
|
+
for (let offset = 0; offset < chunk.byteLength; offset += 65536)
|
|
162
|
+
await call("WorkersCapacitor", "socketWrite", {
|
|
163
|
+
id,
|
|
164
|
+
chunk: encoded(chunk.subarray(offset, offset + 65536)),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
fail(error);
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
async close() {
|
|
173
|
+
try {
|
|
174
|
+
await opened;
|
|
175
|
+
await call("WorkersCapacitor", "socketEnd", { id });
|
|
176
|
+
writeEnded = true;
|
|
177
|
+
await finish();
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
fail(error);
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
abort() {
|
|
185
|
+
writeEnded = true;
|
|
186
|
+
return close();
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
observeConsumption(readable, (count) => {
|
|
190
|
+
pendingBytes -= count;
|
|
191
|
+
notifyTerminal();
|
|
192
|
+
});
|
|
193
|
+
return { opened, closed, readable, writable, close };
|
|
194
|
+
}
|
|
195
|
+
export default { connect };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function isInt32(value: unknown): value is number;
|
|
2
|
+
export declare function isUint32(value: unknown): value is number;
|
|
3
|
+
export declare function validateObject<T extends object>(value: T | null | undefined, name: string, options?: number): asserts value is T;
|
|
4
|
+
export declare function validateObject(value: unknown, name: string, options?: number): asserts value is Record<string, unknown>;
|
|
5
|
+
export declare function validateInt32(value: unknown, name: string, min?: number, max?: number): asserts value is number;
|
|
6
|
+
export declare function validateUint32(value: unknown, name: string, positive?: boolean): asserts value is number;
|
|
7
|
+
export declare function validateString(value: unknown, name: string): asserts value is string;
|
|
8
|
+
export declare function validateNumber(value: unknown, name: string, min?: number, max?: number): asserts value is number;
|
|
9
|
+
export declare function validateBoolean(value: unknown, name: string): asserts value is boolean;
|
|
10
|
+
export declare function validateOneOf<T>(value: T, name: string, oneOf: T[]): asserts value is T;
|
|
11
|
+
export declare function validateAbortSignal(signal: unknown, name: string): asserts signal is AbortSignal;
|
|
12
|
+
export declare function validateFunction(value: unknown, name: string): asserts value is (...args: unknown[]) => unknown;
|
|
13
|
+
export declare function validateArray(value: unknown, name: string, minLength?: number): asserts value is unknown[];
|
|
14
|
+
export declare function validatePort(port: unknown, name?: string, allowZero?: boolean): number;
|
|
15
|
+
export declare const kValidateObjectNone = 0;
|
|
16
|
+
export declare const kValidateObjectAllowNullable: number;
|
|
17
|
+
export declare const kValidateObjectAllowArray: number;
|
|
18
|
+
export declare const kValidateObjectAllowFunction: number;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Copyright (c) 2017-2022 Cloudflare, Inc.
|
|
2
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
3
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
// Adapted from Deno and Node.js:
|
|
6
|
+
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
|
7
|
+
//
|
|
8
|
+
// Adapted from Node.js. Copyright Joyent, Inc. and other Node contributors.
|
|
9
|
+
//
|
|
10
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
11
|
+
// copy of this software and associated documentation files (the
|
|
12
|
+
// "Software"), to deal in the Software without restriction, including
|
|
13
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
14
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
15
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
16
|
+
// following conditions:
|
|
17
|
+
//
|
|
18
|
+
// The above copyright notice and this permission notice shall be included
|
|
19
|
+
// in all copies or substantial portions of the Software.
|
|
20
|
+
//
|
|
21
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
22
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
23
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
24
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
25
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
26
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
27
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
import { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_SOCKET_BAD_PORT, ERR_OUT_OF_RANGE, } from "./errors.js";
|
|
29
|
+
export function isInt32(value) {
|
|
30
|
+
if (typeof value !== "number")
|
|
31
|
+
return false;
|
|
32
|
+
return value === (value | 0);
|
|
33
|
+
}
|
|
34
|
+
export function isUint32(value) {
|
|
35
|
+
// @ts-expect-error Due to value being unknown
|
|
36
|
+
return value === value >>> 0;
|
|
37
|
+
}
|
|
38
|
+
export function validateObject(value, name, options = kValidateObjectNone) {
|
|
39
|
+
if (options === kValidateObjectNone) {
|
|
40
|
+
if (value === null || Array.isArray(value)) {
|
|
41
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Object", value);
|
|
42
|
+
}
|
|
43
|
+
if (typeof value !== "object") {
|
|
44
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Object", value);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const throwOnNullable = (kValidateObjectAllowNullable & options) === 0;
|
|
49
|
+
if (throwOnNullable && value === null) {
|
|
50
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Object", value);
|
|
51
|
+
}
|
|
52
|
+
const throwOnArray = (kValidateObjectAllowArray & options) === 0;
|
|
53
|
+
if (throwOnArray && Array.isArray(value)) {
|
|
54
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Object", value);
|
|
55
|
+
}
|
|
56
|
+
const throwOnFunction = (kValidateObjectAllowFunction & options) === 0;
|
|
57
|
+
const typeofValue = typeof value;
|
|
58
|
+
if (typeofValue !== "object" &&
|
|
59
|
+
(throwOnFunction || typeofValue !== "function")) {
|
|
60
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Object", value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export function validateInt32(value, name, min = -2147483648, max = 2147483647) {
|
|
65
|
+
if (!isInt32(value)) {
|
|
66
|
+
if (typeof value !== "number") {
|
|
67
|
+
throw new ERR_INVALID_ARG_TYPE(name, "number", value);
|
|
68
|
+
}
|
|
69
|
+
if (!Number.isInteger(value)) {
|
|
70
|
+
throw new ERR_OUT_OF_RANGE(name, "an integer", value);
|
|
71
|
+
}
|
|
72
|
+
throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
|
|
73
|
+
}
|
|
74
|
+
if (value < min || value > max) {
|
|
75
|
+
throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export function validateUint32(value, name, positive) {
|
|
79
|
+
if (!isUint32(value)) {
|
|
80
|
+
if (typeof value !== "number") {
|
|
81
|
+
throw new ERR_INVALID_ARG_TYPE(name, "number", value);
|
|
82
|
+
}
|
|
83
|
+
if (!Number.isInteger(value)) {
|
|
84
|
+
throw new ERR_OUT_OF_RANGE(name, "an integer", value);
|
|
85
|
+
}
|
|
86
|
+
const min = positive ? 1 : 0;
|
|
87
|
+
// 2 ** 32 === 4294967296
|
|
88
|
+
throw new ERR_OUT_OF_RANGE(name, `>= ${min} && < 4294967296`, value);
|
|
89
|
+
}
|
|
90
|
+
if (positive && value === 0) {
|
|
91
|
+
throw new ERR_OUT_OF_RANGE(name, ">= 1 && < 4294967296", value);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export function validateString(value, name) {
|
|
95
|
+
if (typeof value !== "string") {
|
|
96
|
+
throw new ERR_INVALID_ARG_TYPE(name, "string", value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export function validateNumber(value, name, min, max) {
|
|
100
|
+
if (typeof value !== "number") {
|
|
101
|
+
throw new ERR_INVALID_ARG_TYPE(name, "number", value);
|
|
102
|
+
}
|
|
103
|
+
if ((min != null && value < min) ||
|
|
104
|
+
(max != null && value > max) ||
|
|
105
|
+
((min != null || max != null) && Number.isNaN(value))) {
|
|
106
|
+
throw new ERR_OUT_OF_RANGE(name, `${min != null ? `>= ${min}` : ""}${min != null && max != null ? " && " : ""}${max != null ? `<= ${max}` : ""}`, value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export function validateBoolean(value, name) {
|
|
110
|
+
if (typeof value !== "boolean") {
|
|
111
|
+
throw new ERR_INVALID_ARG_TYPE(name, "boolean", value);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export function validateOneOf(value, name, oneOf) {
|
|
115
|
+
if (!Array.prototype.includes.call(oneOf, value)) {
|
|
116
|
+
const allowed = Array.prototype.join.call(Array.prototype.map.call(oneOf, (v) => typeof v === "string" ? `'${v}'` : String(v)), ", ");
|
|
117
|
+
const reason = "must be one of: " + allowed;
|
|
118
|
+
throw new ERR_INVALID_ARG_VALUE(name, value, reason);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export function validateAbortSignal(signal, name) {
|
|
122
|
+
if (signal !== undefined &&
|
|
123
|
+
(signal === null || typeof signal !== "object" || !("aborted" in signal))) {
|
|
124
|
+
throw new ERR_INVALID_ARG_TYPE(name, "AbortSignal", signal);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function validateFunction(value, name) {
|
|
128
|
+
if (typeof value !== "function") {
|
|
129
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Function", value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export function validateArray(value, name, minLength = 0) {
|
|
133
|
+
if (!Array.isArray(value)) {
|
|
134
|
+
throw new ERR_INVALID_ARG_TYPE(name, "Array", value);
|
|
135
|
+
}
|
|
136
|
+
if (value.length < minLength) {
|
|
137
|
+
const reason = `must be longer than ${minLength}`;
|
|
138
|
+
throw new ERR_INVALID_ARG_VALUE(name, value, reason);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export function validatePort(port, name = "Port", allowZero = true) {
|
|
142
|
+
if ((typeof port !== "number" && typeof port !== "string") ||
|
|
143
|
+
(typeof port === "string" && port.trim().length === 0) ||
|
|
144
|
+
+port !== +port >>> 0 ||
|
|
145
|
+
+port > 0xffff ||
|
|
146
|
+
(port === 0 && !allowZero)) {
|
|
147
|
+
throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);
|
|
148
|
+
}
|
|
149
|
+
return +port | 0;
|
|
150
|
+
}
|
|
151
|
+
export const kValidateObjectNone = 0;
|
|
152
|
+
export const kValidateObjectAllowNullable = 1 << 0;
|
|
153
|
+
export const kValidateObjectAllowArray = 1 << 1;
|
|
154
|
+
export const kValidateObjectAllowFunction = 1 << 2;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Upstream notices
|
|
2
|
+
|
|
3
|
+
`index.ts` is adapted from Cloudflare workerd `src/node/os.ts` at
|
|
4
|
+
`5358e3d337336eaf696a48bc1563d808b10feba5` (tag `v1.20261012.1`).
|
|
5
|
+
Copyright Cloudflare, Inc.; Apache License 2.0 (see LICENSE-APACHE).
|
|
6
|
+
Any Node.js/Joyent MIT notice is retained in the corresponding source file.
|
|
7
|
+
Internal imports use the existing compatibility modules. The public behavior
|
|
8
|
+
and export surface target the pinned workerd profile.
|