effect 4.0.0-beta.30 → 4.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +87 -86
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +47 -40
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +46 -45
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +35 -38
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +39 -32
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +32 -29
- package/dist/BigInt.js.map +1 -1
- package/dist/Channel.d.ts +2 -2
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +58 -57
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +20 -21
- package/dist/Chunk.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +4 -1
- package/dist/Config.js.map +1 -1
- package/dist/Cron.d.ts +3 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +11 -18
- package/dist/Cron.js.map +1 -1
- package/dist/DateTime.d.ts +49 -92
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +9 -9
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +7 -5
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +7 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +55 -25
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +100 -70
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +3 -4
- package/dist/Effect.js.map +1 -1
- package/dist/Fiber.d.ts +2 -1
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +9 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +8 -7
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +20 -19
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +6 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +17 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +10 -7
- package/dist/FileSystem.js.map +1 -1
- package/dist/Graph.d.ts +64 -64
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +53 -53
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +11 -5
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +3 -1
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +11 -11
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +12 -12
- package/dist/Iterable.js.map +1 -1
- package/dist/Latch.d.ts +69 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +58 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +181 -2
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +35 -2
- package/dist/Layer.js.map +1 -1
- package/dist/Number.d.ts +74 -18
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +34 -15
- package/dist/Number.js.map +1 -1
- package/dist/Option.d.ts +2 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +183 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -0
- package/dist/PartitionedSemaphore.js +231 -0
- package/dist/PartitionedSemaphore.js.map +1 -0
- package/dist/PubSub.d.ts +5 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +6 -5
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +3 -3
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +2 -2
- package/dist/Queue.js.map +1 -1
- package/dist/Record.d.ts +40 -40
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +16 -15
- package/dist/Record.js.map +1 -1
- package/dist/Scheduler.d.ts +25 -123
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +20 -123
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2346 -114
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +1359 -68
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +2 -2
- package/dist/SchemaAST.js +2 -2
- package/dist/SchemaGetter.js +6 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +32 -27
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Semaphore.d.ts +149 -53
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +137 -117
- package/dist/Semaphore.js.map +1 -1
- package/dist/ServiceMap.d.ts +26 -0
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +36 -21
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Stream.js +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +114 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +29 -47
- package/dist/String.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +1 -2
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +81 -115
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Terminal.d.ts +2 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +5 -4
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +2 -1
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +26 -14
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +8 -4
- package/dist/Trie.js.map +1 -1
- package/dist/TxHashMap.d.ts +77 -59
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +25 -19
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxSemaphore.d.ts +162 -2
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +16 -2
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/index.d.ts +88 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/dateTime.js +66 -59
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +21 -90
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +2 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/option.js +6 -0
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/trie.js +3 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +3 -4
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +2 -2
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +30 -16
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +10 -87
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +4 -0
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +14 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +13 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -3
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +3 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +4 -3
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +3 -2
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +3 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +16 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -0
- package/dist/unstable/cli/Completions.js +23 -0
- package/dist/unstable/cli/Completions.js.map +1 -0
- package/dist/unstable/cli/Flag.d.ts +2 -2
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +4 -4
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +14 -12
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +7 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +71 -67
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +4 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +4 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +9 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +8 -3
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +3 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +25 -23
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +3 -2
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +7 -7
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +4 -3
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +3 -2
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +12 -12
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +9 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +2 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +7 -6
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +19 -13
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +5 -4
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +4 -4
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +19 -18
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +9 -10
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +2 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +1 -4
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +8 -8
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +5 -4
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +3 -4
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +5 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +3 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +2 -1
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -1
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +4 -3
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +8 -6
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +2 -1
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +3 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +16 -15
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +3 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +2 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +7 -7
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +2 -2
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +2 -1
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +3 -2
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +14 -10
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +4 -3
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +27 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +5 -4
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +5 -6
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +4 -2
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +15 -0
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +81 -3
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -2
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +7 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -5
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +4 -2
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -3
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +4 -4
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +1 -3
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +3 -2
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +4 -1
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +3 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +2 -1
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +1 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +6 -6
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +2 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +5 -4
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +19 -14
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +112 -105
- package/src/BigDecimal.ts +63 -66
- package/src/BigInt.ts +49 -41
- package/src/Channel.ts +3 -3
- package/src/Chunk.ts +68 -63
- package/src/Config.ts +4 -1
- package/src/Cron.ts +13 -18
- package/src/DateTime.ts +51 -92
- package/src/Deferred.ts +8 -6
- package/src/Duration.ts +112 -56
- package/src/Effect.ts +3 -4
- package/src/Fiber.ts +2 -1
- package/src/FiberHandle.ts +10 -9
- package/src/FiberMap.ts +22 -22
- package/src/FileSystem.ts +25 -22
- package/src/Graph.ts +105 -105
- package/src/HashMap.ts +11 -5
- package/src/Iterable.ts +13 -13
- package/src/Latch.ts +85 -3
- package/src/Layer.ts +244 -19
- package/src/Number.ts +85 -26
- package/src/Option.ts +2 -0
- package/src/PartitionedSemaphore.ts +414 -0
- package/src/PubSub.ts +7 -6
- package/src/Queue.ts +5 -5
- package/src/Record.ts +52 -47
- package/src/Scheduler.ts +37 -126
- package/src/Schema.ts +2366 -116
- package/src/SchemaAST.ts +2 -2
- package/src/SchemaGetter.ts +4 -4
- package/src/SchemaRepresentation.ts +2 -2
- package/src/SchemaTransformation.ts +27 -27
- package/src/Semaphore.ts +271 -183
- package/src/ServiceMap.ts +83 -31
- package/src/Stream.ts +1 -1
- package/src/String.ts +122 -69
- package/src/SubscriptionRef.ts +96 -117
- package/src/Terminal.ts +2 -1
- package/src/Tracer.ts +6 -5
- package/src/Trie.ts +26 -14
- package/src/TxHashMap.ts +78 -60
- package/src/TxSemaphore.ts +186 -11
- package/src/index.ts +89 -33
- package/src/internal/dateTime.ts +74 -65
- package/src/internal/effect.ts +30 -122
- package/src/internal/hashMap.ts +4 -3
- package/src/internal/option.ts +7 -0
- package/src/internal/trie.ts +6 -6
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -0
- package/src/unstable/ai/Chat.ts +17 -15
- package/src/unstable/ai/LanguageModel.ts +148 -97
- package/src/unstable/ai/OpenAiStructuredOutput.ts +4 -0
- package/src/unstable/ai/Tool.ts +20 -0
- package/src/unstable/cli/Argument.ts +2 -4
- package/src/unstable/cli/CliOutput.ts +7 -5
- package/src/unstable/cli/Command.ts +5 -5
- package/src/unstable/cli/Completions.ts +36 -0
- package/src/unstable/cli/Flag.ts +2 -2
- package/src/unstable/cli/GlobalFlag.ts +4 -5
- package/src/unstable/cli/HelpDoc.ts +14 -12
- package/src/unstable/cli/Param.ts +15 -11
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +81 -83
- package/src/unstable/cli/index.ts +5 -0
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +3 -2
- package/src/unstable/cli/internal/parser.ts +7 -4
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -30
- package/src/unstable/cluster/DeliverAt.ts +1 -1
- package/src/unstable/cluster/Entity.ts +13 -12
- package/src/unstable/cluster/Message.ts +6 -5
- package/src/unstable/cluster/MessageStorage.ts +26 -25
- package/src/unstable/cluster/Reply.ts +7 -4
- package/src/unstable/cluster/RunnerServer.ts +10 -13
- package/src/unstable/cluster/Runners.ts +8 -7
- package/src/unstable/cluster/Sharding.ts +24 -17
- package/src/unstable/cluster/ShardingConfig.ts +6 -6
- package/src/unstable/cluster/SqlMessageStorage.ts +21 -18
- package/src/unstable/cluster/internal/entityManager.ts +27 -21
- package/src/unstable/devtools/DevToolsSchema.ts +3 -2
- package/src/unstable/encoding/Ndjson.ts +17 -17
- package/src/unstable/http/Cookies.ts +7 -8
- package/src/unstable/http/Etag.ts +5 -3
- package/src/unstable/http/Headers.ts +6 -5
- package/src/unstable/http/HttpClient.ts +2 -1
- package/src/unstable/http/HttpClientRequest.ts +11 -9
- package/src/unstable/http/HttpClientResponse.ts +5 -4
- package/src/unstable/http/HttpIncomingMessage.ts +3 -2
- package/src/unstable/http/HttpMiddleware.ts +16 -15
- package/src/unstable/http/HttpPlatform.ts +3 -2
- package/src/unstable/http/HttpRouter.ts +9 -9
- package/src/unstable/http/HttpServer.ts +3 -9
- package/src/unstable/http/HttpServerError.ts +3 -2
- package/src/unstable/http/HttpServerRequest.ts +29 -25
- package/src/unstable/http/HttpServerResponse.ts +7 -6
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/UrlParams.ts +11 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +13 -7
- package/src/unstable/httpapi/HttpApiError.ts +67 -12
- package/src/unstable/observability/OtlpExporter.ts +5 -2
- package/src/unstable/observability/OtlpTracer.ts +8 -4
- package/src/unstable/persistence/Persistable.ts +1 -1
- package/src/unstable/reactivity/Atom.ts +1 -4
- package/src/unstable/reactivity/AtomRegistry.ts +5 -3
- package/src/unstable/rpc/Rpc.ts +4 -3
- package/src/unstable/rpc/RpcClient.ts +10 -9
- package/src/unstable/rpc/RpcGroup.ts +3 -3
- package/src/unstable/rpc/RpcSchema.ts +6 -5
- package/src/unstable/rpc/RpcSerialization.ts +4 -1
- package/src/unstable/rpc/RpcServer.ts +3 -3
- package/src/unstable/socket/Socket.ts +2 -1
- package/src/unstable/sql/SqlClient.ts +5 -3
- package/src/unstable/workflow/DurableDeferred.ts +6 -6
- package/src/unstable/workflow/Workflow.ts +1 -1
- package/src/unstable/workflow/WorkflowEngine.ts +29 -20
- package/dist/NullOr.d.ts +0 -149
- package/dist/NullOr.d.ts.map +0 -1
- package/dist/NullOr.js +0 -152
- package/dist/NullOr.js.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.js +0 -23
- package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
- package/src/NullOr.ts +0 -204
- package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/src/internal/dateTime.ts
CHANGED
|
@@ -9,11 +9,11 @@ import type { LazyArg } from "../Function.ts"
|
|
|
9
9
|
import { dual } from "../Function.ts"
|
|
10
10
|
import * as Hash from "../Hash.ts"
|
|
11
11
|
import * as Inspectable from "../Inspectable.ts"
|
|
12
|
+
import * as Option from "../Option.ts"
|
|
12
13
|
import * as order from "../Order.ts"
|
|
13
14
|
import { pipeArguments } from "../Pipeable.ts"
|
|
14
15
|
import * as Predicate from "../Predicate.ts"
|
|
15
16
|
import type { Mutable } from "../Types.ts"
|
|
16
|
-
import * as UndefinedOr from "../UndefinedOr.ts"
|
|
17
17
|
import * as effect from "./effect.ts"
|
|
18
18
|
|
|
19
19
|
/** @internal */
|
|
@@ -39,10 +39,10 @@ const ProtoUtc = {
|
|
|
39
39
|
...Proto,
|
|
40
40
|
_tag: "Utc",
|
|
41
41
|
[Hash.symbol](this: DateTime.Utc) {
|
|
42
|
-
return Hash.number(this.
|
|
42
|
+
return Hash.number(this.epochMilliseconds)
|
|
43
43
|
},
|
|
44
44
|
[Equal.symbol](this: DateTime.Utc, that: unknown) {
|
|
45
|
-
return isDateTime(that) && that._tag === "Utc" && this.
|
|
45
|
+
return isDateTime(that) && that._tag === "Utc" && this.epochMilliseconds === that.epochMilliseconds
|
|
46
46
|
},
|
|
47
47
|
toString(this: DateTime.Utc) {
|
|
48
48
|
return `DateTime.Utc(${toDateUtc(this).toJSON()})`
|
|
@@ -53,10 +53,10 @@ const ProtoZoned = {
|
|
|
53
53
|
...Proto,
|
|
54
54
|
_tag: "Zoned",
|
|
55
55
|
[Hash.symbol](this: DateTime.Zoned) {
|
|
56
|
-
return Hash.combine(Hash.number(this.
|
|
56
|
+
return Hash.combine(Hash.number(this.epochMilliseconds))(Hash.hash(this.zone))
|
|
57
57
|
},
|
|
58
58
|
[Equal.symbol](this: DateTime.Zoned, that: unknown) {
|
|
59
|
-
return isDateTime(that) && that._tag === "Zoned" && this.
|
|
59
|
+
return isDateTime(that) && that._tag === "Zoned" && this.epochMilliseconds === that.epochMilliseconds &&
|
|
60
60
|
Equal.equals(this.zone, that.zone)
|
|
61
61
|
},
|
|
62
62
|
toString(this: DateTime.Zoned) {
|
|
@@ -120,7 +120,7 @@ export const makeZonedProto = (
|
|
|
120
120
|
partsUtc?: DateTime.DateTime.PartsWithWeekday
|
|
121
121
|
): DateTime.Zoned => {
|
|
122
122
|
const self = Object.create(ProtoZoned)
|
|
123
|
-
self.
|
|
123
|
+
self.epochMilliseconds = epochMillis
|
|
124
124
|
self.zone = zone
|
|
125
125
|
Object.defineProperty(self, "partsUtc", {
|
|
126
126
|
value: partsUtc,
|
|
@@ -169,11 +169,13 @@ export const isZoned = (self: DateTime.DateTime): self is DateTime.Zoned => self
|
|
|
169
169
|
// =============================================================================
|
|
170
170
|
|
|
171
171
|
/** @internal */
|
|
172
|
-
export const Equivalence: Equ.Equivalence<DateTime.DateTime> = Equ.make((a, b) =>
|
|
172
|
+
export const Equivalence: Equ.Equivalence<DateTime.DateTime> = Equ.make((a, b) =>
|
|
173
|
+
a.epochMilliseconds === b.epochMilliseconds
|
|
174
|
+
)
|
|
173
175
|
|
|
174
176
|
/** @internal */
|
|
175
177
|
export const Order: order.Order<DateTime.DateTime> = order.make((self, that) =>
|
|
176
|
-
self.
|
|
178
|
+
self.epochMilliseconds < that.epochMilliseconds ? -1 : self.epochMilliseconds > that.epochMilliseconds ? 1 : 0
|
|
177
179
|
)
|
|
178
180
|
|
|
179
181
|
/** @internal */
|
|
@@ -193,7 +195,7 @@ export const clamp: {
|
|
|
193
195
|
|
|
194
196
|
const makeUtc = (epochMillis: number): DateTime.Utc => {
|
|
195
197
|
const self = Object.create(ProtoUtc)
|
|
196
|
-
self.
|
|
198
|
+
self.epochMilliseconds = epochMillis
|
|
197
199
|
Object.defineProperty(self, "partsUtc", {
|
|
198
200
|
value: undefined,
|
|
199
201
|
enumerable: false,
|
|
@@ -218,6 +220,9 @@ export const makeUnsafe = <A extends DateTime.DateTime.Input>(input: A): DateTim
|
|
|
218
220
|
} else if (input instanceof Date) {
|
|
219
221
|
return fromDateUnsafe(input) as DateTime.DateTime.PreserveZone<A>
|
|
220
222
|
} else if (typeof input === "object") {
|
|
223
|
+
if ("epochMilliseconds" in input) {
|
|
224
|
+
return makeUtc(input.epochMilliseconds) as DateTime.DateTime.PreserveZone<A>
|
|
225
|
+
}
|
|
221
226
|
const date = new Date(0)
|
|
222
227
|
setPartsDate(date, input)
|
|
223
228
|
return fromDateUnsafe(date) as DateTime.DateTime.PreserveZone<A>
|
|
@@ -238,32 +243,36 @@ export const makeZonedUnsafe = (input: DateTime.DateTime.Input, options?: {
|
|
|
238
243
|
readonly adjustForTimeZone?: boolean | undefined
|
|
239
244
|
readonly disambiguation?: DateTime.Disambiguation | undefined
|
|
240
245
|
}): DateTime.Zoned => {
|
|
241
|
-
|
|
246
|
+
let timeZoneOption = options?.timeZone
|
|
247
|
+
if (timeZoneOption === undefined && isDateTime(input) && isZoned(input)) {
|
|
242
248
|
return input
|
|
243
249
|
}
|
|
244
250
|
const self = makeUnsafe(input)
|
|
245
|
-
if (self.
|
|
246
|
-
throw new RangeError(`Epoch millis out of range: ${self.
|
|
251
|
+
if (self.epochMilliseconds < minEpochMillis || self.epochMilliseconds > maxEpochMillis) {
|
|
252
|
+
throw new RangeError(`Epoch millis out of range: ${self.epochMilliseconds}`)
|
|
253
|
+
}
|
|
254
|
+
if (timeZoneOption === undefined && typeof input === "object" && "timeZoneId" in input) {
|
|
255
|
+
timeZoneOption = input.timeZoneId
|
|
247
256
|
}
|
|
248
257
|
let zone: DateTime.TimeZone
|
|
249
|
-
if (
|
|
250
|
-
const offset = new Date(self.
|
|
258
|
+
if (timeZoneOption === undefined) {
|
|
259
|
+
const offset = new Date(self.epochMilliseconds).getTimezoneOffset() * -60 * 1000
|
|
251
260
|
zone = zoneMakeOffset(offset)
|
|
252
|
-
} else if (isTimeZone(
|
|
253
|
-
zone =
|
|
254
|
-
} else if (typeof
|
|
255
|
-
zone = zoneMakeOffset(
|
|
261
|
+
} else if (isTimeZone(timeZoneOption)) {
|
|
262
|
+
zone = timeZoneOption
|
|
263
|
+
} else if (typeof timeZoneOption === "number") {
|
|
264
|
+
zone = zoneMakeOffset(timeZoneOption)
|
|
256
265
|
} else {
|
|
257
|
-
const parsedZone = zoneFromString(
|
|
258
|
-
if (parsedZone
|
|
259
|
-
throw new IllegalArgumentError(`Invalid time zone: ${
|
|
266
|
+
const parsedZone = zoneFromString(timeZoneOption)
|
|
267
|
+
if (Option.isNone(parsedZone)) {
|
|
268
|
+
throw new IllegalArgumentError(`Invalid time zone: ${timeZoneOption}`)
|
|
260
269
|
}
|
|
261
|
-
zone = parsedZone
|
|
270
|
+
zone = parsedZone.value
|
|
262
271
|
}
|
|
263
272
|
if (options?.adjustForTimeZone !== true) {
|
|
264
|
-
return makeZonedProto(self.
|
|
273
|
+
return makeZonedProto(self.epochMilliseconds, zone, self.partsUtc)
|
|
265
274
|
}
|
|
266
|
-
return makeZonedFromAdjusted(self.
|
|
275
|
+
return makeZonedFromAdjusted(self.epochMilliseconds, zone, options?.disambiguation ?? "compatible")
|
|
267
276
|
}
|
|
268
277
|
|
|
269
278
|
/** @internal */
|
|
@@ -274,20 +283,20 @@ export const makeZoned: (
|
|
|
274
283
|
readonly adjustForTimeZone?: boolean | undefined
|
|
275
284
|
readonly disambiguation?: DateTime.Disambiguation | undefined
|
|
276
285
|
}
|
|
277
|
-
) => DateTime.Zoned
|
|
286
|
+
) => Option.Option<DateTime.Zoned> = Option.liftThrowable(makeZonedUnsafe)
|
|
278
287
|
|
|
279
288
|
/** @internal */
|
|
280
|
-
export const make: <A extends DateTime.DateTime.Input>(input: A) => DateTime.DateTime.PreserveZone<A
|
|
281
|
-
|
|
289
|
+
export const make: <A extends DateTime.DateTime.Input>(input: A) => Option.Option<DateTime.DateTime.PreserveZone<A>> =
|
|
290
|
+
Option.liftThrowable(makeUnsafe)
|
|
282
291
|
|
|
283
292
|
const zonedStringRegExp = /^(.{17,35})\[(.+)\]$/
|
|
284
293
|
|
|
285
294
|
/** @internal */
|
|
286
|
-
export const makeZonedFromString = (input: string): DateTime.Zoned
|
|
295
|
+
export const makeZonedFromString = (input: string): Option.Option<DateTime.Zoned> => {
|
|
287
296
|
const match = zonedStringRegExp.exec(input)
|
|
288
297
|
if (match === null) {
|
|
289
298
|
const offset = parseOffset(input)
|
|
290
|
-
return offset !== null ? makeZoned(input, { timeZone: offset }) :
|
|
299
|
+
return offset !== null ? makeZoned(input, { timeZone: offset }) : Option.none()
|
|
291
300
|
}
|
|
292
301
|
const [, isoString, timeZone] = match
|
|
293
302
|
return makeZoned(isoString, { timeZone })
|
|
@@ -307,7 +316,7 @@ export const nowUnsafe: LazyArg<DateTime.Utc> = () => makeUtc(Date.now())
|
|
|
307
316
|
// =============================================================================
|
|
308
317
|
|
|
309
318
|
/** @internal */
|
|
310
|
-
export const toUtc = (self: DateTime.DateTime): DateTime.Utc => makeUtc(self.
|
|
319
|
+
export const toUtc = (self: DateTime.DateTime): DateTime.Utc => makeUtc(self.epochMilliseconds)
|
|
311
320
|
|
|
312
321
|
/** @internal */
|
|
313
322
|
export const setZone: {
|
|
@@ -324,8 +333,8 @@ export const setZone: {
|
|
|
324
333
|
readonly disambiguation?: DateTime.Disambiguation | undefined
|
|
325
334
|
}): DateTime.Zoned =>
|
|
326
335
|
options?.adjustForTimeZone === true
|
|
327
|
-
? makeZonedFromAdjusted(self.
|
|
328
|
-
: makeZonedProto(self.
|
|
336
|
+
? makeZonedFromAdjusted(self.epochMilliseconds, zone, options?.disambiguation ?? "compatible")
|
|
337
|
+
: makeZonedProto(self.epochMilliseconds, zone, self.partsUtc))
|
|
329
338
|
|
|
330
339
|
/** @internal */
|
|
331
340
|
export const setZoneOffset: {
|
|
@@ -393,7 +402,7 @@ export const zoneMakeOffset = (offset: number): DateTime.TimeZone.Offset => {
|
|
|
393
402
|
}
|
|
394
403
|
|
|
395
404
|
/** @internal */
|
|
396
|
-
export const zoneMakeNamed: (zoneId: string) => DateTime.TimeZone.Named
|
|
405
|
+
export const zoneMakeNamed: (zoneId: string) => Option.Option<DateTime.TimeZone.Named> = Option.liftThrowable(
|
|
397
406
|
zoneMakeNamedUnsafe
|
|
398
407
|
)
|
|
399
408
|
|
|
@@ -411,10 +420,10 @@ export const zoneMakeLocal = (): DateTime.TimeZone.Named =>
|
|
|
411
420
|
const offsetZoneRegExp = /^(?:GMT|[+-])/
|
|
412
421
|
|
|
413
422
|
/** @internal */
|
|
414
|
-
export const zoneFromString = (zone: string): DateTime.TimeZone
|
|
423
|
+
export const zoneFromString = (zone: string): Option.Option<DateTime.TimeZone> => {
|
|
415
424
|
if (offsetZoneRegExp.test(zone)) {
|
|
416
425
|
const offset = parseOffset(zone)
|
|
417
|
-
return offset === null ?
|
|
426
|
+
return offset === null ? Option.none() : Option.some(zoneMakeOffset(offset))
|
|
418
427
|
}
|
|
419
428
|
return zoneMakeNamed(zone)
|
|
420
429
|
}
|
|
@@ -432,17 +441,17 @@ export const setZoneNamed: {
|
|
|
432
441
|
(zoneId: string, options?: {
|
|
433
442
|
readonly adjustForTimeZone?: boolean | undefined
|
|
434
443
|
readonly disambiguation?: DateTime.Disambiguation | undefined
|
|
435
|
-
}): (self: DateTime.DateTime) => DateTime.Zoned
|
|
444
|
+
}): (self: DateTime.DateTime) => Option.Option<DateTime.Zoned>
|
|
436
445
|
(self: DateTime.DateTime, zoneId: string, options?: {
|
|
437
446
|
readonly adjustForTimeZone?: boolean | undefined
|
|
438
447
|
readonly disambiguation?: DateTime.Disambiguation | undefined
|
|
439
|
-
}): DateTime.Zoned
|
|
448
|
+
}): Option.Option<DateTime.Zoned>
|
|
440
449
|
} = dual(
|
|
441
450
|
isDateTimeArgs,
|
|
442
451
|
(self: DateTime.DateTime, zoneId: string, options?: {
|
|
443
452
|
readonly adjustForTimeZone?: boolean | undefined
|
|
444
453
|
readonly disambiguation?: DateTime.Disambiguation | undefined
|
|
445
|
-
}): DateTime.Zoned
|
|
454
|
+
}): Option.Option<DateTime.Zoned> => Option.map(zoneMakeNamed(zoneId), (zone) => setZone(self, zone, options))
|
|
446
455
|
)
|
|
447
456
|
|
|
448
457
|
/** @internal */
|
|
@@ -533,18 +542,18 @@ export const isPastUnsafe = (self: DateTime.DateTime): boolean => isGreaterThan(
|
|
|
533
542
|
// =============================================================================
|
|
534
543
|
|
|
535
544
|
/** @internal */
|
|
536
|
-
export const toDateUtc = (self: DateTime.DateTime): Date => new Date(self.
|
|
545
|
+
export const toDateUtc = (self: DateTime.DateTime): Date => new Date(self.epochMilliseconds)
|
|
537
546
|
|
|
538
547
|
/** @internal */
|
|
539
548
|
export const toDate = (self: DateTime.DateTime): Date => {
|
|
540
549
|
if (self._tag === "Utc") {
|
|
541
|
-
return new Date(self.
|
|
550
|
+
return new Date(self.epochMilliseconds)
|
|
542
551
|
} else if (self.zone._tag === "Offset") {
|
|
543
|
-
return new Date(self.
|
|
544
|
-
} else if (self.
|
|
545
|
-
return new Date(self.
|
|
552
|
+
return new Date(self.epochMilliseconds + self.zone.offset)
|
|
553
|
+
} else if (self.adjustedEpochMilliseconds !== undefined) {
|
|
554
|
+
return new Date(self.adjustedEpochMilliseconds)
|
|
546
555
|
}
|
|
547
|
-
const parts = self.zone.format.formatToParts(self.
|
|
556
|
+
const parts = self.zone.format.formatToParts(self.epochMilliseconds).filter((_) => _.type !== "literal")
|
|
548
557
|
const date = new Date(0)
|
|
549
558
|
date.setUTCFullYear(
|
|
550
559
|
Number(parts[2].value),
|
|
@@ -557,7 +566,7 @@ export const toDate = (self: DateTime.DateTime): Date => {
|
|
|
557
566
|
Number(parts[5].value),
|
|
558
567
|
Number(parts[6].value)
|
|
559
568
|
)
|
|
560
|
-
self.
|
|
569
|
+
self.adjustedEpochMilliseconds = date.getTime()
|
|
561
570
|
return date
|
|
562
571
|
}
|
|
563
572
|
|
|
@@ -582,7 +591,7 @@ const offsetToString = (offset: number): string => {
|
|
|
582
591
|
export const zonedOffsetIso = (self: DateTime.Zoned): string => offsetToString(zonedOffset(self))
|
|
583
592
|
|
|
584
593
|
/** @internal */
|
|
585
|
-
export const toEpochMillis = (self: DateTime.DateTime): number => self.
|
|
594
|
+
export const toEpochMillis = (self: DateTime.DateTime): number => self.epochMilliseconds
|
|
586
595
|
|
|
587
596
|
/** @internal */
|
|
588
597
|
export const removeTime = (self: DateTime.DateTime): DateTime.Utc =>
|
|
@@ -596,10 +605,10 @@ export const removeTime = (self: DateTime.DateTime): DateTime.Utc =>
|
|
|
596
605
|
// =============================================================================
|
|
597
606
|
|
|
598
607
|
const dateToParts = (date: Date): DateTime.DateTime.PartsWithWeekday => ({
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
608
|
+
millisecond: date.getUTCMilliseconds(),
|
|
609
|
+
second: date.getUTCSeconds(),
|
|
610
|
+
minute: date.getUTCMinutes(),
|
|
611
|
+
hour: date.getUTCHours(),
|
|
603
612
|
day: date.getUTCDate(),
|
|
604
613
|
weekDay: date.getUTCDay(),
|
|
605
614
|
month: date.getUTCMonth() + 1,
|
|
@@ -652,17 +661,17 @@ const setPartsDate = (date: Date, parts: Partial<DateTime.DateTime.PartsWithWeek
|
|
|
652
661
|
const diff = parts.weekDay - date.getUTCDay()
|
|
653
662
|
date.setUTCDate(date.getUTCDate() + diff)
|
|
654
663
|
}
|
|
655
|
-
if (parts.
|
|
656
|
-
date.setUTCHours(parts.
|
|
664
|
+
if (parts.hour !== undefined) {
|
|
665
|
+
date.setUTCHours(parts.hour)
|
|
657
666
|
}
|
|
658
|
-
if (parts.
|
|
659
|
-
date.setUTCMinutes(parts.
|
|
667
|
+
if (parts.minute !== undefined) {
|
|
668
|
+
date.setUTCMinutes(parts.minute)
|
|
660
669
|
}
|
|
661
|
-
if (parts.
|
|
662
|
-
date.setUTCSeconds(parts.
|
|
670
|
+
if (parts.second !== undefined) {
|
|
671
|
+
date.setUTCSeconds(parts.second)
|
|
663
672
|
}
|
|
664
|
-
if (parts.
|
|
665
|
-
date.setUTCMilliseconds(parts.
|
|
673
|
+
if (parts.millisecond !== undefined) {
|
|
674
|
+
date.setUTCMilliseconds(parts.millisecond)
|
|
666
675
|
}
|
|
667
676
|
}
|
|
668
677
|
|
|
@@ -925,8 +934,8 @@ export const add: {
|
|
|
925
934
|
2,
|
|
926
935
|
(self: DateTime.DateTime, parts: Partial<DateTime.DateTime.PartsForMath>): DateTime.DateTime =>
|
|
927
936
|
mutate(self, (date) => {
|
|
928
|
-
if (parts.
|
|
929
|
-
addMillis(date, parts.
|
|
937
|
+
if (parts.milliseconds) {
|
|
938
|
+
addMillis(date, parts.milliseconds)
|
|
930
939
|
}
|
|
931
940
|
if (parts.seconds) {
|
|
932
941
|
addMillis(date, parts.seconds * 1000)
|
|
@@ -1100,7 +1109,7 @@ export const nearest: {
|
|
|
1100
1109
|
readonly weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined
|
|
1101
1110
|
}): DateTime.DateTime =>
|
|
1102
1111
|
mutate(self, (date) => {
|
|
1103
|
-
if (part === "
|
|
1112
|
+
if (part === "millisecond") return
|
|
1104
1113
|
const millis = date.getTime()
|
|
1105
1114
|
const start = new Date(millis)
|
|
1106
1115
|
startOfDate(start, part, options)
|
|
@@ -1157,7 +1166,7 @@ export const format: {
|
|
|
1157
1166
|
return new Intl.DateTimeFormat(options?.locale, {
|
|
1158
1167
|
timeZone: self._tag === "Utc" ? "UTC" : intlTimeZone(self.zone),
|
|
1159
1168
|
...options
|
|
1160
|
-
}).format(self.
|
|
1169
|
+
}).format(self.epochMilliseconds)
|
|
1161
1170
|
} catch {
|
|
1162
1171
|
return new Intl.DateTimeFormat(options?.locale, {
|
|
1163
1172
|
timeZone: "UTC",
|
|
@@ -1190,7 +1199,7 @@ export const formatLocal: {
|
|
|
1190
1199
|
readonly locale?: Intl.LocalesArgument
|
|
1191
1200
|
}
|
|
1192
1201
|
| undefined
|
|
1193
|
-
): string => new Intl.DateTimeFormat(options?.locale, options).format(self.
|
|
1202
|
+
): string => new Intl.DateTimeFormat(options?.locale, options).format(self.epochMilliseconds))
|
|
1194
1203
|
|
|
1195
1204
|
/** @internal */
|
|
1196
1205
|
export const formatUtc: {
|
|
@@ -1220,13 +1229,13 @@ export const formatUtc: {
|
|
|
1220
1229
|
new Intl.DateTimeFormat(options?.locale, {
|
|
1221
1230
|
...options,
|
|
1222
1231
|
timeZone: "UTC"
|
|
1223
|
-
}).format(self.
|
|
1232
|
+
}).format(self.epochMilliseconds))
|
|
1224
1233
|
|
|
1225
1234
|
/** @internal */
|
|
1226
1235
|
export const formatIntl: {
|
|
1227
1236
|
(format: Intl.DateTimeFormat): (self: DateTime.DateTime) => string
|
|
1228
1237
|
(self: DateTime.DateTime, format: Intl.DateTimeFormat): string
|
|
1229
|
-
} = dual(2, (self: DateTime.DateTime, format: Intl.DateTimeFormat): string => format.format(self.
|
|
1238
|
+
} = dual(2, (self: DateTime.DateTime, format: Intl.DateTimeFormat): string => format.format(self.epochMilliseconds))
|
|
1230
1239
|
|
|
1231
1240
|
/** @internal */
|
|
1232
1241
|
export const formatIso = (self: DateTime.DateTime): string => toDateUtc(self).toISOString()
|
package/src/internal/effect.ts
CHANGED
|
@@ -540,6 +540,11 @@ export class FiberImpl<A = any, E = any> implements Fiber.Fiber<A, E> {
|
|
|
540
540
|
maxOpsBeforeYield!: number
|
|
541
541
|
currentPreventYield!: boolean
|
|
542
542
|
|
|
543
|
+
_dispatcher: Scheduler.SchedulerDispatcher | undefined = undefined
|
|
544
|
+
get currentDispatcher(): Scheduler.SchedulerDispatcher {
|
|
545
|
+
return this._dispatcher ??= this.currentScheduler.makeDispatcher()
|
|
546
|
+
}
|
|
547
|
+
|
|
543
548
|
getRef<X>(ref: ServiceMap.Reference<X>): X {
|
|
544
549
|
return ServiceMap.getReferenceUnsafe(this.services, ref)
|
|
545
550
|
}
|
|
@@ -675,7 +680,11 @@ export class FiberImpl<A = any, E = any> implements Fiber.Fiber<A, E> {
|
|
|
675
680
|
}
|
|
676
681
|
setServices(services: ServiceMap.ServiceMap<never>): void {
|
|
677
682
|
this.services = services
|
|
678
|
-
|
|
683
|
+
const scheduler = this.getRef(Scheduler.Scheduler)
|
|
684
|
+
if (scheduler !== this.currentScheduler) {
|
|
685
|
+
this.currentScheduler = scheduler
|
|
686
|
+
this._dispatcher = undefined
|
|
687
|
+
}
|
|
679
688
|
this.currentSpan = services.mapUnsafe.get(Tracer.ParentSpanKey)
|
|
680
689
|
this.currentLogLevel = this.getRef(CurrentLogLevel)
|
|
681
690
|
this.minimumLogLevel = this.getRef(MinimumLogLevel)
|
|
@@ -903,7 +912,7 @@ export const yieldNowWith: (priority?: number) => Effect.Effect<void> = makePrim
|
|
|
903
912
|
op: "Yield",
|
|
904
913
|
[evaluate](fiber) {
|
|
905
914
|
let resumed = false
|
|
906
|
-
fiber.
|
|
915
|
+
fiber.currentDispatcher.scheduleTask(() => {
|
|
907
916
|
if (resumed) return
|
|
908
917
|
fiber.evaluate(exitVoid as any)
|
|
909
918
|
}, this[args] ?? 0)
|
|
@@ -4849,7 +4858,7 @@ export const forkUnsafe = <FA, FE, A, E, R>(
|
|
|
4849
4858
|
if (immediate) {
|
|
4850
4859
|
child.evaluate(effect as any)
|
|
4851
4860
|
} else {
|
|
4852
|
-
parent.
|
|
4861
|
+
parent.currentDispatcher.scheduleTask(() => child.evaluate(effect as any), 0)
|
|
4853
4862
|
}
|
|
4854
4863
|
if (!daemon && !child._exit) {
|
|
4855
4864
|
parent.children().add(child)
|
|
@@ -4990,10 +4999,8 @@ export const runForkWith = <R>(services: ServiceMap.ServiceMap<R>) =>
|
|
|
4990
4999
|
effect: Effect.Effect<A, E, R>,
|
|
4991
5000
|
options?: Effect.RunOptions | undefined
|
|
4992
5001
|
): Fiber.Fiber<A, E> => {
|
|
4993
|
-
const scheduler = options?.scheduler ||
|
|
4994
|
-
(!services.mapUnsafe.has(Scheduler.Scheduler.key) && new Scheduler.MixedScheduler())
|
|
4995
5002
|
const fiber = new FiberImpl<A, E>(
|
|
4996
|
-
scheduler ? ServiceMap.add(services, Scheduler.Scheduler, scheduler) : services,
|
|
5003
|
+
options?.scheduler ? ServiceMap.add(services, Scheduler.Scheduler, options.scheduler) : services,
|
|
4997
5004
|
options?.uninterruptible !== true
|
|
4998
5005
|
)
|
|
4999
5006
|
fiber.evaluate(effect as any)
|
|
@@ -5113,7 +5120,7 @@ export const runSyncExitWith = <R>(services: ServiceMap.ServiceMap<R>) => {
|
|
|
5113
5120
|
if (effectIsExit(effect)) return effect
|
|
5114
5121
|
const scheduler = new Scheduler.MixedScheduler("sync")
|
|
5115
5122
|
const fiber = runFork(effect, { scheduler })
|
|
5116
|
-
|
|
5123
|
+
fiber.currentDispatcher?.flush()
|
|
5117
5124
|
return (fiber as FiberImpl<A, E>)._exit ?? exitDie(fiber)
|
|
5118
5125
|
}
|
|
5119
5126
|
}
|
|
@@ -5136,108 +5143,6 @@ export const runSyncWith = <R>(services: ServiceMap.ServiceMap<R>) => {
|
|
|
5136
5143
|
/** @internal */
|
|
5137
5144
|
export const runSync: <A, E>(effect: Effect.Effect<A, E>) => A = runSyncWith(ServiceMap.empty())
|
|
5138
5145
|
|
|
5139
|
-
// ----------------------------------------------------------------------------
|
|
5140
|
-
// Semaphore
|
|
5141
|
-
// ----------------------------------------------------------------------------
|
|
5142
|
-
|
|
5143
|
-
/** @internal */
|
|
5144
|
-
class Semaphore {
|
|
5145
|
-
public waiters = new Set<() => void>()
|
|
5146
|
-
public taken = 0
|
|
5147
|
-
public permits: number
|
|
5148
|
-
|
|
5149
|
-
constructor(permits: number) {
|
|
5150
|
-
this.permits = permits
|
|
5151
|
-
}
|
|
5152
|
-
|
|
5153
|
-
get free() {
|
|
5154
|
-
return this.permits - this.taken
|
|
5155
|
-
}
|
|
5156
|
-
|
|
5157
|
-
readonly take = (n: number): Effect.Effect<number> => {
|
|
5158
|
-
const take: Effect.Effect<number> = suspend(() => {
|
|
5159
|
-
if (this.free < n) {
|
|
5160
|
-
return callback((resume) => {
|
|
5161
|
-
if (this.free >= n) return resume(take)
|
|
5162
|
-
const observer = () => {
|
|
5163
|
-
if (this.free < n) return
|
|
5164
|
-
this.waiters.delete(observer)
|
|
5165
|
-
resume(take)
|
|
5166
|
-
}
|
|
5167
|
-
this.waiters.add(observer)
|
|
5168
|
-
return sync(() => {
|
|
5169
|
-
this.waiters.delete(observer)
|
|
5170
|
-
})
|
|
5171
|
-
})
|
|
5172
|
-
}
|
|
5173
|
-
this.taken += n
|
|
5174
|
-
return succeed(n)
|
|
5175
|
-
})
|
|
5176
|
-
return take
|
|
5177
|
-
}
|
|
5178
|
-
|
|
5179
|
-
updateTakenUnsafe(fiber: Fiber.Fiber<any, any>, f: (n: number) => number): Effect.Effect<number> {
|
|
5180
|
-
this.taken = f(this.taken)
|
|
5181
|
-
if (this.waiters.size > 0) {
|
|
5182
|
-
fiber.currentScheduler.scheduleTask(() => {
|
|
5183
|
-
const iter = this.waiters.values()
|
|
5184
|
-
let item = iter.next()
|
|
5185
|
-
while (item.done === false && this.free > 0) {
|
|
5186
|
-
item.value()
|
|
5187
|
-
item = iter.next()
|
|
5188
|
-
}
|
|
5189
|
-
}, 0)
|
|
5190
|
-
}
|
|
5191
|
-
return succeed(this.free)
|
|
5192
|
-
}
|
|
5193
|
-
|
|
5194
|
-
updateTaken(f: (n: number) => number): Effect.Effect<number> {
|
|
5195
|
-
return withFiber((fiber) => this.updateTakenUnsafe(fiber, f))
|
|
5196
|
-
}
|
|
5197
|
-
|
|
5198
|
-
readonly resize = (permits: number) =>
|
|
5199
|
-
asVoid(
|
|
5200
|
-
withFiber((fiber) => {
|
|
5201
|
-
this.permits = permits
|
|
5202
|
-
if (this.free < 0) {
|
|
5203
|
-
return void_
|
|
5204
|
-
}
|
|
5205
|
-
return this.updateTakenUnsafe(fiber, (taken) => taken)
|
|
5206
|
-
})
|
|
5207
|
-
)
|
|
5208
|
-
|
|
5209
|
-
readonly release = (n: number): Effect.Effect<number> => this.updateTaken((taken) => taken - n)
|
|
5210
|
-
|
|
5211
|
-
readonly releaseAll: Effect.Effect<number> = this.updateTaken((_) => 0)
|
|
5212
|
-
|
|
5213
|
-
readonly withPermits = (n: number) => <A, E, R>(self: Effect.Effect<A, E, R>) =>
|
|
5214
|
-
uninterruptibleMask((restore) =>
|
|
5215
|
-
flatMap(
|
|
5216
|
-
restore(this.take(n)),
|
|
5217
|
-
(permits) => onExitPrimitive(restore(self), () => this.release(permits), true)
|
|
5218
|
-
)
|
|
5219
|
-
)
|
|
5220
|
-
|
|
5221
|
-
readonly withPermit = this.withPermits(1)
|
|
5222
|
-
|
|
5223
|
-
readonly withPermitsIfAvailable = (n: number) => <A, E, R>(self: Effect.Effect<A, E, R>) =>
|
|
5224
|
-
uninterruptibleMask((restore) =>
|
|
5225
|
-
suspend(() => {
|
|
5226
|
-
if (this.free < n) {
|
|
5227
|
-
return succeedNone
|
|
5228
|
-
}
|
|
5229
|
-
this.taken += n
|
|
5230
|
-
return ensuring(restore(asSome(self)), this.release(n))
|
|
5231
|
-
})
|
|
5232
|
-
)
|
|
5233
|
-
}
|
|
5234
|
-
|
|
5235
|
-
/** @internal */
|
|
5236
|
-
export const makeSemaphoreUnsafe = (permits: number): Semaphore => new Semaphore(permits)
|
|
5237
|
-
|
|
5238
|
-
/** @internal */
|
|
5239
|
-
export const makeSemaphore = (permits: number) => sync(() => makeSemaphoreUnsafe(permits))
|
|
5240
|
-
|
|
5241
5146
|
const succeedTrue = succeed(true)
|
|
5242
5147
|
const succeedFalse = succeed(false)
|
|
5243
5148
|
|
|
@@ -5255,7 +5160,7 @@ class Latch implements _Latch.Latch {
|
|
|
5255
5160
|
return succeedTrue
|
|
5256
5161
|
}
|
|
5257
5162
|
this.scheduled = true
|
|
5258
|
-
fiber.
|
|
5163
|
+
fiber.currentDispatcher.scheduleTask(this.flushWaiters, 0)
|
|
5259
5164
|
return succeedTrue
|
|
5260
5165
|
}
|
|
5261
5166
|
private flushWaiters = () => {
|
|
@@ -5297,7 +5202,7 @@ class Latch implements _Latch.Latch {
|
|
|
5297
5202
|
return true
|
|
5298
5203
|
}
|
|
5299
5204
|
close = sync(() => this.closeUnsafe())
|
|
5300
|
-
whenOpen = <A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
5205
|
+
whenOpen = <A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> => flatMap(this.await, () => self)
|
|
5301
5206
|
}
|
|
5302
5207
|
|
|
5303
5208
|
/** @internal */
|
|
@@ -5360,16 +5265,15 @@ const NoopSpanProto: Omit<Tracer.Span, "parent" | "name" | "annotations" | "leve
|
|
|
5360
5265
|
/** @internal */
|
|
5361
5266
|
export const noopSpan = (options: {
|
|
5362
5267
|
readonly name: string
|
|
5363
|
-
readonly parent: Tracer.AnySpan
|
|
5268
|
+
readonly parent: Option.Option<Tracer.AnySpan>
|
|
5364
5269
|
readonly annotations: ServiceMap.ServiceMap<never>
|
|
5365
5270
|
}): Tracer.Span => Object.assign(Object.create(NoopSpanProto), options)
|
|
5366
5271
|
|
|
5367
|
-
const filterDisablePropagation = (span: Tracer.AnySpan | undefined): Tracer.AnySpan
|
|
5368
|
-
if (span)
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
}
|
|
5272
|
+
const filterDisablePropagation = (span: Tracer.AnySpan | undefined): Option.Option<Tracer.AnySpan> => {
|
|
5273
|
+
if (!span) return Option.none()
|
|
5274
|
+
return ServiceMap.get(span.annotations, Tracer.DisablePropagation)
|
|
5275
|
+
? span._tag === "Span" ? filterDisablePropagation(Option.getOrUndefined(span.parent)) : Option.none()
|
|
5276
|
+
: Option.some(span)
|
|
5373
5277
|
}
|
|
5374
5278
|
|
|
5375
5279
|
/** @internal */
|
|
@@ -5380,7 +5284,11 @@ export const makeSpanUnsafe = <XA, XE>(
|
|
|
5380
5284
|
) => {
|
|
5381
5285
|
const disablePropagation = !fiber.getRef(TracerEnabled) ||
|
|
5382
5286
|
(options?.annotations && ServiceMap.get(options.annotations, Tracer.DisablePropagation))
|
|
5383
|
-
const parent = options?.parent
|
|
5287
|
+
const parent = options?.parent !== undefined
|
|
5288
|
+
? Option.some(options.parent)
|
|
5289
|
+
: options?.root
|
|
5290
|
+
? Option.none<Tracer.AnySpan>()
|
|
5291
|
+
: filterDisablePropagation(fiber.currentSpan)
|
|
5384
5292
|
|
|
5385
5293
|
let span: Tracer.Span
|
|
5386
5294
|
|
|
@@ -5413,9 +5321,9 @@ export const makeSpanUnsafe = <XA, XE>(
|
|
|
5413
5321
|
links,
|
|
5414
5322
|
startTime: timingEnabled ? clock.currentTimeNanosUnsafe() : 0n,
|
|
5415
5323
|
kind: options?.kind ?? "internal",
|
|
5416
|
-
root: options?.root ??
|
|
5324
|
+
root: options?.root ?? Option.isNone(parent),
|
|
5417
5325
|
sampled: options?.sampled ??
|
|
5418
|
-
(parent
|
|
5326
|
+
(Option.isSome(parent) && parent.value.sampled === false
|
|
5419
5327
|
? false
|
|
5420
5328
|
: !isLogLevelGreaterThan(fiber.getRef(Tracer.MinimumTraceLevel), level))
|
|
5421
5329
|
})
|
|
@@ -6195,7 +6103,7 @@ const prettyLoggerBrowser = (options: {
|
|
|
6195
6103
|
export const defaultLogger = loggerMake<unknown, void>(({ cause, date, fiber, logLevel, message }) => {
|
|
6196
6104
|
const message_ = Array.isArray(message) ? message.slice() : [message]
|
|
6197
6105
|
if (cause.reasons.length > 0) {
|
|
6198
|
-
message_.
|
|
6106
|
+
message_.push(causePretty(cause))
|
|
6199
6107
|
}
|
|
6200
6108
|
const now = date.getTime()
|
|
6201
6109
|
const spans = fiber.getRef(CurrentLogSpans)
|
package/src/internal/hashMap.ts
CHANGED
|
@@ -1271,14 +1271,15 @@ export const filterMap = dual<
|
|
|
1271
1271
|
|
|
1272
1272
|
/** @internal */
|
|
1273
1273
|
export const findFirst = dual<
|
|
1274
|
-
<K, A>(predicate: (a: NoInfer<A>, k: K) => boolean) => (self: HashMap<K, A>) => [K, A]
|
|
1275
|
-
<K, A>(self: HashMap<K, A>, predicate: (a: A, k: K) => boolean) => [K, A]
|
|
1274
|
+
<K, A>(predicate: (a: NoInfer<A>, k: K) => boolean) => (self: HashMap<K, A>) => Option.Option<[K, A]>,
|
|
1275
|
+
<K, A>(self: HashMap<K, A>, predicate: (a: A, k: K) => boolean) => Option.Option<[K, A]>
|
|
1276
1276
|
>(2, <K, A>(self: HashMap<K, A>, predicate: (a: A, k: K) => boolean) => {
|
|
1277
1277
|
for (const [key, value] of self) {
|
|
1278
1278
|
if (predicate(value, key)) {
|
|
1279
|
-
return [key, value]
|
|
1279
|
+
return Option.some([key, value])
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
+
return Option.none()
|
|
1282
1283
|
})
|
|
1283
1284
|
|
|
1284
1285
|
/** @internal */
|
package/src/internal/option.ts
CHANGED
|
@@ -45,10 +45,17 @@ const SomeProto = Object.assign(Object.create(CommonProto), {
|
|
|
45
45
|
}
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
+
Object.defineProperty(SomeProto, "valueOrUndefined", {
|
|
49
|
+
get() {
|
|
50
|
+
return this.value
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
48
54
|
const NoneHash = Hash.hash("None")
|
|
49
55
|
const NoneProto = Object.assign(Object.create(CommonProto), {
|
|
50
56
|
_tag: "None",
|
|
51
57
|
_op: "None",
|
|
58
|
+
valueOrUndefined: undefined,
|
|
52
59
|
[Equal.symbol]<A>(this: Option.None<A>, that: unknown): boolean {
|
|
53
60
|
return isOption(that) && isNone(that)
|
|
54
61
|
},
|
package/src/internal/trie.ts
CHANGED
|
@@ -682,19 +682,19 @@ export const modify = dual<
|
|
|
682
682
|
|
|
683
683
|
/** @internal */
|
|
684
684
|
export const longestPrefixOf = dual<
|
|
685
|
-
(key: string) => <V>(self: TR.Trie<V>) => [string, V]
|
|
686
|
-
<V>(self: TR.Trie<V>, key: string) => [string, V]
|
|
685
|
+
(key: string) => <V>(self: TR.Trie<V>) => Option.Option<[string, V]>,
|
|
686
|
+
<V>(self: TR.Trie<V>, key: string) => Option.Option<[string, V]>
|
|
687
687
|
>(
|
|
688
688
|
2,
|
|
689
|
-
<V>(self: TR.Trie<V>, key: string): [string, V]
|
|
689
|
+
<V>(self: TR.Trie<V>, key: string): Option.Option<[string, V]> => {
|
|
690
690
|
let n: Node<V> | undefined = (self as TrieImpl<V>)._root
|
|
691
|
-
if (n === undefined || key.length === 0) return
|
|
692
|
-
let longestPrefixNode: [string, V]
|
|
691
|
+
if (n === undefined || key.length === 0) return Option.none()
|
|
692
|
+
let longestPrefixNode: Option.Option<[string, V]> = Option.none()
|
|
693
693
|
let cIndex = 0
|
|
694
694
|
while (cIndex < key.length) {
|
|
695
695
|
const c = key[cIndex]
|
|
696
696
|
if (n.value !== undefined) {
|
|
697
|
-
longestPrefixNode = [key.slice(0, cIndex + 1), n.value]
|
|
697
|
+
longestPrefixNode = Option.some([key.slice(0, cIndex + 1), n.value])
|
|
698
698
|
}
|
|
699
699
|
|
|
700
700
|
if (c > n.key) {
|
|
@@ -183,7 +183,7 @@ export class NetworkError extends Schema.ErrorClass<NetworkError>(
|
|
|
183
183
|
description: error.description,
|
|
184
184
|
reason: error._tag,
|
|
185
185
|
request: {
|
|
186
|
-
hash: error.request.hash,
|
|
186
|
+
hash: Option.getOrUndefined(error.request.hash),
|
|
187
187
|
headers: redactHeaders(error.request.headers),
|
|
188
188
|
method: error.request.method,
|
|
189
189
|
url: error.request.url,
|