@tickernelz/paperclip-pro-adapter-utils 2026.925.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/acpx-engine/cli.d.ts +2 -0
- package/dist/acpx-engine/cli.d.ts.map +1 -0
- package/dist/acpx-engine/cli.js +128 -0
- package/dist/acpx-engine/cli.js.map +1 -0
- package/dist/acpx-engine/composed-run-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/composed-run-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/composed-run-characterization.test.js +739 -0
- package/dist/acpx-engine/composed-run-characterization.test.js.map +1 -0
- package/dist/acpx-engine/constants.d.ts +20 -0
- package/dist/acpx-engine/constants.d.ts.map +1 -0
- package/dist/acpx-engine/constants.js +37 -0
- package/dist/acpx-engine/constants.js.map +1 -0
- package/dist/acpx-engine/execute-identity.test.d.ts +2 -0
- package/dist/acpx-engine/execute-identity.test.d.ts.map +1 -0
- package/dist/acpx-engine/execute-identity.test.js +218 -0
- package/dist/acpx-engine/execute-identity.test.js.map +1 -0
- package/dist/acpx-engine/execute.d.ts +325 -0
- package/dist/acpx-engine/execute.d.ts.map +1 -0
- package/dist/acpx-engine/execute.js +4448 -0
- package/dist/acpx-engine/execute.js.map +1 -0
- package/dist/acpx-engine/execute.test.d.ts +2 -0
- package/dist/acpx-engine/execute.test.d.ts.map +1 -0
- package/dist/acpx-engine/execute.test.js +6694 -0
- package/dist/acpx-engine/execute.test.js.map +1 -0
- package/dist/acpx-engine/index.d.ts +6 -0
- package/dist/acpx-engine/index.d.ts.map +1 -0
- package/dist/acpx-engine/index.js +6 -0
- package/dist/acpx-engine/index.js.map +1 -0
- package/dist/acpx-engine/local-process-control.d.ts +5 -0
- package/dist/acpx-engine/local-process-control.d.ts.map +1 -0
- package/dist/acpx-engine/local-process-control.js +39 -0
- package/dist/acpx-engine/local-process-control.js.map +1 -0
- package/dist/acpx-engine/local-process-control.test.d.ts +2 -0
- package/dist/acpx-engine/local-process-control.test.d.ts.map +1 -0
- package/dist/acpx-engine/local-process-control.test.js +38 -0
- package/dist/acpx-engine/local-process-control.test.js.map +1 -0
- package/dist/acpx-engine/operator-stop.test.d.ts +2 -0
- package/dist/acpx-engine/operator-stop.test.d.ts.map +1 -0
- package/dist/acpx-engine/operator-stop.test.js +107 -0
- package/dist/acpx-engine/operator-stop.test.js.map +1 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.d.ts +2 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.d.ts.map +1 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.js +151 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -0
- package/dist/acpx-engine/run-contracts.d.ts +413 -0
- package/dist/acpx-engine/run-contracts.d.ts.map +1 -0
- package/dist/acpx-engine/run-contracts.js +20 -0
- package/dist/acpx-engine/run-contracts.js.map +1 -0
- package/dist/acpx-engine/run-contracts.test.d.ts +2 -0
- package/dist/acpx-engine/run-contracts.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-contracts.test.js +57 -0
- package/dist/acpx-engine/run-contracts.test.js.map +1 -0
- package/dist/acpx-engine/run-coordinator.d.ts +57 -0
- package/dist/acpx-engine/run-coordinator.d.ts.map +1 -0
- package/dist/acpx-engine/run-coordinator.js +63 -0
- package/dist/acpx-engine/run-coordinator.js.map +1 -0
- package/dist/acpx-engine/run-coordinator.test.d.ts +2 -0
- package/dist/acpx-engine/run-coordinator.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-coordinator.test.js +160 -0
- package/dist/acpx-engine/run-coordinator.test.js.map +1 -0
- package/dist/acpx-engine/run-fault-matrix.test.d.ts +2 -0
- package/dist/acpx-engine/run-fault-matrix.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-fault-matrix.test.js +829 -0
- package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.d.ts +30 -0
- package/dist/acpx-engine/run-resource-ledger.d.ts.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.js +148 -0
- package/dist/acpx-engine/run-resource-ledger.js.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.test.d.ts +2 -0
- package/dist/acpx-engine/run-resource-ledger.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.test.js +154 -0
- package/dist/acpx-engine/run-resource-ledger.test.js.map +1 -0
- package/dist/acpx-engine/run-site-host.d.ts +73 -0
- package/dist/acpx-engine/run-site-host.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-host.js +65 -0
- package/dist/acpx-engine/run-site-host.js.map +1 -0
- package/dist/acpx-engine/run-site-host.test.d.ts +2 -0
- package/dist/acpx-engine/run-site-host.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-host.test.js +98 -0
- package/dist/acpx-engine/run-site-host.test.js.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.d.ts +142 -0
- package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.js +278 -0
- package/dist/acpx-engine/run-site-sandbox.js.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.test.d.ts +2 -0
- package/dist/acpx-engine/run-site-sandbox.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.test.js +275 -0
- package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -0
- package/dist/acpx-engine/session-codec.d.ts +3 -0
- package/dist/acpx-engine/session-codec.d.ts.map +1 -0
- package/dist/acpx-engine/session-codec.js +49 -0
- package/dist/acpx-engine/session-codec.js.map +1 -0
- package/dist/acpx-engine/session-reuse-store.d.ts +62 -0
- package/dist/acpx-engine/session-reuse-store.d.ts.map +1 -0
- package/dist/acpx-engine/session-reuse-store.js +134 -0
- package/dist/acpx-engine/session-reuse-store.js.map +1 -0
- package/dist/acpx-engine/session-reuse-store.test.d.ts +2 -0
- package/dist/acpx-engine/session-reuse-store.test.d.ts.map +1 -0
- package/dist/acpx-engine/session-reuse-store.test.js +134 -0
- package/dist/acpx-engine/session-reuse-store.test.js.map +1 -0
- package/dist/acpx-engine/settlement-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/settlement-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/settlement-characterization.test.js +880 -0
- package/dist/acpx-engine/settlement-characterization.test.js.map +1 -0
- package/dist/acpx-engine/settlement-sequence.d.ts +77 -0
- package/dist/acpx-engine/settlement-sequence.d.ts.map +1 -0
- package/dist/acpx-engine/settlement-sequence.js +119 -0
- package/dist/acpx-engine/settlement-sequence.js.map +1 -0
- package/dist/acpx-engine/settlement-sequence.test.d.ts +2 -0
- package/dist/acpx-engine/settlement-sequence.test.d.ts.map +1 -0
- package/dist/acpx-engine/settlement-sequence.test.js +272 -0
- package/dist/acpx-engine/settlement-sequence.test.js.map +1 -0
- package/dist/acpx-engine/spawn-smoke.test.d.ts +2 -0
- package/dist/acpx-engine/spawn-smoke.test.d.ts.map +1 -0
- package/dist/acpx-engine/spawn-smoke.test.js +184 -0
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -0
- package/dist/acpx-engine/startup-cancellation.d.ts +8 -0
- package/dist/acpx-engine/startup-cancellation.d.ts.map +1 -0
- package/dist/acpx-engine/startup-cancellation.js +92 -0
- package/dist/acpx-engine/startup-cancellation.js.map +1 -0
- package/dist/acpx-engine/startup-cancellation.test.d.ts +2 -0
- package/dist/acpx-engine/startup-cancellation.test.d.ts.map +1 -0
- package/dist/acpx-engine/startup-cancellation.test.js +115 -0
- package/dist/acpx-engine/startup-cancellation.test.js.map +1 -0
- package/dist/acpx-engine/startup-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/startup-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/startup-characterization.test.js +742 -0
- package/dist/acpx-engine/startup-characterization.test.js.map +1 -0
- package/dist/acpx-engine/startup-timing.d.ts +419 -0
- package/dist/acpx-engine/startup-timing.d.ts.map +1 -0
- package/dist/acpx-engine/startup-timing.js +616 -0
- package/dist/acpx-engine/startup-timing.js.map +1 -0
- package/dist/acpx-engine/startup-timing.test.d.ts +2 -0
- package/dist/acpx-engine/startup-timing.test.d.ts.map +1 -0
- package/dist/acpx-engine/startup-timing.test.js +619 -0
- package/dist/acpx-engine/startup-timing.test.js.map +1 -0
- package/dist/acpx-engine/turn-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/turn-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/turn-characterization.test.js +566 -0
- package/dist/acpx-engine/turn-characterization.test.js.map +1 -0
- package/dist/acpx-engine/turn-sequence.d.ts +54 -0
- package/dist/acpx-engine/turn-sequence.d.ts.map +1 -0
- package/dist/acpx-engine/turn-sequence.js +75 -0
- package/dist/acpx-engine/turn-sequence.js.map +1 -0
- package/dist/acpx-engine/turn-sequence.test.d.ts +2 -0
- package/dist/acpx-engine/turn-sequence.test.d.ts.map +1 -0
- package/dist/acpx-engine/turn-sequence.test.js +177 -0
- package/dist/acpx-engine/turn-sequence.test.js.map +1 -0
- package/dist/acpx-engine/ui.d.ts +3 -0
- package/dist/acpx-engine/ui.d.ts.map +1 -0
- package/dist/acpx-engine/ui.js +162 -0
- package/dist/acpx-engine/ui.js.map +1 -0
- package/dist/billing.d.ts +2 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +16 -0
- package/dist/billing.js.map +1 -0
- package/dist/billing.test.d.ts +2 -0
- package/dist/billing.test.d.ts.map +1 -0
- package/dist/billing.test.js +14 -0
- package/dist/billing.test.js.map +1 -0
- package/dist/bridge-transport-contract.d.ts +43 -0
- package/dist/bridge-transport-contract.d.ts.map +1 -0
- package/dist/bridge-transport-contract.js +33 -0
- package/dist/bridge-transport-contract.js.map +1 -0
- package/dist/chat-file-delivery.d.ts +10 -0
- package/dist/chat-file-delivery.d.ts.map +1 -0
- package/dist/chat-file-delivery.js +38 -0
- package/dist/chat-file-delivery.js.map +1 -0
- package/dist/chat-file-delivery.test.d.ts +2 -0
- package/dist/chat-file-delivery.test.d.ts.map +1 -0
- package/dist/chat-file-delivery.test.js +92 -0
- package/dist/chat-file-delivery.test.js.map +1 -0
- package/dist/command-managed-runtime.d.ts +162 -0
- package/dist/command-managed-runtime.d.ts.map +1 -0
- package/dist/command-managed-runtime.js +456 -0
- package/dist/command-managed-runtime.js.map +1 -0
- package/dist/command-managed-runtime.test.d.ts +2 -0
- package/dist/command-managed-runtime.test.d.ts.map +1 -0
- package/dist/command-managed-runtime.test.js +908 -0
- package/dist/command-managed-runtime.test.js.map +1 -0
- package/dist/command-redaction.d.ts +15 -0
- package/dist/command-redaction.d.ts.map +1 -0
- package/dist/command-redaction.js +97 -0
- package/dist/command-redaction.js.map +1 -0
- package/dist/command-redaction.test.d.ts +2 -0
- package/dist/command-redaction.test.d.ts.map +1 -0
- package/dist/command-redaction.test.js +80 -0
- package/dist/command-redaction.test.js.map +1 -0
- package/dist/duplex-frame-codec.d.ts +124 -0
- package/dist/duplex-frame-codec.d.ts.map +1 -0
- package/dist/duplex-frame-codec.js +134 -0
- package/dist/duplex-frame-codec.js.map +1 -0
- package/dist/duplex-frame-codec.test.d.ts +2 -0
- package/dist/duplex-frame-codec.test.d.ts.map +1 -0
- package/dist/duplex-frame-codec.test.js +172 -0
- package/dist/duplex-frame-codec.test.js.map +1 -0
- package/dist/duplex-observability.d.ts +220 -0
- package/dist/duplex-observability.d.ts.map +1 -0
- package/dist/duplex-observability.js +248 -0
- package/dist/duplex-observability.js.map +1 -0
- package/dist/duplex-observability.test.d.ts +2 -0
- package/dist/duplex-observability.test.d.ts.map +1 -0
- package/dist/duplex-observability.test.js +55 -0
- package/dist/duplex-observability.test.js.map +1 -0
- package/dist/env-bindings.d.ts +17 -0
- package/dist/env-bindings.d.ts.map +1 -0
- package/dist/env-bindings.js +98 -0
- package/dist/env-bindings.js.map +1 -0
- package/dist/env-bindings.test.d.ts +2 -0
- package/dist/env-bindings.test.d.ts.map +1 -0
- package/dist/env-bindings.test.js +66 -0
- package/dist/env-bindings.test.js.map +1 -0
- package/dist/exclude-patterns.d.ts +4 -0
- package/dist/exclude-patterns.d.ts.map +1 -0
- package/dist/exclude-patterns.js +26 -0
- package/dist/exclude-patterns.js.map +1 -0
- package/dist/execution-target-sandbox.test.d.ts +2 -0
- package/dist/execution-target-sandbox.test.d.ts.map +1 -0
- package/dist/execution-target-sandbox.test.js +6522 -0
- package/dist/execution-target-sandbox.test.js.map +1 -0
- package/dist/execution-target-stdin-race.test.d.ts +2 -0
- package/dist/execution-target-stdin-race.test.d.ts.map +1 -0
- package/dist/execution-target-stdin-race.test.js +1842 -0
- package/dist/execution-target-stdin-race.test.js.map +1 -0
- package/dist/execution-target.d.ts +537 -0
- package/dist/execution-target.d.ts.map +1 -0
- package/dist/execution-target.js +3877 -0
- package/dist/execution-target.js.map +1 -0
- package/dist/execution-target.test.d.ts +2 -0
- package/dist/execution-target.test.d.ts.map +1 -0
- package/dist/execution-target.test.js +346 -0
- package/dist/execution-target.test.js.map +1 -0
- package/dist/git-workspace-sync.d.ts +193 -0
- package/dist/git-workspace-sync.d.ts.map +1 -0
- package/dist/git-workspace-sync.js +786 -0
- package/dist/git-workspace-sync.js.map +1 -0
- package/dist/git-workspace-sync.test.d.ts +2 -0
- package/dist/git-workspace-sync.test.d.ts.map +1 -0
- package/dist/git-workspace-sync.test.js +830 -0
- package/dist/git-workspace-sync.test.js.map +1 -0
- package/dist/github-launcher-environment.test.d.ts +2 -0
- package/dist/github-launcher-environment.test.d.ts.map +1 -0
- package/dist/github-launcher-environment.test.js +285 -0
- package/dist/github-launcher-environment.test.js.map +1 -0
- package/dist/github-launcher.d.ts +8 -0
- package/dist/github-launcher.d.ts.map +1 -0
- package/dist/github-launcher.js +127 -0
- package/dist/github-launcher.js.map +1 -0
- package/dist/github-launcher.test.d.ts +2 -0
- package/dist/github-launcher.test.d.ts.map +1 -0
- package/dist/github-launcher.test.js +166 -0
- package/dist/github-launcher.test.js.map +1 -0
- package/dist/http2-bridge-server.d.ts +465 -0
- package/dist/http2-bridge-server.d.ts.map +1 -0
- package/dist/http2-bridge-server.js +1087 -0
- package/dist/http2-bridge-server.js.map +1 -0
- package/dist/http2-bridge-server.test.d.ts +2 -0
- package/dist/http2-bridge-server.test.d.ts.map +1 -0
- package/dist/http2-bridge-server.test.js +2129 -0
- package/dist/http2-bridge-server.test.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/local-process-sandbox.d.ts +41 -0
- package/dist/local-process-sandbox.d.ts.map +1 -0
- package/dist/local-process-sandbox.js +432 -0
- package/dist/local-process-sandbox.js.map +1 -0
- package/dist/local-process-sandbox.test.d.ts +2 -0
- package/dist/local-process-sandbox.test.d.ts.map +1 -0
- package/dist/local-process-sandbox.test.js +399 -0
- package/dist/local-process-sandbox.test.js.map +1 -0
- package/dist/log-redaction.d.ts +9 -0
- package/dist/log-redaction.d.ts.map +1 -0
- package/dist/log-redaction.js +88 -0
- package/dist/log-redaction.js.map +1 -0
- package/dist/login-capability.d.ts +88 -0
- package/dist/login-capability.d.ts.map +1 -0
- package/dist/login-capability.js +78 -0
- package/dist/login-capability.js.map +1 -0
- package/dist/login-capability.test.d.ts +2 -0
- package/dist/login-capability.test.d.ts.map +1 -0
- package/dist/login-capability.test.js +78 -0
- package/dist/login-capability.test.js.map +1 -0
- package/dist/login-pty-transport.d.ts +80 -0
- package/dist/login-pty-transport.d.ts.map +1 -0
- package/dist/login-pty-transport.js +75 -0
- package/dist/login-pty-transport.js.map +1 -0
- package/dist/login-pty-transport.test.d.ts +2 -0
- package/dist/login-pty-transport.test.d.ts.map +1 -0
- package/dist/login-pty-transport.test.js +185 -0
- package/dist/login-pty-transport.test.js.map +1 -0
- package/dist/login-runner-lifecycle.d.ts +70 -0
- package/dist/login-runner-lifecycle.d.ts.map +1 -0
- package/dist/login-runner-lifecycle.js +52 -0
- package/dist/login-runner-lifecycle.js.map +1 -0
- package/dist/login-runner-lifecycle.test.d.ts +2 -0
- package/dist/login-runner-lifecycle.test.d.ts.map +1 -0
- package/dist/login-runner-lifecycle.test.js +122 -0
- package/dist/login-runner-lifecycle.test.js.map +1 -0
- package/dist/mcp-isolation.integration.test.d.ts +2 -0
- package/dist/mcp-isolation.integration.test.d.ts.map +1 -0
- package/dist/mcp-isolation.integration.test.js +202 -0
- package/dist/mcp-isolation.integration.test.js.map +1 -0
- package/dist/paperclip-runner-permissions.d.ts +110 -0
- package/dist/paperclip-runner-permissions.d.ts.map +1 -0
- package/dist/paperclip-runner-permissions.js +150 -0
- package/dist/paperclip-runner-permissions.js.map +1 -0
- package/dist/paperclip-runner-permissions.test.d.ts +2 -0
- package/dist/paperclip-runner-permissions.test.d.ts.map +1 -0
- package/dist/paperclip-runner-permissions.test.js +47 -0
- package/dist/paperclip-runner-permissions.test.js.map +1 -0
- package/dist/published-exports.test.d.ts +2 -0
- package/dist/published-exports.test.d.ts.map +1 -0
- package/dist/published-exports.test.js +17 -0
- package/dist/published-exports.test.js.map +1 -0
- package/dist/remote-execution-env.d.ts +2 -0
- package/dist/remote-execution-env.d.ts.map +1 -0
- package/dist/remote-execution-env.js +46 -0
- package/dist/remote-execution-env.js.map +1 -0
- package/dist/remote-managed-runtime.d.ts +45 -0
- package/dist/remote-managed-runtime.d.ts.map +1 -0
- package/dist/remote-managed-runtime.js +183 -0
- package/dist/remote-managed-runtime.js.map +1 -0
- package/dist/remote-managed-runtime.test.d.ts +2 -0
- package/dist/remote-managed-runtime.test.d.ts.map +1 -0
- package/dist/remote-managed-runtime.test.js +294 -0
- package/dist/remote-managed-runtime.test.js.map +1 -0
- package/dist/runner-connectivity.d.ts +61 -0
- package/dist/runner-connectivity.d.ts.map +1 -0
- package/dist/runner-connectivity.js +81 -0
- package/dist/runner-connectivity.js.map +1 -0
- package/dist/runner-connectivity.test.d.ts +2 -0
- package/dist/runner-connectivity.test.d.ts.map +1 -0
- package/dist/runner-connectivity.test.js +183 -0
- package/dist/runner-connectivity.test.js.map +1 -0
- package/dist/runtime-progress.d.ts +48 -0
- package/dist/runtime-progress.d.ts.map +1 -0
- package/dist/runtime-progress.js +99 -0
- package/dist/runtime-progress.js.map +1 -0
- package/dist/runtime-progress.test.d.ts +2 -0
- package/dist/runtime-progress.test.d.ts.map +1 -0
- package/dist/runtime-progress.test.js +240 -0
- package/dist/runtime-progress.test.js.map +1 -0
- package/dist/sandbox-callback-bridge-body.d.ts +12 -0
- package/dist/sandbox-callback-bridge-body.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge-body.js +39 -0
- package/dist/sandbox-callback-bridge-body.js.map +1 -0
- package/dist/sandbox-callback-bridge-body.test.d.ts +2 -0
- package/dist/sandbox-callback-bridge-body.test.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge-body.test.js +31 -0
- package/dist/sandbox-callback-bridge-body.test.js.map +1 -0
- package/dist/sandbox-callback-bridge.d.ts +268 -0
- package/dist/sandbox-callback-bridge.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge.js +2357 -0
- package/dist/sandbox-callback-bridge.js.map +1 -0
- package/dist/sandbox-callback-bridge.test.d.ts +2 -0
- package/dist/sandbox-callback-bridge.test.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge.test.js +3253 -0
- package/dist/sandbox-callback-bridge.test.js.map +1 -0
- package/dist/sandbox-file-sync.test.d.ts +2 -0
- package/dist/sandbox-file-sync.test.d.ts.map +1 -0
- package/dist/sandbox-file-sync.test.js +419 -0
- package/dist/sandbox-file-sync.test.js.map +1 -0
- package/dist/sandbox-install-command.d.ts +2 -0
- package/dist/sandbox-install-command.d.ts.map +1 -0
- package/dist/sandbox-install-command.js +47 -0
- package/dist/sandbox-install-command.js.map +1 -0
- package/dist/sandbox-install-command.test.d.ts +2 -0
- package/dist/sandbox-install-command.test.d.ts.map +1 -0
- package/dist/sandbox-install-command.test.js +22 -0
- package/dist/sandbox-install-command.test.js.map +1 -0
- package/dist/sandbox-managed-runtime.d.ts +417 -0
- package/dist/sandbox-managed-runtime.d.ts.map +1 -0
- package/dist/sandbox-managed-runtime.js +1337 -0
- package/dist/sandbox-managed-runtime.js.map +1 -0
- package/dist/sandbox-managed-runtime.test.d.ts +2 -0
- package/dist/sandbox-managed-runtime.test.d.ts.map +1 -0
- package/dist/sandbox-managed-runtime.test.js +3746 -0
- package/dist/sandbox-managed-runtime.test.js.map +1 -0
- package/dist/sandbox-run-log-stream.d.ts +44 -0
- package/dist/sandbox-run-log-stream.d.ts.map +1 -0
- package/dist/sandbox-run-log-stream.js +203 -0
- package/dist/sandbox-run-log-stream.js.map +1 -0
- package/dist/sandbox-shell.d.ts +3 -0
- package/dist/sandbox-shell.d.ts.map +1 -0
- package/dist/sandbox-shell.js +7 -0
- package/dist/sandbox-shell.js.map +1 -0
- package/dist/server-utils-env.test.d.ts +2 -0
- package/dist/server-utils-env.test.d.ts.map +1 -0
- package/dist/server-utils-env.test.js +15 -0
- package/dist/server-utils-env.test.js.map +1 -0
- package/dist/server-utils.d.ts +617 -0
- package/dist/server-utils.d.ts.map +1 -0
- package/dist/server-utils.js +3258 -0
- package/dist/server-utils.js.map +1 -0
- package/dist/server-utils.test.d.ts +2 -0
- package/dist/server-utils.test.d.ts.map +1 -0
- package/dist/server-utils.test.js +3047 -0
- package/dist/server-utils.test.js.map +1 -0
- package/dist/session-compaction.d.ts +25 -0
- package/dist/session-compaction.d.ts.map +1 -0
- package/dist/session-compaction.js +165 -0
- package/dist/session-compaction.js.map +1 -0
- package/dist/skill-library-manifest.d.ts +6 -0
- package/dist/skill-library-manifest.d.ts.map +1 -0
- package/dist/skill-library-manifest.js +53 -0
- package/dist/skill-library-manifest.js.map +1 -0
- package/dist/skill-library-manifest.test.d.ts +2 -0
- package/dist/skill-library-manifest.test.d.ts.map +1 -0
- package/dist/skill-library-manifest.test.js +84 -0
- package/dist/skill-library-manifest.test.js.map +1 -0
- package/dist/skills-staging-follow-symlinks.test.d.ts +2 -0
- package/dist/skills-staging-follow-symlinks.test.d.ts.map +1 -0
- package/dist/skills-staging-follow-symlinks.test.js +126 -0
- package/dist/skills-staging-follow-symlinks.test.js.map +1 -0
- package/dist/ssh-fixture.test.d.ts +2 -0
- package/dist/ssh-fixture.test.d.ts.map +1 -0
- package/dist/ssh-fixture.test.js +832 -0
- package/dist/ssh-fixture.test.js.map +1 -0
- package/dist/ssh.d.ts +124 -0
- package/dist/ssh.d.ts.map +1 -0
- package/dist/ssh.js +1667 -0
- package/dist/ssh.js.map +1 -0
- package/dist/sync-operation-schedule.d.ts +17 -0
- package/dist/sync-operation-schedule.d.ts.map +1 -0
- package/dist/sync-operation-schedule.js +66 -0
- package/dist/sync-operation-schedule.js.map +1 -0
- package/dist/sync-operation-schedule.test.d.ts +2 -0
- package/dist/sync-operation-schedule.test.d.ts.map +1 -0
- package/dist/sync-operation-schedule.test.js +130 -0
- package/dist/sync-operation-schedule.test.js.map +1 -0
- package/dist/test-support/mcp-isolation-harness.d.ts +23 -0
- package/dist/test-support/mcp-isolation-harness.d.ts.map +1 -0
- package/dist/test-support/mcp-isolation-harness.js +67 -0
- package/dist/test-support/mcp-isolation-harness.js.map +1 -0
- package/dist/types.d.ts +780 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/workspace-restore-merge.d.ts +77 -0
- package/dist/workspace-restore-merge.d.ts.map +1 -0
- package/dist/workspace-restore-merge.js +396 -0
- package/dist/workspace-restore-merge.js.map +1 -0
- package/dist/workspace-restore-merge.test.d.ts +2 -0
- package/dist/workspace-restore-merge.test.d.ts.map +1 -0
- package/dist/workspace-restore-merge.test.js +438 -0
- package/dist/workspace-restore-merge.test.js.map +1 -0
- package/dist/workspace-restore-teardown.d.ts +29 -0
- package/dist/workspace-restore-teardown.d.ts.map +1 -0
- package/dist/workspace-restore-teardown.js +34 -0
- package/dist/workspace-restore-teardown.js.map +1 -0
- package/dist/workspace-restore-teardown.test.d.ts +2 -0
- package/dist/workspace-restore-teardown.test.d.ts.map +1 -0
- package/dist/workspace-restore-teardown.test.js +71 -0
- package/dist/workspace-restore-teardown.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
- package/node_modules/@agentclientprotocol/sdk/README.md +70 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1803 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1869 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5036 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +89 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js +490 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +507 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +221 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +112 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +33 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +435 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +603 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1076 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +917 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +22 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +64 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +426 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +499 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +474 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +535 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +69 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +82 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +183 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +207 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +52 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6219 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +15215 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +3084 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +98 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +536 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +88 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +53 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +992 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js +386 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1116 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js +91 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +35 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js +115 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +195 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +957 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1484 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +1287 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +946 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1046 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +42 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +43 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +6208 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +33267 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +3199 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +357 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +253 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +836 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +13 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/package.json +104 -0
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +8967 -0
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +10242 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.d.mts +503 -0
- package/node_modules/@clack/core/dist/index.mjs +1003 -0
- package/node_modules/@clack/core/package.json +63 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +396 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +949 -0
- package/node_modules/@clack/prompts/dist/index.mjs +1423 -0
- package/node_modules/@clack/prompts/package.json +67 -0
- package/node_modules/@esbuild/linux-x64/README.md +3 -0
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +20 -0
- package/node_modules/acpx/LICENSE +21 -0
- package/node_modules/acpx/README.md +424 -0
- package/node_modules/acpx/dist/cli-CxsS1XQp.js +197 -0
- package/node_modules/acpx/dist/cli-CxsS1XQp.js.map +1 -0
- package/node_modules/acpx/dist/cli.d.ts +14 -0
- package/node_modules/acpx/dist/cli.d.ts.map +1 -0
- package/node_modules/acpx/dist/cli.js +2683 -0
- package/node_modules/acpx/dist/cli.js.map +1 -0
- package/node_modules/acpx/dist/client-DwNyFauq.d.ts +192 -0
- package/node_modules/acpx/dist/client-DwNyFauq.d.ts.map +1 -0
- package/node_modules/acpx/dist/flags-Bjq_XQ4-.js +260 -0
- package/node_modules/acpx/dist/flags-Bjq_XQ4-.js.map +1 -0
- package/node_modules/acpx/dist/flows-Db_LZKu9.js +1920 -0
- package/node_modules/acpx/dist/flows-Db_LZKu9.js.map +1 -0
- package/node_modules/acpx/dist/flows.d.ts +318 -0
- package/node_modules/acpx/dist/flows.d.ts.map +1 -0
- package/node_modules/acpx/dist/flows.js +2 -0
- package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js +6210 -0
- package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js.map +1 -0
- package/node_modules/acpx/dist/output-CjdF5rHk.js +4593 -0
- package/node_modules/acpx/dist/output-CjdF5rHk.js.map +1 -0
- package/node_modules/acpx/dist/runtime.d.ts +472 -0
- package/node_modules/acpx/dist/runtime.d.ts.map +1 -0
- package/node_modules/acpx/dist/runtime.js +1711 -0
- package/node_modules/acpx/dist/runtime.js.map +1 -0
- package/node_modules/acpx/dist/session-options-jkYbBxGE.d.ts +278 -0
- package/node_modules/acpx/dist/session-options-jkYbBxGE.d.ts.map +1 -0
- package/node_modules/acpx/package.json +129 -0
- package/node_modules/acpx/skills/acpx/SKILL.md +617 -0
- package/node_modules/b4a/LICENSE +201 -0
- package/node_modules/b4a/README.md +153 -0
- package/node_modules/b4a/browser.js +546 -0
- package/node_modules/b4a/index.d.ts +144 -0
- package/node_modules/b4a/index.js +193 -0
- package/node_modules/b4a/lib/ascii.js +31 -0
- package/node_modules/b4a/lib/base64.js +64 -0
- package/node_modules/b4a/lib/hex.js +51 -0
- package/node_modules/b4a/lib/latin1.js +31 -0
- package/node_modules/b4a/lib/utf16le.js +40 -0
- package/node_modules/b4a/lib/utf8.js +144 -0
- package/node_modules/b4a/package.json +54 -0
- package/node_modules/b4a/react-native.js +5 -0
- package/node_modules/b4a/runtime.d.ts +14 -0
- package/node_modules/bare-events/LICENSE +201 -0
- package/node_modules/bare-events/README.md +25 -0
- package/node_modules/bare-events/global.d.ts +15 -0
- package/node_modules/bare-events/global.js +5 -0
- package/node_modules/bare-events/index.d.ts +89 -0
- package/node_modules/bare-events/index.js +397 -0
- package/node_modules/bare-events/lib/errors.js +23 -0
- package/node_modules/bare-events/package.json +63 -0
- package/node_modules/bare-events/web.d.ts +79 -0
- package/node_modules/bare-events/web.js +417 -0
- package/node_modules/bare-fs/CMakeLists.txt +13 -0
- package/node_modules/bare-fs/LICENSE +201 -0
- package/node_modules/bare-fs/README.md +33 -0
- package/node_modules/bare-fs/binding.c +2913 -0
- package/node_modules/bare-fs/binding.js +1 -0
- package/node_modules/bare-fs/index.d.ts +1502 -0
- package/node_modules/bare-fs/index.js +2855 -0
- package/node_modules/bare-fs/lib/constants.d.ts +50 -0
- package/node_modules/bare-fs/lib/constants.js +49 -0
- package/node_modules/bare-fs/lib/errors.d.ts +13 -0
- package/node_modules/bare-fs/lib/errors.js +55 -0
- package/node_modules/bare-fs/package.json +74 -0
- package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/promises.d.ts +480 -0
- package/node_modules/bare-fs/promises.js +119 -0
- package/node_modules/bare-path/CMakeLists.txt +13 -0
- package/node_modules/bare-path/LICENSE +201 -0
- package/node_modules/bare-path/NOTICE +28 -0
- package/node_modules/bare-path/README.md +19 -0
- package/node_modules/bare-path/binding.c +106 -0
- package/node_modules/bare-path/binding.js +1 -0
- package/node_modules/bare-path/index.d.ts +27 -0
- package/node_modules/bare-path/index.js +9 -0
- package/node_modules/bare-path/lib/constants.js +11 -0
- package/node_modules/bare-path/lib/posix.js +263 -0
- package/node_modules/bare-path/lib/shared.js +81 -0
- package/node_modules/bare-path/lib/win32.js +564 -0
- package/node_modules/bare-path/package.json +47 -0
- package/node_modules/bare-path/prebuilds/android-arm/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-ia32/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/darwin-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/darwin-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-arm64-simulator/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-x64-simulator/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/linux-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/linux-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/win32-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/win32-x64/bare-path.bare +0 -0
- package/node_modules/bare-stream/LICENSE +201 -0
- package/node_modules/bare-stream/README.md +354 -0
- package/node_modules/bare-stream/global.d.ts +31 -0
- package/node_modules/bare-stream/global.js +15 -0
- package/node_modules/bare-stream/index.d.ts +235 -0
- package/node_modules/bare-stream/index.js +493 -0
- package/node_modules/bare-stream/package.json +75 -0
- package/node_modules/bare-stream/promises.js +3 -0
- package/node_modules/bare-stream/web.d.ts +152 -0
- package/node_modules/bare-stream/web.js +607 -0
- package/node_modules/bare-url/CMakeLists.txt +36 -0
- package/node_modules/bare-url/LICENSE +201 -0
- package/node_modules/bare-url/README.md +33 -0
- package/node_modules/bare-url/binding.c +422 -0
- package/node_modules/bare-url/binding.js +1 -0
- package/node_modules/bare-url/global.d.ts +24 -0
- package/node_modules/bare-url/global.js +2 -0
- package/node_modules/bare-url/index.d.ts +96 -0
- package/node_modules/bare-url/index.js +676 -0
- package/node_modules/bare-url/lib/errors.d.ts +10 -0
- package/node_modules/bare-url/lib/errors.js +33 -0
- package/node_modules/bare-url/lib/url-search-params.d.ts +66 -0
- package/node_modules/bare-url/lib/url-search-params.js +276 -0
- package/node_modules/bare-url/package.json +54 -0
- package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1172 -0
- package/node_modules/commander/index.js +21 -0
- package/node_modules/commander/lib/argument.js +147 -0
- package/node_modules/commander/lib/command.js +2790 -0
- package/node_modules/commander/lib/error.js +36 -0
- package/node_modules/commander/lib/help.js +731 -0
- package/node_modules/commander/lib/option.js +377 -0
- package/node_modules/commander/lib/suggestSimilar.js +99 -0
- package/node_modules/commander/package-support.json +19 -0
- package/node_modules/commander/package.json +64 -0
- package/node_modules/commander/typings/index.d.ts +1113 -0
- package/node_modules/esbuild/LICENSE.md +21 -0
- package/node_modules/esbuild/README.md +3 -0
- package/node_modules/esbuild/bin/esbuild +223 -0
- package/node_modules/esbuild/install.js +300 -0
- package/node_modules/esbuild/lib/main.d.ts +720 -0
- package/node_modules/esbuild/lib/main.js +2536 -0
- package/node_modules/esbuild/package.json +74 -0
- package/node_modules/events-universal/LICENSE +201 -0
- package/node_modules/events-universal/README.md +17 -0
- package/node_modules/events-universal/bare.js +1 -0
- package/node_modules/events-universal/default.js +1 -0
- package/node_modules/events-universal/index.js +1 -0
- package/node_modules/events-universal/package.json +39 -0
- package/node_modules/events-universal/react-native.js +1 -0
- package/node_modules/fast-fifo/LICENSE +21 -0
- package/node_modules/fast-fifo/README.md +78 -0
- package/node_modules/fast-fifo/fixed-size.js +39 -0
- package/node_modules/fast-fifo/index.js +48 -0
- package/node_modules/fast-fifo/package.json +28 -0
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +42 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/skillflag/LICENSE +21 -0
- package/node_modules/skillflag/README.md +44 -0
- package/node_modules/skillflag/dist/bin/skill-install.d.ts +3 -0
- package/node_modules/skillflag/dist/bin/skill-install.d.ts.map +1 -0
- package/node_modules/skillflag/dist/bin/skill-install.js +6 -0
- package/node_modules/skillflag/dist/bin/skill-install.js.map +1 -0
- package/node_modules/skillflag/dist/bin/skillflag.d.ts +3 -0
- package/node_modules/skillflag/dist/bin/skillflag.d.ts.map +1 -0
- package/node_modules/skillflag/dist/bin/skillflag.js +25 -0
- package/node_modules/skillflag/dist/bin/skillflag.js.map +1 -0
- package/node_modules/skillflag/dist/core/digest.d.ts +2 -0
- package/node_modules/skillflag/dist/core/digest.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/digest.js +15 -0
- package/node_modules/skillflag/dist/core/digest.js.map +1 -0
- package/node_modules/skillflag/dist/core/errors.d.ts +6 -0
- package/node_modules/skillflag/dist/core/errors.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/errors.js +13 -0
- package/node_modules/skillflag/dist/core/errors.js.map +1 -0
- package/node_modules/skillflag/dist/core/export.d.ts +2 -0
- package/node_modules/skillflag/dist/core/export.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/export.js +28 -0
- package/node_modules/skillflag/dist/core/export.js.map +1 -0
- package/node_modules/skillflag/dist/core/list.d.ts +21 -0
- package/node_modules/skillflag/dist/core/list.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/list.js +71 -0
- package/node_modules/skillflag/dist/core/list.js.map +1 -0
- package/node_modules/skillflag/dist/core/paths.d.ts +15 -0
- package/node_modules/skillflag/dist/core/paths.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/paths.js +149 -0
- package/node_modules/skillflag/dist/core/paths.js.map +1 -0
- package/node_modules/skillflag/dist/core/show.d.ts +2 -0
- package/node_modules/skillflag/dist/core/show.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/show.js +8 -0
- package/node_modules/skillflag/dist/core/show.js.map +1 -0
- package/node_modules/skillflag/dist/core/skillflag.d.ts +3 -0
- package/node_modules/skillflag/dist/core/skillflag.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/skillflag.js +2 -0
- package/node_modules/skillflag/dist/core/skillflag.js.map +1 -0
- package/node_modules/skillflag/dist/core/tar.d.ts +16 -0
- package/node_modules/skillflag/dist/core/tar.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/tar.js +140 -0
- package/node_modules/skillflag/dist/core/tar.js.map +1 -0
- package/node_modules/skillflag/dist/index.d.ts +5 -0
- package/node_modules/skillflag/dist/index.d.ts.map +1 -0
- package/node_modules/skillflag/dist/index.js +3 -0
- package/node_modules/skillflag/dist/index.js.map +1 -0
- package/node_modules/skillflag/dist/install/cli.d.ts +57 -0
- package/node_modules/skillflag/dist/install/cli.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/cli.js +653 -0
- package/node_modules/skillflag/dist/install/cli.js.map +1 -0
- package/node_modules/skillflag/dist/install/copy.d.ts +2 -0
- package/node_modules/skillflag/dist/install/copy.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/copy.js +19 -0
- package/node_modules/skillflag/dist/install/copy.js.map +1 -0
- package/node_modules/skillflag/dist/install/errors.d.ts +6 -0
- package/node_modules/skillflag/dist/install/errors.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/errors.js +13 -0
- package/node_modules/skillflag/dist/install/errors.js.map +1 -0
- package/node_modules/skillflag/dist/install/extract.d.ts +3 -0
- package/node_modules/skillflag/dist/install/extract.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/extract.js +76 -0
- package/node_modules/skillflag/dist/install/extract.js.map +1 -0
- package/node_modules/skillflag/dist/install/install.d.ts +21 -0
- package/node_modules/skillflag/dist/install/install.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/install.js +35 -0
- package/node_modules/skillflag/dist/install/install.js.map +1 -0
- package/node_modules/skillflag/dist/install/resolve.d.ts +12 -0
- package/node_modules/skillflag/dist/install/resolve.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/resolve.js +119 -0
- package/node_modules/skillflag/dist/install/resolve.js.map +1 -0
- package/node_modules/skillflag/dist/install/validate.d.ts +7 -0
- package/node_modules/skillflag/dist/install/validate.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/validate.js +28 -0
- package/node_modules/skillflag/dist/install/validate.js.map +1 -0
- package/node_modules/skillflag/dist/shared/frontmatter.d.ts +2 -0
- package/node_modules/skillflag/dist/shared/frontmatter.d.ts.map +1 -0
- package/node_modules/skillflag/dist/shared/frontmatter.js +28 -0
- package/node_modules/skillflag/dist/shared/frontmatter.js.map +1 -0
- package/node_modules/skillflag/dist/skillflag.d.ts +29 -0
- package/node_modules/skillflag/dist/skillflag.d.ts.map +1 -0
- package/node_modules/skillflag/dist/skillflag.js +230 -0
- package/node_modules/skillflag/dist/skillflag.js.map +1 -0
- package/node_modules/skillflag/dist/utils/collections.d.ts +3 -0
- package/node_modules/skillflag/dist/utils/collections.d.ts.map +1 -0
- package/node_modules/skillflag/dist/utils/collections.js +18 -0
- package/node_modules/skillflag/dist/utils/collections.js.map +1 -0
- package/node_modules/skillflag/package.json +78 -0
- package/node_modules/skillflag/skills/skillflag/SKILL.md +144 -0
- package/node_modules/streamx/LICENSE +21 -0
- package/node_modules/streamx/README.md +550 -0
- package/node_modules/streamx/index.d.ts +198 -0
- package/node_modules/streamx/index.js +1314 -0
- package/node_modules/streamx/lib/errors.d.ts +13 -0
- package/node_modules/streamx/lib/errors.js +47 -0
- package/node_modules/streamx/package.json +51 -0
- package/node_modules/streamx/runtime.d.ts +55 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +183 -0
- package/node_modules/tar-stream/constants.js +14 -0
- package/node_modules/tar-stream/extract.js +418 -0
- package/node_modules/tar-stream/headers.js +322 -0
- package/node_modules/tar-stream/index.d.ts +60 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/pack.js +287 -0
- package/node_modules/tar-stream/package.json +50 -0
- package/node_modules/teex/LICENSE +21 -0
- package/node_modules/teex/README.md +31 -0
- package/node_modules/teex/example.js +16 -0
- package/node_modules/teex/index.js +52 -0
- package/node_modules/teex/package.json +26 -0
- package/node_modules/teex/test.js +68 -0
- package/node_modules/text-decoder/LICENSE +201 -0
- package/node_modules/text-decoder/README.md +36 -0
- package/node_modules/text-decoder/index.js +64 -0
- package/node_modules/text-decoder/lib/pass-through-decoder.js +19 -0
- package/node_modules/text-decoder/lib/utf8-decoder.js +185 -0
- package/node_modules/text-decoder/package.json +39 -0
- package/node_modules/tsx/LICENSE +21 -0
- package/node_modules/tsx/README.md +32 -0
- package/node_modules/tsx/dist/cjs/api/index.cjs +2 -0
- package/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
- package/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
- package/node_modules/tsx/dist/cjs/api/index.mjs +2 -0
- package/node_modules/tsx/dist/cjs/index.cjs +1 -0
- package/node_modules/tsx/dist/cli.mjs +55 -0
- package/node_modules/tsx/dist/client-XItNFmsq.cjs +1 -0
- package/node_modules/tsx/dist/esm/api/index.cjs +2 -0
- package/node_modules/tsx/dist/esm/api/index.d.cts +37 -0
- package/node_modules/tsx/dist/esm/api/index.d.mts +37 -0
- package/node_modules/tsx/dist/esm/api/index.mjs +2 -0
- package/node_modules/tsx/dist/esm/index.mjs +2 -0
- package/node_modules/tsx/dist/index-Bqjv9TxC.mjs +1 -0
- package/node_modules/tsx/dist/index-DE3OBZuV.mjs +14 -0
- package/node_modules/tsx/dist/lexer-CGfpMDSb.cjs +3 -0
- package/node_modules/tsx/dist/lexer-CanA6ArK.mjs +3 -0
- package/node_modules/tsx/dist/loader.mjs +2 -0
- package/node_modules/tsx/dist/package-Dj0mHsMt.mjs +1 -0
- package/node_modules/tsx/dist/patch-repl.cjs +1 -0
- package/node_modules/tsx/dist/preflight.cjs +1 -0
- package/node_modules/tsx/dist/register-B1c7OH6V.cjs +23 -0
- package/node_modules/tsx/dist/register-nyXW-TH3.mjs +2 -0
- package/node_modules/tsx/dist/repl.mjs +4 -0
- package/node_modules/tsx/dist/require-CBjy4Foe.mjs +10 -0
- package/node_modules/tsx/dist/require-CVaYn9z3.cjs +1 -0
- package/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
- package/node_modules/tsx/dist/temporary-directory-Du7LpLp9.mjs +1 -0
- package/node_modules/tsx/package.json +70 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +218 -0
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +52 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.d.ts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +36 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +147 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +190 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/node_modules/zod/src/v4/core/compile.ts +2313 -0
- package/node_modules/zod/src/v4/core/core.ts +230 -0
- package/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5192 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/node_modules/zod/src/v4/core/util.ts +1280 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +167 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +36 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +41 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +52 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3798 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +97 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +52 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/node_modules/zod/v4/core/api.cjs +1269 -0
- package/node_modules/zod/v4/core/api.d.cts +335 -0
- package/node_modules/zod/v4/core/api.d.ts +335 -0
- package/node_modules/zod/v4/core/api.js +1107 -0
- package/node_modules/zod/v4/core/checks.cjs +561 -0
- package/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/node_modules/zod/v4/core/checks.js +516 -0
- package/node_modules/zod/v4/core/compile.cjs +1908 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1858 -0
- package/node_modules/zod/v4/core/core.cjs +167 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +61 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/zod/v4/core/doc.js +38 -0
- package/node_modules/zod/v4/core/errors.cjs +317 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/zod/v4/core/errors.js +267 -0
- package/node_modules/zod/v4/core/index.cjs +70 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +233 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/zod/v4/core/parse.js +175 -0
- package/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/node_modules/zod/v4/core/regexes.js +156 -0
- package/node_modules/zod/v4/core/registries.cjs +75 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2669 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1273 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1273 -0
- package/node_modules/zod/v4/core/schemas.js +2606 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/node_modules/zod/v4/core/util.cjs +949 -0
- package/node_modules/zod/v4/core/util.d.cts +278 -0
- package/node_modules/zod/v4/core/util.d.ts +278 -0
- package/node_modules/zod/v4/core/util.js +859 -0
- package/node_modules/zod/v4/core/versions.cjs +27 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +51 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +111 -0
- package/node_modules/zod/v4/locales/az.cjs +137 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +110 -0
- package/node_modules/zod/v4/locales/be.cjs +195 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +168 -0
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +125 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +112 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +116 -0
- package/node_modules/zod/v4/locales/da.cjs +147 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +120 -0
- package/node_modules/zod/v4/locales/de.cjs +140 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +113 -0
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +152 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +125 -0
- package/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +114 -0
- package/node_modules/zod/v4/locales/es.cjs +163 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +136 -0
- package/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +119 -0
- package/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +117 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +129 -0
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +248 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +221 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +113 -0
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +138 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +111 -0
- package/node_modules/zod/v4/locales/index.cjs +152 -0
- package/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/node_modules/zod/v4/locales/index.js +63 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +140 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +113 -0
- package/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +112 -0
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +142 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +115 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +116 -0
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +114 -0
- package/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +112 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +115 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +140 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +113 -0
- package/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +114 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +114 -0
- package/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +119 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +142 -0
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +168 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +114 -0
- package/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +115 -0
- package/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +115 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +142 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +115 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +110 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +115 -0
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +113 -0
- package/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +95 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +51 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +51 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +50 -0
|
@@ -0,0 +1,2855 @@
|
|
|
1
|
+
const FIFO = require('fast-fifo')
|
|
2
|
+
const EventEmitter = require('bare-events')
|
|
3
|
+
const path = require('bare-path')
|
|
4
|
+
const { isURL, fileURLToPath } = require('bare-url')
|
|
5
|
+
const { Readable, Writable } = require('bare-stream')
|
|
6
|
+
const binding = require('./binding')
|
|
7
|
+
const constants = require('./lib/constants')
|
|
8
|
+
const FileError = require('./lib/errors')
|
|
9
|
+
|
|
10
|
+
const isWindows = Bare.platform === 'win32'
|
|
11
|
+
|
|
12
|
+
exports.constants = constants
|
|
13
|
+
|
|
14
|
+
class FileRequest {
|
|
15
|
+
static borrow() {
|
|
16
|
+
if (this._free.length > 0) return this._free.pop()
|
|
17
|
+
return new FileRequest()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static return(req) {
|
|
21
|
+
if (this._free.length < 32) this._free.push(req.reset())
|
|
22
|
+
else req.destroy()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
this._reset()
|
|
27
|
+
this._handle = binding.requestInit(this, this._onresult)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get handle() {
|
|
31
|
+
return this._handle
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
retain(value) {
|
|
35
|
+
this._retain = value // Tie the lifetime of `value` to the lifetime of `this`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
reset() {
|
|
39
|
+
if (this._handle === null) return this
|
|
40
|
+
|
|
41
|
+
binding.requestReset(this._handle)
|
|
42
|
+
|
|
43
|
+
this._reset()
|
|
44
|
+
|
|
45
|
+
return this
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
destroy() {
|
|
49
|
+
if (this._handle === null) return this
|
|
50
|
+
|
|
51
|
+
binding.requestDestroy(this._handle)
|
|
52
|
+
|
|
53
|
+
this._reset()
|
|
54
|
+
this._handle = null
|
|
55
|
+
|
|
56
|
+
return this
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
then(resolve, reject) {
|
|
60
|
+
return this._promise.then(resolve, reject)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return() {
|
|
64
|
+
if (this._handle === null) return this
|
|
65
|
+
|
|
66
|
+
FileRequest.return(this)
|
|
67
|
+
|
|
68
|
+
return this
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_reset() {
|
|
72
|
+
this._promise = new Promise((resolve, reject) => {
|
|
73
|
+
this._resolve = resolve
|
|
74
|
+
this._reject = reject
|
|
75
|
+
})
|
|
76
|
+
this._retain = null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
_onresult(err, status) {
|
|
80
|
+
if (err) this._reject(err)
|
|
81
|
+
else this._resolve(status)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
FileRequest._free = []
|
|
86
|
+
|
|
87
|
+
function ok(result, cb) {
|
|
88
|
+
if (typeof result === 'function') {
|
|
89
|
+
cb = result
|
|
90
|
+
result = undefined
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (cb) cb(null, result)
|
|
94
|
+
else return result
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function fail(err, cb) {
|
|
98
|
+
if (cb) cb(err)
|
|
99
|
+
else throw err
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function done(err, result, cb) {
|
|
103
|
+
if (typeof result === 'function') {
|
|
104
|
+
cb = result
|
|
105
|
+
result = undefined
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (err) fail(err, cb)
|
|
109
|
+
else return ok(result, cb)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async function open(filepath, flags = 'r', mode = 0o666, cb) {
|
|
113
|
+
if (typeof flags === 'function') {
|
|
114
|
+
cb = flags
|
|
115
|
+
flags = 'r'
|
|
116
|
+
mode = 0o666
|
|
117
|
+
} else if (typeof mode === 'function') {
|
|
118
|
+
cb = mode
|
|
119
|
+
mode = 0o666
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (typeof flags === 'string') flags = toFlags(flags)
|
|
123
|
+
if (typeof mode === 'string') mode = toMode(mode)
|
|
124
|
+
|
|
125
|
+
filepath = toNamespacedPath(filepath)
|
|
126
|
+
|
|
127
|
+
const req = FileRequest.borrow()
|
|
128
|
+
|
|
129
|
+
let fd
|
|
130
|
+
let err = null
|
|
131
|
+
try {
|
|
132
|
+
binding.open(req.handle, filepath, flags, mode)
|
|
133
|
+
|
|
134
|
+
fd = await req
|
|
135
|
+
} catch (e) {
|
|
136
|
+
err = new FileError(e.message, {
|
|
137
|
+
operation: 'open',
|
|
138
|
+
code: e.code,
|
|
139
|
+
path: filepath
|
|
140
|
+
})
|
|
141
|
+
} finally {
|
|
142
|
+
req.return()
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return done(err, fd, cb)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function openSync(filepath, flags = 'r', mode = 0o666) {
|
|
149
|
+
if (typeof flags === 'string') flags = toFlags(flags)
|
|
150
|
+
if (typeof mode === 'string') mode = toMode(mode)
|
|
151
|
+
|
|
152
|
+
filepath = toNamespacedPath(filepath)
|
|
153
|
+
|
|
154
|
+
const req = FileRequest.borrow()
|
|
155
|
+
|
|
156
|
+
try {
|
|
157
|
+
return binding.openSync(req.handle, filepath, flags, mode)
|
|
158
|
+
} catch (e) {
|
|
159
|
+
throw new FileError(e.message, {
|
|
160
|
+
operation: 'open',
|
|
161
|
+
code: e.code,
|
|
162
|
+
path: filepath
|
|
163
|
+
})
|
|
164
|
+
} finally {
|
|
165
|
+
req.return()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async function close(fd, cb) {
|
|
170
|
+
const req = FileRequest.borrow()
|
|
171
|
+
|
|
172
|
+
let err = null
|
|
173
|
+
try {
|
|
174
|
+
binding.close(req.handle, fd)
|
|
175
|
+
|
|
176
|
+
await req
|
|
177
|
+
} catch (e) {
|
|
178
|
+
err = new FileError(e.message, { operation: 'close', code: e.code, fd })
|
|
179
|
+
} finally {
|
|
180
|
+
req.return()
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return done(err, cb)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function closeSync(fd) {
|
|
187
|
+
const req = FileRequest.borrow()
|
|
188
|
+
|
|
189
|
+
try {
|
|
190
|
+
binding.closeSync(req.handle, fd)
|
|
191
|
+
} catch (e) {
|
|
192
|
+
throw new FileError(e.message, { operation: 'close', code: e.code, fd })
|
|
193
|
+
} finally {
|
|
194
|
+
req.return()
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async function access(filepath, mode = constants.F_OK, cb) {
|
|
199
|
+
if (typeof mode === 'function') {
|
|
200
|
+
cb = mode
|
|
201
|
+
mode = constants.F_OK
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
filepath = toNamespacedPath(filepath)
|
|
205
|
+
|
|
206
|
+
const req = FileRequest.borrow()
|
|
207
|
+
|
|
208
|
+
let err = null
|
|
209
|
+
try {
|
|
210
|
+
binding.access(req.handle, filepath, mode)
|
|
211
|
+
|
|
212
|
+
await req
|
|
213
|
+
} catch (e) {
|
|
214
|
+
err = new FileError(e.message, {
|
|
215
|
+
operation: 'access',
|
|
216
|
+
code: e.code,
|
|
217
|
+
path: filepath
|
|
218
|
+
})
|
|
219
|
+
} finally {
|
|
220
|
+
req.return()
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return done(err, cb)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function accessSync(filepath, mode = constants.F_OK) {
|
|
227
|
+
filepath = toNamespacedPath(filepath)
|
|
228
|
+
|
|
229
|
+
const req = FileRequest.borrow()
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
binding.accessSync(req.handle, filepath, mode)
|
|
233
|
+
} catch (e) {
|
|
234
|
+
throw new FileError(e.message, {
|
|
235
|
+
operation: 'access',
|
|
236
|
+
code: e.code,
|
|
237
|
+
path: filepath
|
|
238
|
+
})
|
|
239
|
+
} finally {
|
|
240
|
+
req.return()
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
async function exists(filepath, cb) {
|
|
245
|
+
let ok = true
|
|
246
|
+
try {
|
|
247
|
+
await access(filepath)
|
|
248
|
+
} catch {
|
|
249
|
+
ok = false
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return done(null, ok, cb)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function existsSync(filepath) {
|
|
256
|
+
try {
|
|
257
|
+
accessSync(filepath)
|
|
258
|
+
} catch {
|
|
259
|
+
return false
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return true
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
async function read(fd, buffer, offset = 0, len = buffer.byteLength - offset, pos = -1, cb) {
|
|
266
|
+
if (typeof offset === 'function') {
|
|
267
|
+
cb = offset
|
|
268
|
+
offset = 0
|
|
269
|
+
len = buffer.byteLength
|
|
270
|
+
pos = -1
|
|
271
|
+
} else if (typeof len === 'function') {
|
|
272
|
+
cb = len
|
|
273
|
+
len = buffer.byteLength - offset
|
|
274
|
+
pos = -1
|
|
275
|
+
} else if (typeof pos === 'function') {
|
|
276
|
+
cb = pos
|
|
277
|
+
pos = -1
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (typeof pos !== 'number') pos = -1
|
|
281
|
+
|
|
282
|
+
const req = FileRequest.borrow()
|
|
283
|
+
|
|
284
|
+
let bytes
|
|
285
|
+
let err = null
|
|
286
|
+
try {
|
|
287
|
+
binding.read(req.handle, fd, buffer, offset, len, pos)
|
|
288
|
+
|
|
289
|
+
req.retain(buffer)
|
|
290
|
+
|
|
291
|
+
bytes = await req
|
|
292
|
+
} catch (e) {
|
|
293
|
+
err = new FileError(e.message, { operation: 'read', code: e.code, fd })
|
|
294
|
+
} finally {
|
|
295
|
+
req.return()
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return done(err, bytes, cb)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function readSync(fd, buffer, offset = 0, len = buffer.byteLength - offset, pos = -1) {
|
|
302
|
+
const req = FileRequest.borrow()
|
|
303
|
+
|
|
304
|
+
try {
|
|
305
|
+
return binding.readSync(req.handle, fd, buffer, offset, len, pos)
|
|
306
|
+
} catch (e) {
|
|
307
|
+
throw new FileError(e.message, { operation: 'read', code: e.code, fd })
|
|
308
|
+
} finally {
|
|
309
|
+
req.return()
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
async function readv(fd, buffers, pos = -1, cb) {
|
|
314
|
+
if (typeof pos === 'function') {
|
|
315
|
+
cb = pos
|
|
316
|
+
pos = -1
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (typeof pos !== 'number') pos = -1
|
|
320
|
+
|
|
321
|
+
const req = FileRequest.borrow()
|
|
322
|
+
|
|
323
|
+
let bytes
|
|
324
|
+
let err = null
|
|
325
|
+
try {
|
|
326
|
+
binding.readv(req.handle, fd, buffers, pos)
|
|
327
|
+
|
|
328
|
+
req.retain(buffers)
|
|
329
|
+
|
|
330
|
+
bytes = await req
|
|
331
|
+
} catch (e) {
|
|
332
|
+
err = new FileError(e.message, { operation: 'readv', code: e.code, fd })
|
|
333
|
+
} finally {
|
|
334
|
+
req.return()
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return done(err, bytes, cb)
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function readvSync(fd, buffers, pos = -1) {
|
|
341
|
+
if (typeof pos !== 'number') pos = -1
|
|
342
|
+
|
|
343
|
+
const req = FileRequest.borrow()
|
|
344
|
+
|
|
345
|
+
try {
|
|
346
|
+
return binding.readvSync(req.handle, fd, buffers, pos)
|
|
347
|
+
} catch (e) {
|
|
348
|
+
throw new FileError(e.message, { operation: 'readv', code: e.code, fd })
|
|
349
|
+
} finally {
|
|
350
|
+
req.return()
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async function write(fd, data, offset, len, pos = -1, cb) {
|
|
355
|
+
if (typeof data === 'string') {
|
|
356
|
+
let encoding = len
|
|
357
|
+
cb = pos
|
|
358
|
+
pos = offset
|
|
359
|
+
|
|
360
|
+
if (typeof pos === 'function') {
|
|
361
|
+
cb = pos
|
|
362
|
+
pos = -1
|
|
363
|
+
encoding = 'utf8'
|
|
364
|
+
} else if (typeof encoding === 'function') {
|
|
365
|
+
cb = encoding
|
|
366
|
+
encoding = 'utf8'
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (typeof pos === 'string') {
|
|
370
|
+
encoding = pos
|
|
371
|
+
pos = -1
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
data = Buffer.from(data, encoding)
|
|
375
|
+
offset = 0
|
|
376
|
+
len = data.byteLength
|
|
377
|
+
} else if (typeof offset === 'function') {
|
|
378
|
+
cb = offset
|
|
379
|
+
offset = 0
|
|
380
|
+
len = data.byteLength
|
|
381
|
+
pos = -1
|
|
382
|
+
} else if (typeof len === 'function') {
|
|
383
|
+
cb = len
|
|
384
|
+
len = data.byteLength - offset
|
|
385
|
+
pos = -1
|
|
386
|
+
} else if (typeof pos === 'function') {
|
|
387
|
+
cb = pos
|
|
388
|
+
pos = -1
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (typeof offset !== 'number') offset = 0
|
|
392
|
+
if (typeof len !== 'number') len = data.byteLength - offset
|
|
393
|
+
if (typeof pos !== 'number') pos = -1
|
|
394
|
+
|
|
395
|
+
const req = FileRequest.borrow()
|
|
396
|
+
|
|
397
|
+
let bytes
|
|
398
|
+
let err = null
|
|
399
|
+
try {
|
|
400
|
+
binding.write(req.handle, fd, data, offset, len, pos)
|
|
401
|
+
|
|
402
|
+
req.retain(data)
|
|
403
|
+
|
|
404
|
+
bytes = await req
|
|
405
|
+
} catch (e) {
|
|
406
|
+
err = new FileError(e.message, { operation: 'write', code: e.code, fd })
|
|
407
|
+
} finally {
|
|
408
|
+
req.return()
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return done(err, bytes, cb)
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function writeSync(fd, data, offset, len, pos = -1) {
|
|
415
|
+
if (typeof data === 'string') {
|
|
416
|
+
let encoding = len
|
|
417
|
+
pos = offset
|
|
418
|
+
|
|
419
|
+
if (typeof pos === 'string') {
|
|
420
|
+
encoding = pos
|
|
421
|
+
pos = -1
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
data = Buffer.from(data, encoding)
|
|
425
|
+
offset = 0
|
|
426
|
+
len = data.byteLength
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (typeof offset !== 'number') offset = 0
|
|
430
|
+
if (typeof len !== 'number') len = data.byteLength - offset
|
|
431
|
+
if (typeof pos !== 'number') pos = -1
|
|
432
|
+
|
|
433
|
+
const req = FileRequest.borrow()
|
|
434
|
+
|
|
435
|
+
try {
|
|
436
|
+
return binding.writeSync(req.handle, fd, data, offset, len, pos)
|
|
437
|
+
} catch (e) {
|
|
438
|
+
throw new FileError(e.message, { operation: 'write', code: e.code, fd })
|
|
439
|
+
} finally {
|
|
440
|
+
req.return()
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
async function writev(fd, buffers, pos = -1, cb) {
|
|
445
|
+
if (typeof pos === 'function') {
|
|
446
|
+
cb = pos
|
|
447
|
+
pos = -1
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (typeof pos !== 'number') pos = -1
|
|
451
|
+
|
|
452
|
+
const req = FileRequest.borrow()
|
|
453
|
+
|
|
454
|
+
let bytes
|
|
455
|
+
let err = null
|
|
456
|
+
try {
|
|
457
|
+
binding.writev(req.handle, fd, buffers, pos)
|
|
458
|
+
|
|
459
|
+
req.retain(buffers)
|
|
460
|
+
|
|
461
|
+
bytes = await req
|
|
462
|
+
} catch (e) {
|
|
463
|
+
err = new FileError(e.message, { operation: 'writev', code: e.code, fd })
|
|
464
|
+
} finally {
|
|
465
|
+
req.return()
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
return done(err, bytes, cb)
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function writevSync(fd, buffers, pos = -1) {
|
|
472
|
+
if (typeof pos !== 'number') pos = -1
|
|
473
|
+
|
|
474
|
+
const req = FileRequest.borrow()
|
|
475
|
+
|
|
476
|
+
try {
|
|
477
|
+
return binding.writevSync(req.handle, fd, buffers, pos)
|
|
478
|
+
} catch (e) {
|
|
479
|
+
throw new FileError(e.message, { operation: 'writev', code: e.code, fd })
|
|
480
|
+
} finally {
|
|
481
|
+
req.return()
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
async function stat(filepath, cb) {
|
|
486
|
+
filepath = toNamespacedPath(filepath)
|
|
487
|
+
|
|
488
|
+
const req = FileRequest.borrow()
|
|
489
|
+
|
|
490
|
+
let st
|
|
491
|
+
let err = null
|
|
492
|
+
try {
|
|
493
|
+
binding.stat(req.handle, filepath)
|
|
494
|
+
|
|
495
|
+
await req
|
|
496
|
+
|
|
497
|
+
st = new Stats(...binding.requestResultStat(req.handle))
|
|
498
|
+
} catch (e) {
|
|
499
|
+
err = new FileError(e.message, { operation: 'stat', code: e.code, path: filepath })
|
|
500
|
+
} finally {
|
|
501
|
+
req.return()
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
return done(err, st, cb)
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
function statSync(filepath) {
|
|
508
|
+
filepath = toNamespacedPath(filepath)
|
|
509
|
+
|
|
510
|
+
const req = FileRequest.borrow()
|
|
511
|
+
|
|
512
|
+
try {
|
|
513
|
+
binding.statSync(req.handle, filepath)
|
|
514
|
+
|
|
515
|
+
return new Stats(...binding.requestResultStat(req.handle))
|
|
516
|
+
} catch (e) {
|
|
517
|
+
throw new FileError(e.message, { operation: 'stat', code: e.code, path: filepath })
|
|
518
|
+
} finally {
|
|
519
|
+
req.return()
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
async function lstat(filepath, cb) {
|
|
524
|
+
filepath = toNamespacedPath(filepath)
|
|
525
|
+
|
|
526
|
+
const req = FileRequest.borrow()
|
|
527
|
+
|
|
528
|
+
let st
|
|
529
|
+
let err = null
|
|
530
|
+
try {
|
|
531
|
+
binding.lstat(req.handle, filepath)
|
|
532
|
+
|
|
533
|
+
await req
|
|
534
|
+
|
|
535
|
+
st = new Stats(...binding.requestResultStat(req.handle))
|
|
536
|
+
} catch (e) {
|
|
537
|
+
err = new FileError(e.message, { operation: 'lstat', code: e.code, path: filepath })
|
|
538
|
+
} finally {
|
|
539
|
+
req.return()
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return done(err, st, cb)
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function lstatSync(filepath) {
|
|
546
|
+
filepath = toNamespacedPath(filepath)
|
|
547
|
+
|
|
548
|
+
const req = FileRequest.borrow()
|
|
549
|
+
|
|
550
|
+
try {
|
|
551
|
+
binding.lstatSync(req.handle, filepath)
|
|
552
|
+
|
|
553
|
+
return new Stats(...binding.requestResultStat(req.handle))
|
|
554
|
+
} catch (e) {
|
|
555
|
+
throw new FileError(e.message, { operation: 'lstat', code: e.code, path: filepath })
|
|
556
|
+
} finally {
|
|
557
|
+
req.return()
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
async function fstat(fd, cb) {
|
|
562
|
+
const req = FileRequest.borrow()
|
|
563
|
+
|
|
564
|
+
let st
|
|
565
|
+
let err = null
|
|
566
|
+
try {
|
|
567
|
+
binding.fstat(req.handle, fd)
|
|
568
|
+
|
|
569
|
+
await req
|
|
570
|
+
|
|
571
|
+
st = new Stats(...binding.requestResultStat(req.handle))
|
|
572
|
+
} catch (e) {
|
|
573
|
+
err = new FileError(e.message, { operation: 'fstat', code: e.code, fd })
|
|
574
|
+
} finally {
|
|
575
|
+
req.return()
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return done(err, st, cb)
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function fstatSync(fd) {
|
|
582
|
+
const req = FileRequest.borrow()
|
|
583
|
+
|
|
584
|
+
try {
|
|
585
|
+
binding.fstatSync(req.handle, fd)
|
|
586
|
+
|
|
587
|
+
return new Stats(...binding.requestResultStat(req.handle))
|
|
588
|
+
} catch (e) {
|
|
589
|
+
throw new FileError(e.message, { operation: 'fstat', code: e.code, fd })
|
|
590
|
+
} finally {
|
|
591
|
+
req.return()
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
async function statfs(filepath, cb) {
|
|
596
|
+
filepath = toNamespacedPath(filepath)
|
|
597
|
+
|
|
598
|
+
const req = FileRequest.borrow()
|
|
599
|
+
|
|
600
|
+
let st
|
|
601
|
+
let err = null
|
|
602
|
+
try {
|
|
603
|
+
binding.statfs(req.handle, filepath)
|
|
604
|
+
|
|
605
|
+
await req
|
|
606
|
+
|
|
607
|
+
st = new StatFs(...binding.requestResultStatfs(req.handle))
|
|
608
|
+
} catch (e) {
|
|
609
|
+
err = new FileError(e.message, { operation: 'statfs', code: e.code, path: filepath })
|
|
610
|
+
} finally {
|
|
611
|
+
req.return()
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
return done(err, st, cb)
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function statfsSync(filepath) {
|
|
618
|
+
filepath = toNamespacedPath(filepath)
|
|
619
|
+
|
|
620
|
+
const req = FileRequest.borrow()
|
|
621
|
+
|
|
622
|
+
try {
|
|
623
|
+
binding.statfsSync(req.handle, filepath)
|
|
624
|
+
|
|
625
|
+
return new StatFs(...binding.requestResultStatfs(req.handle))
|
|
626
|
+
} catch (e) {
|
|
627
|
+
throw new FileError(e.message, { operation: 'statfs', code: e.code, path: filepath })
|
|
628
|
+
} finally {
|
|
629
|
+
req.return()
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
async function ftruncate(fd, len = 0, cb) {
|
|
634
|
+
if (typeof len === 'function') {
|
|
635
|
+
cb = len
|
|
636
|
+
len = 0
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
if (typeof len !== 'number') len = 0
|
|
640
|
+
|
|
641
|
+
const req = FileRequest.borrow()
|
|
642
|
+
|
|
643
|
+
let err = null
|
|
644
|
+
try {
|
|
645
|
+
binding.ftruncate(req.handle, fd, len)
|
|
646
|
+
|
|
647
|
+
await req
|
|
648
|
+
} catch (e) {
|
|
649
|
+
err = new FileError(e.message, { operation: 'ftruncate', code: e.code, fd })
|
|
650
|
+
} finally {
|
|
651
|
+
req.return()
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
return done(err, cb)
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
function ftruncateSync(fd, len = 0) {
|
|
658
|
+
if (typeof len !== 'number') len = 0
|
|
659
|
+
|
|
660
|
+
const req = FileRequest.borrow()
|
|
661
|
+
|
|
662
|
+
try {
|
|
663
|
+
binding.ftruncateSync(req.handle, fd, len)
|
|
664
|
+
} catch (e) {
|
|
665
|
+
throw new FileError(e.message, { operation: 'ftruncate', code: e.code, fd })
|
|
666
|
+
} finally {
|
|
667
|
+
req.return()
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
async function truncate(filepath, len, cb) {
|
|
672
|
+
let fd = -1
|
|
673
|
+
let err
|
|
674
|
+
|
|
675
|
+
try {
|
|
676
|
+
fd = await open(filepath, 'r+')
|
|
677
|
+
|
|
678
|
+
await ftruncate(fd, len)
|
|
679
|
+
} catch (e) {
|
|
680
|
+
err = e
|
|
681
|
+
} finally {
|
|
682
|
+
if (fd !== -1) await close(fd)
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
return done(err, cb)
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function truncateSync(filepath, len) {
|
|
689
|
+
let fd = -1
|
|
690
|
+
let err
|
|
691
|
+
|
|
692
|
+
try {
|
|
693
|
+
fd = openSync(filepath, 'r+')
|
|
694
|
+
|
|
695
|
+
ftruncateSync(fd, len)
|
|
696
|
+
} catch (e) {
|
|
697
|
+
err = e
|
|
698
|
+
} finally {
|
|
699
|
+
if (fd !== -1) closeSync(fd)
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
async function chmod(filepath, mode, cb) {
|
|
704
|
+
if (typeof mode === 'string') mode = toMode(mode)
|
|
705
|
+
|
|
706
|
+
filepath = toNamespacedPath(filepath)
|
|
707
|
+
|
|
708
|
+
const req = FileRequest.borrow()
|
|
709
|
+
|
|
710
|
+
let err = null
|
|
711
|
+
try {
|
|
712
|
+
binding.chmod(req.handle, filepath, mode)
|
|
713
|
+
|
|
714
|
+
await req
|
|
715
|
+
} catch (e) {
|
|
716
|
+
err = new FileError(e.message, {
|
|
717
|
+
operation: 'chmod',
|
|
718
|
+
code: e.code,
|
|
719
|
+
path: filepath
|
|
720
|
+
})
|
|
721
|
+
} finally {
|
|
722
|
+
req.return()
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return done(err, cb)
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function chmodSync(filepath, mode) {
|
|
729
|
+
if (typeof mode === 'string') mode = toMode(mode)
|
|
730
|
+
|
|
731
|
+
filepath = toNamespacedPath(filepath)
|
|
732
|
+
|
|
733
|
+
const req = FileRequest.borrow()
|
|
734
|
+
|
|
735
|
+
try {
|
|
736
|
+
binding.chmodSync(req.handle, filepath, mode)
|
|
737
|
+
} catch (e) {
|
|
738
|
+
throw new FileError(e.message, {
|
|
739
|
+
operation: 'chmod',
|
|
740
|
+
code: e.code,
|
|
741
|
+
path: filepath
|
|
742
|
+
})
|
|
743
|
+
} finally {
|
|
744
|
+
req.return()
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
async function fchmod(fd, mode, cb) {
|
|
749
|
+
if (typeof mode === 'string') mode = toMode(mode)
|
|
750
|
+
|
|
751
|
+
const req = FileRequest.borrow()
|
|
752
|
+
|
|
753
|
+
let err = null
|
|
754
|
+
try {
|
|
755
|
+
binding.fchmod(req.handle, fd, mode)
|
|
756
|
+
|
|
757
|
+
await req
|
|
758
|
+
} catch (e) {
|
|
759
|
+
err = new FileError(e.message, { operation: 'fchmod', code: e.code, fd })
|
|
760
|
+
} finally {
|
|
761
|
+
req.return()
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return done(err, cb)
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
function fchmodSync(fd, mode) {
|
|
768
|
+
if (typeof mode === 'string') mode = toMode(mode)
|
|
769
|
+
|
|
770
|
+
const req = FileRequest.borrow()
|
|
771
|
+
|
|
772
|
+
try {
|
|
773
|
+
binding.fchmodSync(req.handle, fd, mode)
|
|
774
|
+
} catch (e) {
|
|
775
|
+
throw new FileError(e.message, { operation: 'fchmod', code: e.code, fd })
|
|
776
|
+
} finally {
|
|
777
|
+
req.return()
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
async function chown(filepath, uid, gid, cb) {
|
|
782
|
+
filepath = toNamespacedPath(filepath)
|
|
783
|
+
|
|
784
|
+
const req = FileRequest.borrow()
|
|
785
|
+
|
|
786
|
+
let err = null
|
|
787
|
+
try {
|
|
788
|
+
binding.chown(req.handle, filepath, uid, gid)
|
|
789
|
+
|
|
790
|
+
await req
|
|
791
|
+
} catch (e) {
|
|
792
|
+
err = new FileError(e.message, { operation: 'chown', code: e.code, path: filepath })
|
|
793
|
+
} finally {
|
|
794
|
+
req.return()
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
return done(err, cb)
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function chownSync(filepath, uid, gid) {
|
|
801
|
+
filepath = toNamespacedPath(filepath)
|
|
802
|
+
|
|
803
|
+
const req = FileRequest.borrow()
|
|
804
|
+
|
|
805
|
+
try {
|
|
806
|
+
binding.chownSync(req.handle, filepath, uid, gid)
|
|
807
|
+
} catch (e) {
|
|
808
|
+
throw new FileError(e.message, { operation: 'chownSync', code: e.code, path: filepath })
|
|
809
|
+
} finally {
|
|
810
|
+
req.return()
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
async function lchown(filepath, uid, gid, cb) {
|
|
815
|
+
filepath = toNamespacedPath(filepath)
|
|
816
|
+
|
|
817
|
+
const req = FileRequest.borrow()
|
|
818
|
+
|
|
819
|
+
let err = null
|
|
820
|
+
try {
|
|
821
|
+
binding.lchown(req.handle, filepath, uid, gid)
|
|
822
|
+
|
|
823
|
+
await req
|
|
824
|
+
} catch (e) {
|
|
825
|
+
err = new FileError(e.message, { operation: 'lchown', code: e.code, path: filepath })
|
|
826
|
+
} finally {
|
|
827
|
+
req.return()
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
return done(err, cb)
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
function lchownSync(filepath, uid, gid) {
|
|
834
|
+
filepath = toNamespacedPath(filepath)
|
|
835
|
+
|
|
836
|
+
const req = FileRequest.borrow()
|
|
837
|
+
|
|
838
|
+
try {
|
|
839
|
+
binding.lchownSync(req.handle, filepath, uid, gid)
|
|
840
|
+
} catch (e) {
|
|
841
|
+
throw new FileError(e.message, { operation: 'lchownSync', code: e.code, path: filepath })
|
|
842
|
+
} finally {
|
|
843
|
+
req.return()
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
async function fchown(fd, uid, gid, cb) {
|
|
848
|
+
const req = FileRequest.borrow()
|
|
849
|
+
|
|
850
|
+
let err = null
|
|
851
|
+
try {
|
|
852
|
+
binding.fchown(req.handle, fd, uid, gid)
|
|
853
|
+
|
|
854
|
+
await req
|
|
855
|
+
} catch (e) {
|
|
856
|
+
err = new FileError(e.message, { operation: 'fchown', code: e.code, fd })
|
|
857
|
+
} finally {
|
|
858
|
+
req.return()
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
return done(err, cb)
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
function fchownSync(fd, uid, gid) {
|
|
865
|
+
const req = FileRequest.borrow()
|
|
866
|
+
|
|
867
|
+
try {
|
|
868
|
+
binding.fchownSync(req.handle, fd, uid, gid)
|
|
869
|
+
} catch (e) {
|
|
870
|
+
throw new FileError(e.message, { operation: 'fchownSync', code: e.code, fd })
|
|
871
|
+
} finally {
|
|
872
|
+
req.return()
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
async function utimes(filepath, atime, mtime, cb) {
|
|
877
|
+
if (typeof atime !== 'number') atime = atime.getTime() / 1000
|
|
878
|
+
if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000
|
|
879
|
+
|
|
880
|
+
filepath = toNamespacedPath(filepath)
|
|
881
|
+
|
|
882
|
+
const req = FileRequest.borrow()
|
|
883
|
+
|
|
884
|
+
let err = null
|
|
885
|
+
try {
|
|
886
|
+
binding.utimes(req.handle, filepath, atime, mtime)
|
|
887
|
+
|
|
888
|
+
await req
|
|
889
|
+
} catch (e) {
|
|
890
|
+
err = new FileError(e.message, { operation: 'utimes', code: e.code, path: filepath })
|
|
891
|
+
} finally {
|
|
892
|
+
req.return()
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
return done(err, cb)
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
function utimesSync(filepath, atime, mtime) {
|
|
899
|
+
if (typeof atime !== 'number') atime = atime.getTime() / 1000
|
|
900
|
+
if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000
|
|
901
|
+
|
|
902
|
+
filepath = toNamespacedPath(filepath)
|
|
903
|
+
|
|
904
|
+
const req = FileRequest.borrow()
|
|
905
|
+
|
|
906
|
+
try {
|
|
907
|
+
binding.utimesSync(req.handle, filepath, atime, mtime)
|
|
908
|
+
} catch (e) {
|
|
909
|
+
throw new FileError(e.message, { operation: 'utimes', code: e.code, path: filepath })
|
|
910
|
+
} finally {
|
|
911
|
+
req.return()
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
async function lutimes(filepath, atime, mtime, cb) {
|
|
916
|
+
if (typeof atime !== 'number') atime = atime.getTime() / 1000
|
|
917
|
+
if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000
|
|
918
|
+
|
|
919
|
+
filepath = toNamespacedPath(filepath)
|
|
920
|
+
|
|
921
|
+
const req = FileRequest.borrow()
|
|
922
|
+
|
|
923
|
+
let err = null
|
|
924
|
+
try {
|
|
925
|
+
binding.lutimes(req.handle, filepath, atime, mtime)
|
|
926
|
+
|
|
927
|
+
await req
|
|
928
|
+
} catch (e) {
|
|
929
|
+
err = new FileError(e.message, { operation: 'lutimes', code: e.code, path: filepath })
|
|
930
|
+
} finally {
|
|
931
|
+
req.return()
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
return done(err, cb)
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
function lutimesSync(filepath, atime, mtime) {
|
|
938
|
+
if (typeof atime !== 'number') atime = atime.getTime() / 1000
|
|
939
|
+
if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000
|
|
940
|
+
|
|
941
|
+
filepath = toNamespacedPath(filepath)
|
|
942
|
+
|
|
943
|
+
const req = FileRequest.borrow()
|
|
944
|
+
|
|
945
|
+
try {
|
|
946
|
+
binding.lutimesSync(req.handle, filepath, atime, mtime)
|
|
947
|
+
} catch (e) {
|
|
948
|
+
throw new FileError(e.message, { operation: 'lutimes', code: e.code, path: filepath })
|
|
949
|
+
} finally {
|
|
950
|
+
req.return()
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
async function futimes(fd, atime, mtime, cb) {
|
|
955
|
+
if (typeof atime !== 'number') atime = atime.getTime() / 1000
|
|
956
|
+
if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000
|
|
957
|
+
|
|
958
|
+
const req = FileRequest.borrow()
|
|
959
|
+
|
|
960
|
+
let err = null
|
|
961
|
+
try {
|
|
962
|
+
binding.futimes(req.handle, fd, atime, mtime)
|
|
963
|
+
|
|
964
|
+
await req
|
|
965
|
+
} catch (e) {
|
|
966
|
+
err = new FileError(e.message, { operation: 'futimes', code: e.code, fd })
|
|
967
|
+
} finally {
|
|
968
|
+
req.return()
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
return done(err, cb)
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
function futimesSync(fd, atime, mtime) {
|
|
975
|
+
if (typeof atime !== 'number') atime = atime.getTime() / 1000
|
|
976
|
+
if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000
|
|
977
|
+
|
|
978
|
+
const req = FileRequest.borrow()
|
|
979
|
+
|
|
980
|
+
try {
|
|
981
|
+
binding.futimesSync(req.handle, fd, atime, mtime)
|
|
982
|
+
} catch (e) {
|
|
983
|
+
throw new FileError(e.message, { operation: 'futimesSync', code: e.code, fd })
|
|
984
|
+
} finally {
|
|
985
|
+
req.return()
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
async function link(src, dst, cb) {
|
|
990
|
+
src = toNamespacedPath(src)
|
|
991
|
+
dst = toNamespacedPath(dst)
|
|
992
|
+
|
|
993
|
+
const req = FileRequest.borrow()
|
|
994
|
+
|
|
995
|
+
let err = null
|
|
996
|
+
try {
|
|
997
|
+
binding.link(req.handle, src, dst)
|
|
998
|
+
|
|
999
|
+
await req
|
|
1000
|
+
} catch (e) {
|
|
1001
|
+
err = new FileError(e.message, { operation: 'link', code: e.code, path: src, destination: dst })
|
|
1002
|
+
} finally {
|
|
1003
|
+
req.return()
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
return done(err, cb)
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
function linkSync(src, dst) {
|
|
1010
|
+
src = toNamespacedPath(src)
|
|
1011
|
+
dst = toNamespacedPath(dst)
|
|
1012
|
+
|
|
1013
|
+
const req = FileRequest.borrow()
|
|
1014
|
+
|
|
1015
|
+
try {
|
|
1016
|
+
binding.linkSync(req.handle, src, dst)
|
|
1017
|
+
} catch (e) {
|
|
1018
|
+
throw new FileError(e.message, {
|
|
1019
|
+
operation: 'linkSync',
|
|
1020
|
+
code: e.code,
|
|
1021
|
+
path: src,
|
|
1022
|
+
destination: dst
|
|
1023
|
+
})
|
|
1024
|
+
} finally {
|
|
1025
|
+
req.return()
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
async function mkdir(filepath, opts, cb) {
|
|
1030
|
+
if (typeof opts === 'function') {
|
|
1031
|
+
cb = opts
|
|
1032
|
+
opts = { mode: 0o777 }
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
if (typeof opts === 'number') opts = { mode: opts }
|
|
1036
|
+
else if (!opts) opts = {}
|
|
1037
|
+
|
|
1038
|
+
const mode = typeof opts.mode === 'number' ? opts.mode : 0o777
|
|
1039
|
+
|
|
1040
|
+
filepath = toNamespacedPath(filepath)
|
|
1041
|
+
|
|
1042
|
+
if (opts.recursive) {
|
|
1043
|
+
let err = null
|
|
1044
|
+
try {
|
|
1045
|
+
try {
|
|
1046
|
+
await mkdir(filepath, { mode })
|
|
1047
|
+
} catch (err) {
|
|
1048
|
+
if (err.code !== 'ENOENT') {
|
|
1049
|
+
if (!(await stat(filepath)).isDirectory()) throw err
|
|
1050
|
+
} else {
|
|
1051
|
+
while (filepath.endsWith(path.sep)) filepath = filepath.slice(0, -1)
|
|
1052
|
+
const i = filepath.lastIndexOf(path.sep)
|
|
1053
|
+
if (i <= 0) throw err
|
|
1054
|
+
|
|
1055
|
+
await mkdir(filepath.slice(0, i), { mode, recursive: true })
|
|
1056
|
+
|
|
1057
|
+
try {
|
|
1058
|
+
await mkdir(filepath, { mode })
|
|
1059
|
+
} catch (err) {
|
|
1060
|
+
if (!(await stat(filepath)).isDirectory()) throw err
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
} catch (e) {
|
|
1065
|
+
err = e
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
return done(err, cb)
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
const req = FileRequest.borrow()
|
|
1072
|
+
|
|
1073
|
+
let err = null
|
|
1074
|
+
try {
|
|
1075
|
+
binding.mkdir(req.handle, filepath, mode)
|
|
1076
|
+
|
|
1077
|
+
await req
|
|
1078
|
+
} catch (e) {
|
|
1079
|
+
err = new FileError(e.message, {
|
|
1080
|
+
operation: 'mkdir',
|
|
1081
|
+
code: e.code,
|
|
1082
|
+
path: filepath
|
|
1083
|
+
})
|
|
1084
|
+
} finally {
|
|
1085
|
+
req.return()
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
return done(err, cb)
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
function mkdirSync(filepath, opts) {
|
|
1092
|
+
if (typeof opts === 'number') opts = { mode: opts }
|
|
1093
|
+
else if (!opts) opts = {}
|
|
1094
|
+
|
|
1095
|
+
const mode = typeof opts.mode === 'number' ? opts.mode : 0o777
|
|
1096
|
+
|
|
1097
|
+
filepath = toNamespacedPath(filepath)
|
|
1098
|
+
|
|
1099
|
+
if (opts.recursive) {
|
|
1100
|
+
try {
|
|
1101
|
+
mkdirSync(filepath, { mode })
|
|
1102
|
+
} catch (err) {
|
|
1103
|
+
if (err.code !== 'ENOENT') {
|
|
1104
|
+
if (!statSync(filepath).isDirectory()) throw err
|
|
1105
|
+
} else {
|
|
1106
|
+
while (filepath.endsWith(path.sep)) filepath = filepath.slice(0, -1)
|
|
1107
|
+
const i = filepath.lastIndexOf(path.sep)
|
|
1108
|
+
if (i <= 0) throw err
|
|
1109
|
+
|
|
1110
|
+
mkdirSync(filepath.slice(0, i), { mode, recursive: true })
|
|
1111
|
+
|
|
1112
|
+
try {
|
|
1113
|
+
mkdirSync(filepath, { mode })
|
|
1114
|
+
} catch (err) {
|
|
1115
|
+
if (!statSync(filepath).isDirectory()) throw err
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
return
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
const req = FileRequest.borrow()
|
|
1124
|
+
|
|
1125
|
+
try {
|
|
1126
|
+
binding.mkdirSync(req.handle, filepath, mode)
|
|
1127
|
+
} catch (e) {
|
|
1128
|
+
throw new FileError(e.message, {
|
|
1129
|
+
operation: 'mkdir',
|
|
1130
|
+
code: e.code,
|
|
1131
|
+
path: filepath
|
|
1132
|
+
})
|
|
1133
|
+
} finally {
|
|
1134
|
+
req.return()
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
async function mkdtemp(prefix, cb) {
|
|
1139
|
+
prefix = toNamespacedPath(prefix)
|
|
1140
|
+
|
|
1141
|
+
const req = FileRequest.borrow()
|
|
1142
|
+
|
|
1143
|
+
let res
|
|
1144
|
+
let err = null
|
|
1145
|
+
try {
|
|
1146
|
+
binding.mkdtemp(req.handle, prefix + 'XXXXXX')
|
|
1147
|
+
|
|
1148
|
+
await req
|
|
1149
|
+
|
|
1150
|
+
res = binding.requestResultPath(req.handle)
|
|
1151
|
+
} catch (e) {
|
|
1152
|
+
err = new FileError(e.message, { operation: 'mkdtemp', code: e.code, path: prefix })
|
|
1153
|
+
} finally {
|
|
1154
|
+
req.return()
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
return done(err, res, cb)
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
function mkdtempSync(prefix) {
|
|
1161
|
+
prefix = toNamespacedPath(prefix)
|
|
1162
|
+
|
|
1163
|
+
const req = FileRequest.borrow()
|
|
1164
|
+
|
|
1165
|
+
try {
|
|
1166
|
+
binding.mkdtempSync(req.handle, prefix + 'XXXXXX')
|
|
1167
|
+
|
|
1168
|
+
return binding.requestResultPath(req.handle)
|
|
1169
|
+
} catch (e) {
|
|
1170
|
+
throw new FileError(e.message, { operation: 'mkdtempSync', code: e.code, path: prefix })
|
|
1171
|
+
} finally {
|
|
1172
|
+
req.return()
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
async function rmdir(filepath, cb) {
|
|
1177
|
+
filepath = toNamespacedPath(filepath)
|
|
1178
|
+
|
|
1179
|
+
const req = FileRequest.borrow()
|
|
1180
|
+
|
|
1181
|
+
let err = null
|
|
1182
|
+
try {
|
|
1183
|
+
binding.rmdir(req.handle, filepath)
|
|
1184
|
+
|
|
1185
|
+
await req
|
|
1186
|
+
} catch (e) {
|
|
1187
|
+
err = new FileError(e.message, {
|
|
1188
|
+
operation: 'rmdir',
|
|
1189
|
+
code: e.code,
|
|
1190
|
+
path: filepath
|
|
1191
|
+
})
|
|
1192
|
+
} finally {
|
|
1193
|
+
req.return()
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
return done(err, cb)
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
function rmdirSync(filepath) {
|
|
1200
|
+
filepath = toNamespacedPath(filepath)
|
|
1201
|
+
|
|
1202
|
+
const req = FileRequest.borrow()
|
|
1203
|
+
|
|
1204
|
+
try {
|
|
1205
|
+
binding.rmdirSync(req.handle, filepath)
|
|
1206
|
+
} catch (e) {
|
|
1207
|
+
throw new FileError(e.message, {
|
|
1208
|
+
operation: 'rmdir',
|
|
1209
|
+
code: e.code,
|
|
1210
|
+
path: filepath
|
|
1211
|
+
})
|
|
1212
|
+
} finally {
|
|
1213
|
+
req.return()
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
async function rm(filepath, opts, cb) {
|
|
1218
|
+
if (typeof opts === 'function') {
|
|
1219
|
+
cb = opts
|
|
1220
|
+
opts = {}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
if (!opts) opts = {}
|
|
1224
|
+
|
|
1225
|
+
filepath = toNamespacedPath(filepath)
|
|
1226
|
+
|
|
1227
|
+
let err = null
|
|
1228
|
+
try {
|
|
1229
|
+
const st = await lstat(filepath)
|
|
1230
|
+
|
|
1231
|
+
if (st.isDirectory()) {
|
|
1232
|
+
if (opts.recursive) {
|
|
1233
|
+
try {
|
|
1234
|
+
await rmdir(filepath)
|
|
1235
|
+
} catch (err) {
|
|
1236
|
+
if (err.code !== 'ENOTEMPTY') throw err
|
|
1237
|
+
|
|
1238
|
+
const files = await readdir(filepath)
|
|
1239
|
+
|
|
1240
|
+
for (const file of files) {
|
|
1241
|
+
await rm(filepath + path.sep + file, opts)
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
await rmdir(filepath)
|
|
1245
|
+
}
|
|
1246
|
+
} else {
|
|
1247
|
+
throw new FileError('is a directory', {
|
|
1248
|
+
operation: 'rm',
|
|
1249
|
+
code: 'EISDIR',
|
|
1250
|
+
path: filepath
|
|
1251
|
+
})
|
|
1252
|
+
}
|
|
1253
|
+
} else {
|
|
1254
|
+
await unlink(filepath)
|
|
1255
|
+
}
|
|
1256
|
+
} catch (e) {
|
|
1257
|
+
if (e.code !== 'ENOENT' || !opts.force) err = e
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
return done(err, cb)
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
function rmSync(filepath, opts) {
|
|
1264
|
+
if (!opts) opts = {}
|
|
1265
|
+
|
|
1266
|
+
filepath = toNamespacedPath(filepath)
|
|
1267
|
+
|
|
1268
|
+
try {
|
|
1269
|
+
const st = lstatSync(filepath)
|
|
1270
|
+
|
|
1271
|
+
if (st.isDirectory()) {
|
|
1272
|
+
if (opts.recursive) {
|
|
1273
|
+
try {
|
|
1274
|
+
rmdirSync(filepath)
|
|
1275
|
+
} catch (err) {
|
|
1276
|
+
if (err.code !== 'ENOTEMPTY') throw err
|
|
1277
|
+
|
|
1278
|
+
const files = readdirSync(filepath)
|
|
1279
|
+
|
|
1280
|
+
for (const file of files) {
|
|
1281
|
+
rmSync(filepath + path.sep + file, opts)
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
rmdirSync(filepath)
|
|
1285
|
+
}
|
|
1286
|
+
} else {
|
|
1287
|
+
throw new FileError('is a directory', {
|
|
1288
|
+
operation: 'rm',
|
|
1289
|
+
code: 'EISDIR',
|
|
1290
|
+
path: filepath
|
|
1291
|
+
})
|
|
1292
|
+
}
|
|
1293
|
+
} else {
|
|
1294
|
+
unlinkSync(filepath)
|
|
1295
|
+
}
|
|
1296
|
+
} catch (err) {
|
|
1297
|
+
if (err.code !== 'ENOENT' || !opts.force) throw err
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
async function unlink(filepath, cb) {
|
|
1302
|
+
filepath = toNamespacedPath(filepath)
|
|
1303
|
+
|
|
1304
|
+
const req = FileRequest.borrow()
|
|
1305
|
+
|
|
1306
|
+
let err = null
|
|
1307
|
+
try {
|
|
1308
|
+
binding.unlink(req.handle, filepath)
|
|
1309
|
+
|
|
1310
|
+
await req
|
|
1311
|
+
} catch (e) {
|
|
1312
|
+
err = new FileError(e.message, {
|
|
1313
|
+
operation: 'unlink',
|
|
1314
|
+
code: e.code,
|
|
1315
|
+
path: filepath
|
|
1316
|
+
})
|
|
1317
|
+
} finally {
|
|
1318
|
+
req.return()
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
return done(err, cb)
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function unlinkSync(filepath) {
|
|
1325
|
+
filepath = toNamespacedPath(filepath)
|
|
1326
|
+
|
|
1327
|
+
const req = FileRequest.borrow()
|
|
1328
|
+
|
|
1329
|
+
try {
|
|
1330
|
+
binding.unlinkSync(req.handle, filepath)
|
|
1331
|
+
} catch (e) {
|
|
1332
|
+
throw new FileError(e.message, {
|
|
1333
|
+
operation: 'unlink',
|
|
1334
|
+
code: e.code,
|
|
1335
|
+
path: filepath
|
|
1336
|
+
})
|
|
1337
|
+
} finally {
|
|
1338
|
+
req.return()
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
async function rename(src, dst, cb) {
|
|
1343
|
+
src = toNamespacedPath(src)
|
|
1344
|
+
dst = toNamespacedPath(dst)
|
|
1345
|
+
|
|
1346
|
+
const req = FileRequest.borrow()
|
|
1347
|
+
|
|
1348
|
+
let err = null
|
|
1349
|
+
try {
|
|
1350
|
+
binding.rename(req.handle, src, dst)
|
|
1351
|
+
|
|
1352
|
+
await req
|
|
1353
|
+
} catch (e) {
|
|
1354
|
+
err = new FileError(e.message, {
|
|
1355
|
+
operation: 'rename',
|
|
1356
|
+
code: e.code,
|
|
1357
|
+
path: src,
|
|
1358
|
+
destination: dst
|
|
1359
|
+
})
|
|
1360
|
+
} finally {
|
|
1361
|
+
req.return()
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
return done(err, cb)
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
function renameSync(src, dst) {
|
|
1368
|
+
src = toNamespacedPath(src)
|
|
1369
|
+
dst = toNamespacedPath(dst)
|
|
1370
|
+
|
|
1371
|
+
const req = FileRequest.borrow()
|
|
1372
|
+
|
|
1373
|
+
try {
|
|
1374
|
+
binding.renameSync(req.handle, src, dst)
|
|
1375
|
+
} catch (e) {
|
|
1376
|
+
throw new FileError(e.message, {
|
|
1377
|
+
operation: 'rename',
|
|
1378
|
+
code: e.code,
|
|
1379
|
+
path: src,
|
|
1380
|
+
destination: dst
|
|
1381
|
+
})
|
|
1382
|
+
} finally {
|
|
1383
|
+
req.return()
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
async function copyFile(src, dst, mode = 0, cb) {
|
|
1388
|
+
if (typeof mode === 'function') {
|
|
1389
|
+
cb = mode
|
|
1390
|
+
mode = 0
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
src = toNamespacedPath(src)
|
|
1394
|
+
dst = toNamespacedPath(dst)
|
|
1395
|
+
|
|
1396
|
+
const req = FileRequest.borrow()
|
|
1397
|
+
|
|
1398
|
+
let err = null
|
|
1399
|
+
try {
|
|
1400
|
+
binding.copyfile(req.handle, src, dst, mode)
|
|
1401
|
+
|
|
1402
|
+
await req
|
|
1403
|
+
} catch (e) {
|
|
1404
|
+
err = new FileError(e.message, {
|
|
1405
|
+
operation: 'copyfile',
|
|
1406
|
+
code: e.code,
|
|
1407
|
+
path: src,
|
|
1408
|
+
destination: dst
|
|
1409
|
+
})
|
|
1410
|
+
} finally {
|
|
1411
|
+
req.return()
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
return done(err, cb)
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
function copyFileSync(src, dst, mode = 0) {
|
|
1418
|
+
src = toNamespacedPath(src)
|
|
1419
|
+
dst = toNamespacedPath(dst)
|
|
1420
|
+
|
|
1421
|
+
const req = FileRequest.borrow()
|
|
1422
|
+
|
|
1423
|
+
try {
|
|
1424
|
+
binding.copyfileSync(req.handle, src, dst, mode)
|
|
1425
|
+
} catch (e) {
|
|
1426
|
+
throw new FileError(e.message, {
|
|
1427
|
+
operation: 'copyfile',
|
|
1428
|
+
code: e.code,
|
|
1429
|
+
path: src,
|
|
1430
|
+
destination: dst
|
|
1431
|
+
})
|
|
1432
|
+
} finally {
|
|
1433
|
+
req.return()
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
async function cp(src, dst, opts, cb) {
|
|
1438
|
+
if (typeof opts === 'function') {
|
|
1439
|
+
cb = opts
|
|
1440
|
+
opts = {}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
if (!opts) opts = {}
|
|
1444
|
+
|
|
1445
|
+
src = toNamespacedPath(src)
|
|
1446
|
+
dst = toNamespacedPath(dst)
|
|
1447
|
+
|
|
1448
|
+
let err = null
|
|
1449
|
+
try {
|
|
1450
|
+
const st = await lstat(src)
|
|
1451
|
+
|
|
1452
|
+
if (st.isDirectory()) {
|
|
1453
|
+
if (opts.recursive !== true) {
|
|
1454
|
+
throw new FileError('is a directory', { operation: 'cp', code: 'EISDIR', path: src })
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
try {
|
|
1458
|
+
await lstat(dst)
|
|
1459
|
+
} catch (e) {
|
|
1460
|
+
if (e.code !== 'ENOENT') throw e
|
|
1461
|
+
|
|
1462
|
+
await mkdir(dst, { mode: st.mode, recursive: true })
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
const dir = await opendir(src)
|
|
1466
|
+
for await (const { name } of dir) {
|
|
1467
|
+
await cp(path.join(src, name), path.join(dst, name), opts)
|
|
1468
|
+
}
|
|
1469
|
+
} else if (st.isFile()) {
|
|
1470
|
+
await copyFile(src, dst)
|
|
1471
|
+
await chmod(dst, st.mode)
|
|
1472
|
+
}
|
|
1473
|
+
} catch (e) {
|
|
1474
|
+
err = e
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
return done(err, cb)
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
function cpSync(src, dst, opts = {}) {
|
|
1481
|
+
src = toNamespacedPath(src)
|
|
1482
|
+
dst = toNamespacedPath(dst)
|
|
1483
|
+
|
|
1484
|
+
const st = lstatSync(src)
|
|
1485
|
+
|
|
1486
|
+
if (st.isDirectory()) {
|
|
1487
|
+
if (opts.recursive !== true) {
|
|
1488
|
+
throw new FileError('is a directory', { operation: 'cp', code: 'EISDIR', path: src })
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
try {
|
|
1492
|
+
lstatSync(dst)
|
|
1493
|
+
} catch (e) {
|
|
1494
|
+
if (e.code !== 'ENOENT') throw e
|
|
1495
|
+
|
|
1496
|
+
mkdirSync(dst, { mode: st.mode, recursive: true })
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
const dir = opendirSync(src)
|
|
1500
|
+
for (const { name } of dir) {
|
|
1501
|
+
cpSync(path.join(src, name), path.join(dst, name), opts)
|
|
1502
|
+
}
|
|
1503
|
+
} else if (st.isFile()) {
|
|
1504
|
+
copyFileSync(src, dst)
|
|
1505
|
+
chmodSync(dst, st.mode)
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
async function realpath(filepath, opts, cb) {
|
|
1510
|
+
if (typeof opts === 'function') {
|
|
1511
|
+
cb = opts
|
|
1512
|
+
opts = {}
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1516
|
+
else if (!opts) opts = {}
|
|
1517
|
+
|
|
1518
|
+
const { encoding = 'utf8' } = opts
|
|
1519
|
+
|
|
1520
|
+
filepath = toNamespacedPath(filepath)
|
|
1521
|
+
|
|
1522
|
+
const req = FileRequest.borrow()
|
|
1523
|
+
|
|
1524
|
+
let res
|
|
1525
|
+
let err = null
|
|
1526
|
+
try {
|
|
1527
|
+
binding.realpath(req.handle, filepath)
|
|
1528
|
+
|
|
1529
|
+
await req
|
|
1530
|
+
|
|
1531
|
+
res = Buffer.from(binding.requestResultString(req.handle))
|
|
1532
|
+
|
|
1533
|
+
if (encoding !== 'buffer') res = res.toString(encoding)
|
|
1534
|
+
} catch (e) {
|
|
1535
|
+
err = new FileError(e.message, {
|
|
1536
|
+
operation: 'realpath',
|
|
1537
|
+
code: e.code,
|
|
1538
|
+
path: filepath
|
|
1539
|
+
})
|
|
1540
|
+
} finally {
|
|
1541
|
+
req.return()
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
return done(err, res, cb)
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
function realpathSync(filepath, opts) {
|
|
1548
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1549
|
+
else if (!opts) opts = {}
|
|
1550
|
+
|
|
1551
|
+
const { encoding = 'utf8' } = opts
|
|
1552
|
+
|
|
1553
|
+
filepath = toNamespacedPath(filepath)
|
|
1554
|
+
|
|
1555
|
+
const req = FileRequest.borrow()
|
|
1556
|
+
|
|
1557
|
+
try {
|
|
1558
|
+
binding.realpathSync(req.handle, filepath)
|
|
1559
|
+
|
|
1560
|
+
let res = Buffer.from(binding.requestResultString(req.handle))
|
|
1561
|
+
|
|
1562
|
+
if (encoding !== 'buffer') res = res.toString(encoding)
|
|
1563
|
+
|
|
1564
|
+
return res
|
|
1565
|
+
} catch (e) {
|
|
1566
|
+
throw new FileError(e.message, {
|
|
1567
|
+
operation: 'realpath',
|
|
1568
|
+
code: e.code,
|
|
1569
|
+
path: filepath
|
|
1570
|
+
})
|
|
1571
|
+
} finally {
|
|
1572
|
+
req.return()
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
async function readlink(filepath, opts, cb) {
|
|
1577
|
+
if (typeof opts === 'function') {
|
|
1578
|
+
cb = opts
|
|
1579
|
+
opts = {}
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1583
|
+
else if (!opts) opts = {}
|
|
1584
|
+
|
|
1585
|
+
const { encoding = 'utf8' } = opts
|
|
1586
|
+
|
|
1587
|
+
filepath = toNamespacedPath(filepath)
|
|
1588
|
+
|
|
1589
|
+
const req = FileRequest.borrow()
|
|
1590
|
+
|
|
1591
|
+
let res
|
|
1592
|
+
let err = null
|
|
1593
|
+
try {
|
|
1594
|
+
binding.readlink(req.handle, filepath)
|
|
1595
|
+
|
|
1596
|
+
await req
|
|
1597
|
+
|
|
1598
|
+
res = Buffer.from(binding.requestResultString(req.handle))
|
|
1599
|
+
|
|
1600
|
+
if (encoding !== 'buffer') res = res.toString(encoding)
|
|
1601
|
+
} catch (e) {
|
|
1602
|
+
err = new FileError(e.message, {
|
|
1603
|
+
operation: 'readlink',
|
|
1604
|
+
code: e.code,
|
|
1605
|
+
path: filepath
|
|
1606
|
+
})
|
|
1607
|
+
} finally {
|
|
1608
|
+
req.return()
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
return done(err, res, cb)
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
function readlinkSync(filepath, opts) {
|
|
1615
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1616
|
+
else if (!opts) opts = {}
|
|
1617
|
+
|
|
1618
|
+
const { encoding = 'utf8' } = opts
|
|
1619
|
+
|
|
1620
|
+
filepath = toNamespacedPath(filepath)
|
|
1621
|
+
|
|
1622
|
+
const req = FileRequest.borrow()
|
|
1623
|
+
|
|
1624
|
+
try {
|
|
1625
|
+
binding.readlinkSync(req.handle, filepath)
|
|
1626
|
+
|
|
1627
|
+
let res = Buffer.from(binding.requestResultString(req.handle))
|
|
1628
|
+
|
|
1629
|
+
if (encoding !== 'buffer') res = res.toString(encoding)
|
|
1630
|
+
|
|
1631
|
+
return res
|
|
1632
|
+
} catch (e) {
|
|
1633
|
+
throw new FileError(e.message, {
|
|
1634
|
+
operation: 'readlink',
|
|
1635
|
+
code: e.code,
|
|
1636
|
+
path: filepath
|
|
1637
|
+
})
|
|
1638
|
+
} finally {
|
|
1639
|
+
req.return()
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
async function fsync(fd, cb) {
|
|
1644
|
+
const req = FileRequest.borrow()
|
|
1645
|
+
|
|
1646
|
+
let err = null
|
|
1647
|
+
try {
|
|
1648
|
+
binding.fsync(req.handle, fd)
|
|
1649
|
+
|
|
1650
|
+
await req
|
|
1651
|
+
} catch (e) {
|
|
1652
|
+
err = new FileError(e.message, { operation: 'fsync', code: e.code, fd })
|
|
1653
|
+
} finally {
|
|
1654
|
+
req.return()
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
return done(err, cb)
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
function fsyncSync(fd) {
|
|
1661
|
+
const req = FileRequest.borrow()
|
|
1662
|
+
|
|
1663
|
+
try {
|
|
1664
|
+
binding.fsyncSync(req.handle, fd)
|
|
1665
|
+
} catch (e) {
|
|
1666
|
+
throw new FileError(e.message, { operation: 'fsyncSync', code: e.code, fd })
|
|
1667
|
+
} finally {
|
|
1668
|
+
req.return()
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
async function fdatasync(fd, cb) {
|
|
1673
|
+
const req = FileRequest.borrow()
|
|
1674
|
+
|
|
1675
|
+
let err = null
|
|
1676
|
+
try {
|
|
1677
|
+
binding.fdatasync(req.handle, fd)
|
|
1678
|
+
|
|
1679
|
+
await req
|
|
1680
|
+
} catch (e) {
|
|
1681
|
+
err = new FileError(e.message, { operation: 'fdatasync', code: e.code, fd })
|
|
1682
|
+
} finally {
|
|
1683
|
+
req.return()
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
return done(err, cb)
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
function fdatasyncSync(fd) {
|
|
1690
|
+
const req = FileRequest.borrow()
|
|
1691
|
+
|
|
1692
|
+
try {
|
|
1693
|
+
binding.fdatasyncSync(req.handle, fd)
|
|
1694
|
+
} catch (e) {
|
|
1695
|
+
throw new FileError(e.message, { operation: 'fdatasyncSync', code: e.code, fd })
|
|
1696
|
+
} finally {
|
|
1697
|
+
req.return()
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
function normalizeSymlinkTarget(target, type, filepath) {
|
|
1702
|
+
if (isWindows) {
|
|
1703
|
+
if (type === constants.UV_FS_SYMLINK_JUNCTION) target = path.resolve(filepath, '..', target)
|
|
1704
|
+
|
|
1705
|
+
if (path.isAbsolute(target)) return path.toNamespacedPath(target)
|
|
1706
|
+
|
|
1707
|
+
return target.replace(/\//g, path.sep)
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
return target
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
async function symlink(target, filepath, type, cb) {
|
|
1714
|
+
if (typeof type === 'function') {
|
|
1715
|
+
cb = type
|
|
1716
|
+
type = null
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
filepath = toNamespacedPath(filepath)
|
|
1720
|
+
|
|
1721
|
+
if (typeof type === 'string') {
|
|
1722
|
+
switch (type) {
|
|
1723
|
+
case 'dir':
|
|
1724
|
+
type = constants.UV_FS_SYMLINK_DIR
|
|
1725
|
+
break
|
|
1726
|
+
case 'junction':
|
|
1727
|
+
type = constants.UV_FS_SYMLINK_JUNCTION
|
|
1728
|
+
break
|
|
1729
|
+
case 'file':
|
|
1730
|
+
default:
|
|
1731
|
+
type = 0
|
|
1732
|
+
break
|
|
1733
|
+
}
|
|
1734
|
+
} else if (typeof type !== 'number') {
|
|
1735
|
+
if (isWindows) {
|
|
1736
|
+
target = path.resolve(filepath, '..', target)
|
|
1737
|
+
|
|
1738
|
+
try {
|
|
1739
|
+
type = (await stat(target)).isDirectory()
|
|
1740
|
+
? constants.UV_FS_SYMLINK_DIR
|
|
1741
|
+
: constants.UV_FS_SYMLINK_JUNCTION
|
|
1742
|
+
} catch {
|
|
1743
|
+
type = 0
|
|
1744
|
+
}
|
|
1745
|
+
} else {
|
|
1746
|
+
type = 0
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
target = normalizeSymlinkTarget(target, type, filepath)
|
|
1751
|
+
|
|
1752
|
+
const req = FileRequest.borrow()
|
|
1753
|
+
|
|
1754
|
+
let err = null
|
|
1755
|
+
try {
|
|
1756
|
+
binding.symlink(req.handle, target, filepath, type)
|
|
1757
|
+
|
|
1758
|
+
await req
|
|
1759
|
+
} catch (e) {
|
|
1760
|
+
err = new FileError(e.message, {
|
|
1761
|
+
operation: 'symlink',
|
|
1762
|
+
code: e.code,
|
|
1763
|
+
path: target,
|
|
1764
|
+
destination: filepath
|
|
1765
|
+
})
|
|
1766
|
+
} finally {
|
|
1767
|
+
req.return()
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
return done(err, cb)
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
function symlinkSync(target, filepath, type) {
|
|
1774
|
+
filepath = toNamespacedPath(filepath)
|
|
1775
|
+
|
|
1776
|
+
if (typeof type === 'string') {
|
|
1777
|
+
switch (type) {
|
|
1778
|
+
case 'dir':
|
|
1779
|
+
type = constants.UV_FS_SYMLINK_DIR
|
|
1780
|
+
break
|
|
1781
|
+
case 'junction':
|
|
1782
|
+
type = constants.UV_FS_SYMLINK_JUNCTION
|
|
1783
|
+
break
|
|
1784
|
+
case 'file':
|
|
1785
|
+
default:
|
|
1786
|
+
type = 0
|
|
1787
|
+
break
|
|
1788
|
+
}
|
|
1789
|
+
} else if (typeof type !== 'number') {
|
|
1790
|
+
if (isWindows) {
|
|
1791
|
+
target = path.resolve(filepath, '..', target)
|
|
1792
|
+
|
|
1793
|
+
try {
|
|
1794
|
+
type = statSync(target).isDirectory()
|
|
1795
|
+
? constants.UV_FS_SYMLINK_DIR
|
|
1796
|
+
: constants.UV_FS_SYMLINK_JUNCTION
|
|
1797
|
+
} catch {
|
|
1798
|
+
type = 0
|
|
1799
|
+
}
|
|
1800
|
+
} else {
|
|
1801
|
+
type = 0
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
target = normalizeSymlinkTarget(target, type, filepath)
|
|
1806
|
+
|
|
1807
|
+
const req = FileRequest.borrow()
|
|
1808
|
+
|
|
1809
|
+
try {
|
|
1810
|
+
binding.symlinkSync(req.handle, target, filepath, type)
|
|
1811
|
+
} catch (e) {
|
|
1812
|
+
throw new FileError(e.message, {
|
|
1813
|
+
operation: 'symlink',
|
|
1814
|
+
code: e.code,
|
|
1815
|
+
path: target,
|
|
1816
|
+
destination: filepath
|
|
1817
|
+
})
|
|
1818
|
+
} finally {
|
|
1819
|
+
req.return()
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
async function opendir(filepath, opts, cb) {
|
|
1824
|
+
if (typeof opts === 'function') {
|
|
1825
|
+
cb = opts
|
|
1826
|
+
opts = {}
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1830
|
+
else if (!opts) opts = {}
|
|
1831
|
+
|
|
1832
|
+
filepath = toNamespacedPath(filepath)
|
|
1833
|
+
|
|
1834
|
+
const req = FileRequest.borrow()
|
|
1835
|
+
|
|
1836
|
+
let dir
|
|
1837
|
+
let err = null
|
|
1838
|
+
try {
|
|
1839
|
+
binding.opendir(req.handle, filepath)
|
|
1840
|
+
|
|
1841
|
+
await req
|
|
1842
|
+
|
|
1843
|
+
dir = new Dir(filepath, binding.requestResultDir(req.handle), opts)
|
|
1844
|
+
} catch (e) {
|
|
1845
|
+
err = new FileError(e.message, {
|
|
1846
|
+
operation: 'opendir',
|
|
1847
|
+
code: e.code,
|
|
1848
|
+
path: filepath
|
|
1849
|
+
})
|
|
1850
|
+
} finally {
|
|
1851
|
+
req.return()
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
return done(err, dir, cb)
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
function opendirSync(filepath, opts) {
|
|
1858
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1859
|
+
else if (!opts) opts = {}
|
|
1860
|
+
|
|
1861
|
+
filepath = toNamespacedPath(filepath)
|
|
1862
|
+
|
|
1863
|
+
const req = FileRequest.borrow()
|
|
1864
|
+
|
|
1865
|
+
try {
|
|
1866
|
+
binding.opendirSync(req.handle, filepath)
|
|
1867
|
+
|
|
1868
|
+
return new Dir(filepath, binding.requestResultDir(req.handle), opts)
|
|
1869
|
+
} catch (e) {
|
|
1870
|
+
throw new FileError(e.message, {
|
|
1871
|
+
operation: 'opendir',
|
|
1872
|
+
code: e.code,
|
|
1873
|
+
path: filepath
|
|
1874
|
+
})
|
|
1875
|
+
} finally {
|
|
1876
|
+
req.return()
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
async function readdir(filepath, opts, cb) {
|
|
1881
|
+
if (typeof opts === 'function') {
|
|
1882
|
+
cb = opts
|
|
1883
|
+
opts = {}
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1887
|
+
else if (!opts) opts = {}
|
|
1888
|
+
|
|
1889
|
+
const { withFileTypes = false, recursive = false } = opts
|
|
1890
|
+
|
|
1891
|
+
filepath = toNamespacedPath(filepath)
|
|
1892
|
+
|
|
1893
|
+
const queue = [filepath]
|
|
1894
|
+
let result = []
|
|
1895
|
+
let err = null
|
|
1896
|
+
try {
|
|
1897
|
+
while (queue.length !== 0) {
|
|
1898
|
+
const dir = await opendir(queue.pop())
|
|
1899
|
+
|
|
1900
|
+
for await (const entry of dir) {
|
|
1901
|
+
const entryPath = path.join(entry.parentPath, entry.name)
|
|
1902
|
+
|
|
1903
|
+
if (withFileTypes) {
|
|
1904
|
+
result.push(entry)
|
|
1905
|
+
} else {
|
|
1906
|
+
result.push(path.relative(filepath, entryPath))
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
if (recursive && entry.isDirectory()) queue.push(entryPath)
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
} catch (e) {
|
|
1913
|
+
result = []
|
|
1914
|
+
err = e
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
return done(err, result, cb)
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
function readdirSync(filepath, opts) {
|
|
1921
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1922
|
+
else if (!opts) opts = {}
|
|
1923
|
+
|
|
1924
|
+
const { withFileTypes = false, recursive = false } = opts
|
|
1925
|
+
|
|
1926
|
+
filepath = toNamespacedPath(filepath)
|
|
1927
|
+
|
|
1928
|
+
const queue = [filepath]
|
|
1929
|
+
const result = []
|
|
1930
|
+
|
|
1931
|
+
while (queue.length !== 0) {
|
|
1932
|
+
const dir = opendirSync(queue.pop(), opts)
|
|
1933
|
+
|
|
1934
|
+
for (const entry of dir) {
|
|
1935
|
+
const entryPath = path.join(entry.parentPath, entry.name)
|
|
1936
|
+
|
|
1937
|
+
if (withFileTypes) {
|
|
1938
|
+
result.push(entry)
|
|
1939
|
+
} else {
|
|
1940
|
+
result.push(path.relative(filepath, entryPath))
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
if (recursive && entry.isDirectory()) queue.push(entryPath)
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
return result
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
async function readFile(filepath, opts, cb) {
|
|
1951
|
+
if (typeof opts === 'function') {
|
|
1952
|
+
cb = opts
|
|
1953
|
+
opts = {}
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
1957
|
+
else if (!opts) opts = {}
|
|
1958
|
+
|
|
1959
|
+
const { encoding = 'buffer' } = opts
|
|
1960
|
+
|
|
1961
|
+
let fd = -1
|
|
1962
|
+
let buffer = null
|
|
1963
|
+
let err = null
|
|
1964
|
+
try {
|
|
1965
|
+
fd = await open(filepath, opts.flag || 'r')
|
|
1966
|
+
|
|
1967
|
+
const st = await fstat(fd)
|
|
1968
|
+
|
|
1969
|
+
let len = 0
|
|
1970
|
+
|
|
1971
|
+
if (st.size === 0) {
|
|
1972
|
+
const buffers = []
|
|
1973
|
+
|
|
1974
|
+
while (true) {
|
|
1975
|
+
buffer = Buffer.allocUnsafe(8192)
|
|
1976
|
+
const r = await read(fd, buffer)
|
|
1977
|
+
len += r
|
|
1978
|
+
if (r === 0) break
|
|
1979
|
+
buffers.push(buffer.subarray(0, r))
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
buffer = Buffer.concat(buffers)
|
|
1983
|
+
} else {
|
|
1984
|
+
buffer = Buffer.allocUnsafe(st.size)
|
|
1985
|
+
|
|
1986
|
+
while (true) {
|
|
1987
|
+
const r = await read(fd, len ? buffer.subarray(len) : buffer)
|
|
1988
|
+
len += r
|
|
1989
|
+
if (r === 0 || len === buffer.byteLength) break
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
if (len !== buffer.byteLength) buffer = buffer.subarray(0, len)
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
if (encoding !== 'buffer') buffer = buffer.toString(encoding)
|
|
1996
|
+
} catch (e) {
|
|
1997
|
+
err = e
|
|
1998
|
+
} finally {
|
|
1999
|
+
if (fd !== -1) await close(fd)
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
return done(err, buffer, cb)
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
function readFileSync(filepath, opts) {
|
|
2006
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
2007
|
+
else if (!opts) opts = {}
|
|
2008
|
+
|
|
2009
|
+
const { encoding = 'buffer' } = opts
|
|
2010
|
+
|
|
2011
|
+
let fd = -1
|
|
2012
|
+
try {
|
|
2013
|
+
fd = openSync(filepath, opts.flag || 'r')
|
|
2014
|
+
|
|
2015
|
+
const st = fstatSync(fd)
|
|
2016
|
+
|
|
2017
|
+
let buffer
|
|
2018
|
+
let len = 0
|
|
2019
|
+
|
|
2020
|
+
if (st.size === 0) {
|
|
2021
|
+
const buffers = []
|
|
2022
|
+
|
|
2023
|
+
while (true) {
|
|
2024
|
+
buffer = Buffer.allocUnsafe(8192)
|
|
2025
|
+
const r = readSync(fd, buffer)
|
|
2026
|
+
len += r
|
|
2027
|
+
if (r === 0) break
|
|
2028
|
+
buffers.push(buffer.subarray(0, r))
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
buffer = Buffer.concat(buffers)
|
|
2032
|
+
} else {
|
|
2033
|
+
buffer = Buffer.allocUnsafe(st.size)
|
|
2034
|
+
|
|
2035
|
+
while (true) {
|
|
2036
|
+
const r = readSync(fd, len ? buffer.subarray(len) : buffer)
|
|
2037
|
+
len += r
|
|
2038
|
+
if (r === 0 || len === buffer.byteLength) break
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
if (len !== buffer.byteLength) buffer = buffer.subarray(0, len)
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
if (encoding !== 'buffer') buffer = buffer.toString(encoding)
|
|
2045
|
+
|
|
2046
|
+
return buffer
|
|
2047
|
+
} finally {
|
|
2048
|
+
if (fd !== -1) closeSync(fd)
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
async function writeFile(filepath, data, opts, cb) {
|
|
2053
|
+
if (typeof opts === 'function') {
|
|
2054
|
+
cb = opts
|
|
2055
|
+
opts = {}
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
2059
|
+
else if (!opts) opts = {}
|
|
2060
|
+
|
|
2061
|
+
if (typeof data === 'string') data = Buffer.from(data, opts.encoding)
|
|
2062
|
+
|
|
2063
|
+
let fd = -1
|
|
2064
|
+
let len = 0
|
|
2065
|
+
let err = null
|
|
2066
|
+
try {
|
|
2067
|
+
fd = await open(filepath, opts.flag || 'w', opts.mode || 0o666)
|
|
2068
|
+
|
|
2069
|
+
while (true) {
|
|
2070
|
+
len += await write(fd, len ? data.subarray(len) : data)
|
|
2071
|
+
if (len === data.byteLength) break
|
|
2072
|
+
}
|
|
2073
|
+
} catch (e) {
|
|
2074
|
+
err = e
|
|
2075
|
+
} finally {
|
|
2076
|
+
if (fd !== -1) await close(fd)
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
return done(err, len, cb)
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
function writeFileSync(filepath, data, opts) {
|
|
2083
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
2084
|
+
else if (!opts) opts = {}
|
|
2085
|
+
|
|
2086
|
+
if (typeof data === 'string') data = Buffer.from(data, opts.encoding)
|
|
2087
|
+
|
|
2088
|
+
let fd = -1
|
|
2089
|
+
try {
|
|
2090
|
+
fd = openSync(filepath, opts.flag || 'w', opts.mode || 0o666)
|
|
2091
|
+
|
|
2092
|
+
let len = 0
|
|
2093
|
+
|
|
2094
|
+
while (true) {
|
|
2095
|
+
len += writeSync(fd, len ? data.subarray(len) : data)
|
|
2096
|
+
if (len === data.byteLength) break
|
|
2097
|
+
}
|
|
2098
|
+
} finally {
|
|
2099
|
+
if (fd !== -1) closeSync(fd)
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
function appendFile(filepath, data, opts, cb) {
|
|
2104
|
+
if (typeof opts === 'function') {
|
|
2105
|
+
cb = opts
|
|
2106
|
+
opts = {}
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
2110
|
+
else if (!opts) opts = {}
|
|
2111
|
+
|
|
2112
|
+
if (!opts.flag) opts = { ...opts, flag: 'a' }
|
|
2113
|
+
|
|
2114
|
+
return writeFile(filepath, data, opts, cb)
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
function appendFileSync(filepath, data, opts) {
|
|
2118
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
2119
|
+
else if (!opts) opts = {}
|
|
2120
|
+
|
|
2121
|
+
if (!opts.flag) opts = { ...opts, flag: 'a' }
|
|
2122
|
+
|
|
2123
|
+
return writeFileSync(filepath, data, opts)
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
function watch(filepath, opts, cb) {
|
|
2127
|
+
if (typeof opts === 'function') {
|
|
2128
|
+
cb = opts
|
|
2129
|
+
opts = {}
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
if (typeof opts === 'string') opts = { encoding: opts }
|
|
2133
|
+
else if (!opts) opts = {}
|
|
2134
|
+
|
|
2135
|
+
filepath = toNamespacedPath(filepath)
|
|
2136
|
+
|
|
2137
|
+
return new Watcher(filepath, opts, cb)
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
class Stats {
|
|
2141
|
+
constructor(
|
|
2142
|
+
dev,
|
|
2143
|
+
mode,
|
|
2144
|
+
nlink,
|
|
2145
|
+
uid,
|
|
2146
|
+
gid,
|
|
2147
|
+
rdev,
|
|
2148
|
+
blksize,
|
|
2149
|
+
ino,
|
|
2150
|
+
size,
|
|
2151
|
+
blocks,
|
|
2152
|
+
atimeMs,
|
|
2153
|
+
mtimeMs,
|
|
2154
|
+
ctimeMs,
|
|
2155
|
+
birthtimeMs
|
|
2156
|
+
) {
|
|
2157
|
+
this.dev = dev
|
|
2158
|
+
this.mode = mode
|
|
2159
|
+
this.nlink = nlink
|
|
2160
|
+
this.uid = uid
|
|
2161
|
+
this.gid = gid
|
|
2162
|
+
this.rdev = rdev
|
|
2163
|
+
this.blksize = blksize
|
|
2164
|
+
this.ino = ino
|
|
2165
|
+
this.size = size
|
|
2166
|
+
this.blocks = blocks
|
|
2167
|
+
this.atimeMs = atimeMs
|
|
2168
|
+
this.mtimeMs = mtimeMs
|
|
2169
|
+
this.ctimeMs = ctimeMs
|
|
2170
|
+
this.birthtimeMs = birthtimeMs
|
|
2171
|
+
this.atime = new Date(atimeMs)
|
|
2172
|
+
this.mtime = new Date(mtimeMs)
|
|
2173
|
+
this.ctime = new Date(ctimeMs)
|
|
2174
|
+
this.birthtime = new Date(birthtimeMs)
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
isDirectory() {
|
|
2178
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFDIR
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
isFile() {
|
|
2182
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFREG
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
isBlockDevice() {
|
|
2186
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFBLK
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
isCharacterDevice() {
|
|
2190
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFCHR
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
isFIFO() {
|
|
2194
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFIFO
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
isSymbolicLink() {
|
|
2198
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFLNK
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
isSocket() {
|
|
2202
|
+
return (this.mode & constants.S_IFMT) === constants.S_IFSOCK
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
class StatFs {
|
|
2207
|
+
constructor(type, bsize, blocks, bfree, bavail, files, ffree, frsize) {
|
|
2208
|
+
this.type = type
|
|
2209
|
+
this.bsize = bsize
|
|
2210
|
+
this.blocks = blocks
|
|
2211
|
+
this.bfree = bfree
|
|
2212
|
+
this.bavail = bavail
|
|
2213
|
+
this.files = files
|
|
2214
|
+
this.ffree = ffree
|
|
2215
|
+
this.frsize = frsize
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
class Dir {
|
|
2220
|
+
constructor(path, handle, opts = {}) {
|
|
2221
|
+
const { encoding = 'utf8', bufferSize = 32 } = opts
|
|
2222
|
+
|
|
2223
|
+
this.path = path
|
|
2224
|
+
|
|
2225
|
+
this._encoding = encoding
|
|
2226
|
+
this._capacity = bufferSize
|
|
2227
|
+
this._buffer = new FIFO()
|
|
2228
|
+
this._ended = false
|
|
2229
|
+
this._handle = handle
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
async read(cb) {
|
|
2233
|
+
if (this._buffer.length) return ok(this._buffer.shift(), cb)
|
|
2234
|
+
if (this._ended) return ok(null, cb)
|
|
2235
|
+
|
|
2236
|
+
const req = FileRequest.borrow()
|
|
2237
|
+
|
|
2238
|
+
let entries
|
|
2239
|
+
let err = null
|
|
2240
|
+
try {
|
|
2241
|
+
req.retain(binding.readdir(req.handle, this._handle, this._capacity))
|
|
2242
|
+
|
|
2243
|
+
await req
|
|
2244
|
+
|
|
2245
|
+
entries = binding.requestResultDirents(req.handle)
|
|
2246
|
+
} catch (e) {
|
|
2247
|
+
err = new FileError(e.message, {
|
|
2248
|
+
operation: 'readdir',
|
|
2249
|
+
code: e.code,
|
|
2250
|
+
path: this.path
|
|
2251
|
+
})
|
|
2252
|
+
} finally {
|
|
2253
|
+
req.return()
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
if (err) return fail(err, cb)
|
|
2257
|
+
|
|
2258
|
+
if (entries.length === 0) {
|
|
2259
|
+
this._ended = true
|
|
2260
|
+
|
|
2261
|
+
return ok(null, cb)
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
for (const entry of entries) {
|
|
2265
|
+
let name = Buffer.from(entry.name)
|
|
2266
|
+
|
|
2267
|
+
if (this._encoding !== 'buffer') name = name.toString(this._encoding)
|
|
2268
|
+
|
|
2269
|
+
this._buffer.push(new Dirent(this.path, name, entry.type))
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
return ok(this._buffer.shift(), cb)
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
readSync() {
|
|
2276
|
+
if (this._buffer.length) return this._buffer.shift()
|
|
2277
|
+
if (this._ended) return null
|
|
2278
|
+
|
|
2279
|
+
const req = FileRequest.borrow()
|
|
2280
|
+
|
|
2281
|
+
let entries
|
|
2282
|
+
try {
|
|
2283
|
+
req.retain(binding.readdirSync(req.handle, this._handle, this._capacity))
|
|
2284
|
+
|
|
2285
|
+
entries = binding.requestResultDirents(req.handle)
|
|
2286
|
+
} catch (e) {
|
|
2287
|
+
throw new FileError(e.message, {
|
|
2288
|
+
operation: 'readdir',
|
|
2289
|
+
code: e.code,
|
|
2290
|
+
path: this.path
|
|
2291
|
+
})
|
|
2292
|
+
} finally {
|
|
2293
|
+
req.return()
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
if (entries.length === 0) {
|
|
2297
|
+
this._ended = true
|
|
2298
|
+
|
|
2299
|
+
return null
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
for (const entry of entries) {
|
|
2303
|
+
let name = Buffer.from(entry.name)
|
|
2304
|
+
|
|
2305
|
+
if (this._encoding !== 'buffer') name = name.toString(this._encoding)
|
|
2306
|
+
|
|
2307
|
+
this._buffer.push(new Dirent(this.path, name, entry.type))
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
return this._buffer.shift()
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
async close(cb) {
|
|
2314
|
+
const req = FileRequest.borrow()
|
|
2315
|
+
|
|
2316
|
+
let err = null
|
|
2317
|
+
try {
|
|
2318
|
+
binding.closedir(req.handle, this._handle)
|
|
2319
|
+
|
|
2320
|
+
await req
|
|
2321
|
+
} catch (e) {
|
|
2322
|
+
err = new FileError(e.message, {
|
|
2323
|
+
operation: 'closedir',
|
|
2324
|
+
code: e.code,
|
|
2325
|
+
path: this.path
|
|
2326
|
+
})
|
|
2327
|
+
} finally {
|
|
2328
|
+
req.return()
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
this._handle = null
|
|
2332
|
+
|
|
2333
|
+
return done(err, cb)
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
closeSync() {
|
|
2337
|
+
const req = FileRequest.borrow()
|
|
2338
|
+
|
|
2339
|
+
try {
|
|
2340
|
+
binding.closedirSync(req.handle, this._handle)
|
|
2341
|
+
} catch (e) {
|
|
2342
|
+
throw new FileError(e.message, {
|
|
2343
|
+
operation: 'closedir',
|
|
2344
|
+
code: e.code,
|
|
2345
|
+
path: this.path
|
|
2346
|
+
})
|
|
2347
|
+
} finally {
|
|
2348
|
+
req.return()
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
this._handle = null
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
[Symbol.dispose]() {
|
|
2355
|
+
this.closeSync()
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
async [Symbol.asyncDispose]() {
|
|
2359
|
+
await this.close()
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
*[Symbol.iterator]() {
|
|
2363
|
+
while (true) {
|
|
2364
|
+
const entry = this.readSync()
|
|
2365
|
+
if (entry === null) break
|
|
2366
|
+
yield entry
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
this.closeSync()
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
async *[Symbol.asyncIterator]() {
|
|
2373
|
+
while (true) {
|
|
2374
|
+
const entry = await this.read()
|
|
2375
|
+
if (entry === null) break
|
|
2376
|
+
yield entry
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
await this.close()
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
class Dirent {
|
|
2384
|
+
constructor(parentPath, name, type) {
|
|
2385
|
+
this.parentPath = parentPath
|
|
2386
|
+
this.name = name
|
|
2387
|
+
this.type = type
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
isFile() {
|
|
2391
|
+
return this.type === constants.UV_DIRENT_FILE
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
isDirectory() {
|
|
2395
|
+
return this.type === constants.UV_DIRENT_DIR
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
isSymbolicLink() {
|
|
2399
|
+
return this.type === constants.UV_DIRENT_LINK
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
isFIFO() {
|
|
2403
|
+
return this.type === constants.UV_DIRENT_FIFO
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
isSocket() {
|
|
2407
|
+
return this.type === constants.UV_DIRENT_SOCKET
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
isCharacterDevice() {
|
|
2411
|
+
return this.type === constants.UV_DIRENT_CHAR
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
isBlockDevice() {
|
|
2415
|
+
return this.type === constants.UV_DIRENT_BLOCK
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
class FileReadStream extends Readable {
|
|
2420
|
+
constructor(path, opts = {}) {
|
|
2421
|
+
const { eagerOpen = true } = opts
|
|
2422
|
+
|
|
2423
|
+
super({ eagerOpen, ...opts })
|
|
2424
|
+
|
|
2425
|
+
this.path = path
|
|
2426
|
+
this.fd = typeof opts.fd === 'number' ? opts.fd : -1
|
|
2427
|
+
this.flags = opts.flags || 'r'
|
|
2428
|
+
this.mode = opts.mode || 0o666
|
|
2429
|
+
|
|
2430
|
+
this._offset = opts.start || 0
|
|
2431
|
+
this._missing = 0
|
|
2432
|
+
|
|
2433
|
+
if (opts.length) {
|
|
2434
|
+
this._missing = opts.length
|
|
2435
|
+
} else if (typeof opts.end === 'number') {
|
|
2436
|
+
this._missing = opts.end - this._offset + 1
|
|
2437
|
+
} else {
|
|
2438
|
+
this._missing = -1
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
async _open(cb) {
|
|
2443
|
+
let err
|
|
2444
|
+
|
|
2445
|
+
if (this.fd === -1) {
|
|
2446
|
+
err = null
|
|
2447
|
+
try {
|
|
2448
|
+
this.fd = await open(this.path, this.flags, this.mode)
|
|
2449
|
+
} catch (e) {
|
|
2450
|
+
err = e
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
if (err) return cb(err)
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
let st
|
|
2457
|
+
err = null
|
|
2458
|
+
try {
|
|
2459
|
+
st = await fstat(this.fd)
|
|
2460
|
+
} catch (e) {
|
|
2461
|
+
err = e
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
if (err) return cb(err)
|
|
2465
|
+
|
|
2466
|
+
this._isCharacterDevice = st.isCharacterDevice()
|
|
2467
|
+
|
|
2468
|
+
if (this._isCharacterDevice) {
|
|
2469
|
+
this._missing = Infinity
|
|
2470
|
+
} else {
|
|
2471
|
+
if (this._missing === -1) this._missing = st.size
|
|
2472
|
+
|
|
2473
|
+
if (st.size < this._offset) {
|
|
2474
|
+
this._offset = st.size
|
|
2475
|
+
this._missing = 0
|
|
2476
|
+
} else if (st.size < this._offset + this._missing) {
|
|
2477
|
+
this._missing = st.size - this._offset
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
cb(null)
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
async _read(size) {
|
|
2485
|
+
if (this._missing <= 0) return this.push(null)
|
|
2486
|
+
|
|
2487
|
+
const data = Buffer.allocUnsafe(Math.min(this._missing, size))
|
|
2488
|
+
|
|
2489
|
+
let len
|
|
2490
|
+
let err = null
|
|
2491
|
+
try {
|
|
2492
|
+
len = await read(
|
|
2493
|
+
this.fd,
|
|
2494
|
+
data,
|
|
2495
|
+
0,
|
|
2496
|
+
data.byteLength,
|
|
2497
|
+
this._isCharacterDevice ? -1 : this._offset
|
|
2498
|
+
)
|
|
2499
|
+
} catch (e) {
|
|
2500
|
+
err = e
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
if (err) return this.destroy(err)
|
|
2504
|
+
|
|
2505
|
+
if (len === 0) return this.push(null)
|
|
2506
|
+
|
|
2507
|
+
if (this._missing < len) len = this._missing
|
|
2508
|
+
|
|
2509
|
+
this._missing -= len
|
|
2510
|
+
this._offset += len
|
|
2511
|
+
|
|
2512
|
+
this.push(data.subarray(0, len))
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
async _destroy(err, cb) {
|
|
2516
|
+
if (this.fd === -1) return cb(err)
|
|
2517
|
+
|
|
2518
|
+
try {
|
|
2519
|
+
await close(this.fd)
|
|
2520
|
+
} catch (e) {
|
|
2521
|
+
err = err || e
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
cb(err)
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
class FileWriteStream extends Writable {
|
|
2529
|
+
constructor(path, opts = {}) {
|
|
2530
|
+
const { eagerOpen = true } = opts
|
|
2531
|
+
|
|
2532
|
+
super({ eagerOpen, ...opts })
|
|
2533
|
+
|
|
2534
|
+
this.path = path
|
|
2535
|
+
this.fd = typeof opts.fd === 'number' ? opts.fd : -1
|
|
2536
|
+
this.flags = opts.flags || 'w'
|
|
2537
|
+
this.mode = opts.mode || 0o666
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
async _open(cb) {
|
|
2541
|
+
if (this.fd !== -1) return cb(null)
|
|
2542
|
+
|
|
2543
|
+
let err = null
|
|
2544
|
+
try {
|
|
2545
|
+
this.fd = await open(this.path, this.flags, this.mode)
|
|
2546
|
+
} catch (e) {
|
|
2547
|
+
err = e
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
cb(err)
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
async _writev(batch, cb) {
|
|
2554
|
+
let err = null
|
|
2555
|
+
try {
|
|
2556
|
+
await writev(
|
|
2557
|
+
this.fd,
|
|
2558
|
+
batch.map(({ chunk }) => chunk)
|
|
2559
|
+
)
|
|
2560
|
+
} catch (e) {
|
|
2561
|
+
err = e
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
cb(err)
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
async _destroy(err, cb) {
|
|
2568
|
+
if (this.fd === -1) return cb(err)
|
|
2569
|
+
|
|
2570
|
+
try {
|
|
2571
|
+
await close(this.fd)
|
|
2572
|
+
} catch (e) {
|
|
2573
|
+
err = err || e
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
cb(err)
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
class Watcher extends EventEmitter {
|
|
2581
|
+
constructor(path, opts, onchange) {
|
|
2582
|
+
if (typeof opts === 'function') {
|
|
2583
|
+
onchange = opts
|
|
2584
|
+
opts = {}
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
if (!opts) opts = {}
|
|
2588
|
+
|
|
2589
|
+
const { persistent = true, recursive = false, encoding = 'utf8' } = opts
|
|
2590
|
+
|
|
2591
|
+
super()
|
|
2592
|
+
|
|
2593
|
+
this._closed = false
|
|
2594
|
+
this._encoding = encoding
|
|
2595
|
+
this._handle = binding.watcherInit(path, recursive, this, this._onevent, this._onclose)
|
|
2596
|
+
|
|
2597
|
+
if (!persistent) this.unref()
|
|
2598
|
+
|
|
2599
|
+
if (onchange) this.on('change', onchange)
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
close() {
|
|
2603
|
+
if (this._closed) return
|
|
2604
|
+
this._closed = true
|
|
2605
|
+
|
|
2606
|
+
binding.watcherClose(this._handle)
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
ref() {
|
|
2610
|
+
if (this._handle) binding.watcherRef(this._handle)
|
|
2611
|
+
return this
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
unref() {
|
|
2615
|
+
if (this._handle) binding.watcherUnref(this._handle)
|
|
2616
|
+
return this
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
[Symbol.asyncIterator]() {
|
|
2620
|
+
const buffer = []
|
|
2621
|
+
let done = false
|
|
2622
|
+
let error = null
|
|
2623
|
+
let next = null
|
|
2624
|
+
|
|
2625
|
+
this.on('change', (eventType, filename) => {
|
|
2626
|
+
if (next) {
|
|
2627
|
+
next.resolve({ done: false, value: { eventType, filename } })
|
|
2628
|
+
next = null
|
|
2629
|
+
} else {
|
|
2630
|
+
buffer.push({ eventType, filename })
|
|
2631
|
+
}
|
|
2632
|
+
})
|
|
2633
|
+
.on('error', (err) => {
|
|
2634
|
+
done = true
|
|
2635
|
+
error = err
|
|
2636
|
+
|
|
2637
|
+
if (next) {
|
|
2638
|
+
next.reject(error)
|
|
2639
|
+
next = null
|
|
2640
|
+
}
|
|
2641
|
+
})
|
|
2642
|
+
.on('close', () => {
|
|
2643
|
+
done = true
|
|
2644
|
+
|
|
2645
|
+
if (next) {
|
|
2646
|
+
next.resolve({ done })
|
|
2647
|
+
next = null
|
|
2648
|
+
}
|
|
2649
|
+
})
|
|
2650
|
+
|
|
2651
|
+
return {
|
|
2652
|
+
next: () =>
|
|
2653
|
+
new Promise((resolve, reject) => {
|
|
2654
|
+
if (error) return reject(error)
|
|
2655
|
+
|
|
2656
|
+
if (buffer.length) return resolve({ done: false, value: buffer.shift() })
|
|
2657
|
+
|
|
2658
|
+
if (done) return resolve({ done })
|
|
2659
|
+
|
|
2660
|
+
next = { resolve, reject }
|
|
2661
|
+
})
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
_onevent(err, events, filename) {
|
|
2666
|
+
if (err) {
|
|
2667
|
+
this.close()
|
|
2668
|
+
this.emit('error', err)
|
|
2669
|
+
} else {
|
|
2670
|
+
const path =
|
|
2671
|
+
this._encoding === 'buffer'
|
|
2672
|
+
? Buffer.from(filename)
|
|
2673
|
+
: Buffer.from(filename).toString(this._encoding)
|
|
2674
|
+
|
|
2675
|
+
if (events & binding.UV_RENAME) {
|
|
2676
|
+
this.emit('change', 'rename', path)
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
if (events & binding.UV_CHANGE) {
|
|
2680
|
+
this.emit('change', 'change', path)
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
_onclose() {
|
|
2686
|
+
this._handle = null
|
|
2687
|
+
|
|
2688
|
+
this.emit('close')
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
exports.access = access
|
|
2693
|
+
exports.appendFile = appendFile
|
|
2694
|
+
exports.chmod = chmod
|
|
2695
|
+
exports.chown = chown
|
|
2696
|
+
exports.close = close
|
|
2697
|
+
exports.copyFile = copyFile
|
|
2698
|
+
exports.cp = cp
|
|
2699
|
+
exports.exists = exists
|
|
2700
|
+
exports.fchmod = fchmod
|
|
2701
|
+
exports.fchown = fchown
|
|
2702
|
+
exports.fdatasync = fdatasync
|
|
2703
|
+
exports.fstat = fstat
|
|
2704
|
+
exports.fsync = fsync
|
|
2705
|
+
exports.ftruncate = ftruncate
|
|
2706
|
+
exports.futimes = futimes
|
|
2707
|
+
exports.lchown = lchown
|
|
2708
|
+
exports.lutimes = lutimes
|
|
2709
|
+
exports.link = link
|
|
2710
|
+
exports.lstat = lstat
|
|
2711
|
+
exports.mkdir = mkdir
|
|
2712
|
+
exports.mkdtemp = mkdtemp
|
|
2713
|
+
exports.open = open
|
|
2714
|
+
exports.opendir = opendir
|
|
2715
|
+
exports.read = read
|
|
2716
|
+
exports.readFile = readFile
|
|
2717
|
+
exports.readdir = readdir
|
|
2718
|
+
exports.readlink = readlink
|
|
2719
|
+
exports.readv = readv
|
|
2720
|
+
exports.realpath = realpath
|
|
2721
|
+
exports.rename = rename
|
|
2722
|
+
exports.rm = rm
|
|
2723
|
+
exports.rmdir = rmdir
|
|
2724
|
+
exports.stat = stat
|
|
2725
|
+
exports.statfs = statfs
|
|
2726
|
+
exports.symlink = symlink
|
|
2727
|
+
exports.truncate = truncate
|
|
2728
|
+
exports.unlink = unlink
|
|
2729
|
+
exports.utimes = utimes
|
|
2730
|
+
exports.watch = watch
|
|
2731
|
+
exports.write = write
|
|
2732
|
+
exports.writeFile = writeFile
|
|
2733
|
+
exports.writev = writev
|
|
2734
|
+
|
|
2735
|
+
exports.accessSync = accessSync
|
|
2736
|
+
exports.appendFileSync = appendFileSync
|
|
2737
|
+
exports.chmodSync = chmodSync
|
|
2738
|
+
exports.chownSync = chownSync
|
|
2739
|
+
exports.closeSync = closeSync
|
|
2740
|
+
exports.copyFileSync = copyFileSync
|
|
2741
|
+
exports.cpSync = cpSync
|
|
2742
|
+
exports.existsSync = existsSync
|
|
2743
|
+
exports.fchmodSync = fchmodSync
|
|
2744
|
+
exports.fchownSync = fchownSync
|
|
2745
|
+
exports.fdatasyncSync = fdatasyncSync
|
|
2746
|
+
exports.fstatSync = fstatSync
|
|
2747
|
+
exports.fsyncSync = fsyncSync
|
|
2748
|
+
exports.ftruncateSync = ftruncateSync
|
|
2749
|
+
exports.futimesSync = futimesSync
|
|
2750
|
+
exports.lchownSync = lchownSync
|
|
2751
|
+
exports.lutimesSync = lutimesSync
|
|
2752
|
+
exports.linkSync = linkSync
|
|
2753
|
+
exports.lstatSync = lstatSync
|
|
2754
|
+
exports.mkdirSync = mkdirSync
|
|
2755
|
+
exports.mkdtempSync = mkdtempSync
|
|
2756
|
+
exports.openSync = openSync
|
|
2757
|
+
exports.opendirSync = opendirSync
|
|
2758
|
+
exports.readFileSync = readFileSync
|
|
2759
|
+
exports.readSync = readSync
|
|
2760
|
+
exports.readdirSync = readdirSync
|
|
2761
|
+
exports.readlinkSync = readlinkSync
|
|
2762
|
+
exports.readvSync = readvSync
|
|
2763
|
+
exports.realpathSync = realpathSync
|
|
2764
|
+
exports.renameSync = renameSync
|
|
2765
|
+
exports.rmSync = rmSync
|
|
2766
|
+
exports.rmdirSync = rmdirSync
|
|
2767
|
+
exports.statSync = statSync
|
|
2768
|
+
exports.statfsSync = statfsSync
|
|
2769
|
+
exports.symlinkSync = symlinkSync
|
|
2770
|
+
exports.truncateSync = truncateSync
|
|
2771
|
+
exports.unlinkSync = unlinkSync
|
|
2772
|
+
exports.utimesSync = utimesSync
|
|
2773
|
+
exports.writeFileSync = writeFileSync
|
|
2774
|
+
exports.writeSync = writeSync
|
|
2775
|
+
exports.writevSync = writevSync
|
|
2776
|
+
|
|
2777
|
+
exports.promises = require('./promises')
|
|
2778
|
+
|
|
2779
|
+
exports.Stats = Stats
|
|
2780
|
+
exports.StatFs = StatFs
|
|
2781
|
+
exports.Dir = Dir
|
|
2782
|
+
exports.Dirent = Dirent
|
|
2783
|
+
exports.Watcher = Watcher
|
|
2784
|
+
|
|
2785
|
+
exports.ReadStream = FileReadStream
|
|
2786
|
+
|
|
2787
|
+
exports.createReadStream = function createReadStream(path, opts) {
|
|
2788
|
+
return new FileReadStream(path, opts)
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
exports.WriteStream = FileWriteStream
|
|
2792
|
+
|
|
2793
|
+
exports.createWriteStream = function createWriteStream(path, opts) {
|
|
2794
|
+
return new FileWriteStream(path, opts)
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
function toNamespacedPath(filepath) {
|
|
2798
|
+
if (typeof filepath !== 'string') {
|
|
2799
|
+
if (isURL(filepath)) filepath = fileURLToPath(filepath)
|
|
2800
|
+
else filepath = filepath.toString()
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
return path.toNamespacedPath(filepath)
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
function toFlags(flags) {
|
|
2807
|
+
switch (flags) {
|
|
2808
|
+
case 'r':
|
|
2809
|
+
return constants.O_RDONLY
|
|
2810
|
+
case 'rs': // Fall through.
|
|
2811
|
+
case 'sr':
|
|
2812
|
+
return constants.O_RDONLY | constants.O_SYNC
|
|
2813
|
+
case 'r+':
|
|
2814
|
+
return constants.O_RDWR
|
|
2815
|
+
case 'rs+': // Fall through.
|
|
2816
|
+
case 'sr+':
|
|
2817
|
+
return constants.O_RDWR | constants.O_SYNC
|
|
2818
|
+
|
|
2819
|
+
case 'w':
|
|
2820
|
+
return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY
|
|
2821
|
+
case 'wx': // Fall through.
|
|
2822
|
+
case 'xw':
|
|
2823
|
+
return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY | constants.O_EXCL
|
|
2824
|
+
|
|
2825
|
+
case 'w+':
|
|
2826
|
+
return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR
|
|
2827
|
+
case 'wx+': // Fall through.
|
|
2828
|
+
case 'xw+':
|
|
2829
|
+
return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR | constants.O_EXCL
|
|
2830
|
+
|
|
2831
|
+
case 'a':
|
|
2832
|
+
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY
|
|
2833
|
+
case 'ax': // Fall through.
|
|
2834
|
+
case 'xa':
|
|
2835
|
+
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | constants.O_EXCL
|
|
2836
|
+
case 'as': // Fall through.
|
|
2837
|
+
case 'sa':
|
|
2838
|
+
return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | constants.O_SYNC
|
|
2839
|
+
|
|
2840
|
+
case 'a+':
|
|
2841
|
+
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR
|
|
2842
|
+
case 'ax+': // Fall through.
|
|
2843
|
+
case 'xa+':
|
|
2844
|
+
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR | constants.O_EXCL
|
|
2845
|
+
case 'as+': // Fall through.
|
|
2846
|
+
case 'sa+':
|
|
2847
|
+
return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR | constants.O_SYNC
|
|
2848
|
+
default:
|
|
2849
|
+
return 0
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
function toMode(mode) {
|
|
2854
|
+
return parseInt(mode, 8)
|
|
2855
|
+
}
|