effect 4.0.0-beta.31 → 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/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 +8 -15
- package/dist/Cron.js.map +1 -1
- package/dist/DateTime.d.ts +16 -15
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +8 -8
- 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 +26 -24
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +23 -22
- 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 +84 -0
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +27 -0
- 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 +30 -0
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +28 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaGetter.js +6 -4
- package/dist/SchemaGetter.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 +9 -9
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +20 -89
- 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.map +1 -1
- package/dist/unstable/ai/Chat.js +2 -2
- package/dist/unstable/ai/Chat.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/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/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/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/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/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 +2 -1
- 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.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/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/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/Chunk.ts +68 -63
- package/src/Config.ts +4 -1
- package/src/Cron.ts +10 -15
- package/src/DateTime.ts +16 -15
- package/src/Deferred.ts +8 -6
- package/src/Duration.ts +34 -33
- 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 +121 -0
- 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 +49 -1
- package/src/SchemaGetter.ts +4 -4
- 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 +14 -14
- package/src/internal/effect.ts +29 -121
- 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 +6 -2
- 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/Flag.ts +2 -2
- 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/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/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/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 +3 -2
- package/src/unstable/http/HttpIncomingMessage.ts +2 -1
- 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 +25 -21
- package/src/unstable/http/HttpServerResponse.ts +5 -4
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/UrlParams.ts +11 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +9 -3
- 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/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/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/src/NullOr.ts +0 -204
package/dist/BigInt.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as Combiner from "./Combiner.js";
|
|
8
8
|
import * as Equ from "./Equivalence.js";
|
|
9
9
|
import { dual } from "./Function.js";
|
|
10
|
+
import * as Option from "./Option.js";
|
|
10
11
|
import * as order from "./Order.js";
|
|
11
12
|
import * as predicate from "./Predicate.js";
|
|
12
13
|
import * as Reducer from "./Reducer.js";
|
|
@@ -98,21 +99,23 @@ export const subtract = /*#__PURE__*/dual(2, (self, that) => self - that);
|
|
|
98
99
|
* If the dividend is not a multiple of the divisor the result will be a `bigint` value
|
|
99
100
|
* which represents the integer division rounded down to the nearest integer.
|
|
100
101
|
*
|
|
101
|
-
* Returns `
|
|
102
|
+
* Returns `Option.none()` if the divisor is `0n`.
|
|
102
103
|
*
|
|
103
104
|
* @example
|
|
104
105
|
* ```ts
|
|
105
106
|
* import { divide } from "effect/BigInt"
|
|
106
107
|
* import * as assert from "node:assert"
|
|
107
108
|
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
109
|
+
* import { Option } from "effect"
|
|
110
|
+
*
|
|
111
|
+
* assert.deepStrictEqual(divide(6n, 3n), Option.some(2n))
|
|
112
|
+
* assert.deepStrictEqual(divide(6n, 0n), Option.none())
|
|
110
113
|
* ```
|
|
111
114
|
*
|
|
112
115
|
* @category math
|
|
113
116
|
* @since 2.0.0
|
|
114
117
|
*/
|
|
115
|
-
export const divide = /*#__PURE__*/dual(2, (self, that) => that === bigint0 ?
|
|
118
|
+
export const divide = /*#__PURE__*/dual(2, (self, that) => that === bigint0 ? Option.none() : Option.some(self / that));
|
|
116
119
|
/**
|
|
117
120
|
* Provides a division operation on `bigint`s.
|
|
118
121
|
*
|
|
@@ -444,7 +447,7 @@ export const sqrtUnsafe = n => {
|
|
|
444
447
|
return x;
|
|
445
448
|
};
|
|
446
449
|
/**
|
|
447
|
-
* Determines the square root of a given `bigint` safely. Returns `
|
|
450
|
+
* Determines the square root of a given `bigint` safely. Returns `Option.none()` if
|
|
448
451
|
* the given `bigint` is negative.
|
|
449
452
|
*
|
|
450
453
|
* **Example**
|
|
@@ -452,16 +455,16 @@ export const sqrtUnsafe = n => {
|
|
|
452
455
|
* ```ts
|
|
453
456
|
* import { BigInt } from "effect"
|
|
454
457
|
*
|
|
455
|
-
* BigInt.sqrt(4n) // 2n
|
|
456
|
-
* BigInt.sqrt(9n) // 3n
|
|
457
|
-
* BigInt.sqrt(16n) // 4n
|
|
458
|
-
* BigInt.sqrt(-1n) //
|
|
458
|
+
* BigInt.sqrt(4n) // Option.some(2n)
|
|
459
|
+
* BigInt.sqrt(9n) // Option.some(3n)
|
|
460
|
+
* BigInt.sqrt(16n) // Option.some(4n)
|
|
461
|
+
* BigInt.sqrt(-1n) // Option.none()
|
|
459
462
|
* ```
|
|
460
463
|
*
|
|
461
464
|
* @category math
|
|
462
465
|
* @since 2.0.0
|
|
463
466
|
*/
|
|
464
|
-
export const sqrt = n => isGreaterThanOrEqualTo(n, bigint0) ? sqrtUnsafe(n) :
|
|
467
|
+
export const sqrt = n => isGreaterThanOrEqualTo(n, bigint0) ? Option.some(sqrtUnsafe(n)) : Option.none();
|
|
465
468
|
/**
|
|
466
469
|
* Takes an `Iterable` of `bigint`s and returns their sum as a single `bigint
|
|
467
470
|
*
|
|
@@ -511,15 +514,15 @@ export const multiplyAll = collection => {
|
|
|
511
514
|
* Converts a `bigint` to a `number`.
|
|
512
515
|
*
|
|
513
516
|
* If the `bigint` is outside the safe integer range for JavaScript (`Number.MAX_SAFE_INTEGER`
|
|
514
|
-
* and `Number.MIN_SAFE_INTEGER`), it returns `
|
|
517
|
+
* and `Number.MIN_SAFE_INTEGER`), it returns `Option.none()`.
|
|
515
518
|
*
|
|
516
519
|
* @example
|
|
517
520
|
* ```ts
|
|
518
521
|
* import { BigInt as BI } from "effect"
|
|
519
522
|
*
|
|
520
|
-
* BI.toNumber(42n) // 42
|
|
521
|
-
* BI.toNumber(BigInt(Number.MAX_SAFE_INTEGER) + 1n) //
|
|
522
|
-
* BI.toNumber(BigInt(Number.MIN_SAFE_INTEGER) - 1n) //
|
|
523
|
+
* BI.toNumber(42n) // Option.some(42)
|
|
524
|
+
* BI.toNumber(BigInt(Number.MAX_SAFE_INTEGER) + 1n) // Option.none()
|
|
525
|
+
* BI.toNumber(BigInt(Number.MIN_SAFE_INTEGER) - 1n) // Option.none()
|
|
523
526
|
* ```
|
|
524
527
|
*
|
|
525
528
|
* @category conversions
|
|
@@ -527,23 +530,23 @@ export const multiplyAll = collection => {
|
|
|
527
530
|
*/
|
|
528
531
|
export const toNumber = b => {
|
|
529
532
|
if (b > BigInt(Number.MAX_SAFE_INTEGER) || b < BigInt(Number.MIN_SAFE_INTEGER)) {
|
|
530
|
-
return
|
|
533
|
+
return Option.none();
|
|
531
534
|
}
|
|
532
|
-
return Number(b);
|
|
535
|
+
return Option.some(Number(b));
|
|
533
536
|
};
|
|
534
537
|
/**
|
|
535
538
|
* Converts a string to a `bigint`.
|
|
536
539
|
*
|
|
537
540
|
* If the string is empty or contains characters that cannot be converted into a
|
|
538
|
-
* `bigint`, it returns `
|
|
541
|
+
* `bigint`, it returns `Option.none()`.
|
|
539
542
|
*
|
|
540
543
|
* @example
|
|
541
544
|
* ```ts
|
|
542
545
|
* import { BigInt } from "effect"
|
|
543
546
|
*
|
|
544
|
-
* BigInt.fromString("42") // 42n
|
|
545
|
-
* BigInt.fromString(" ") //
|
|
546
|
-
* BigInt.fromString("a") //
|
|
547
|
+
* BigInt.fromString("42") // Option.some(42n)
|
|
548
|
+
* BigInt.fromString(" ") // Option.none()
|
|
549
|
+
* BigInt.fromString("a") // Option.none()
|
|
547
550
|
* ```
|
|
548
551
|
*
|
|
549
552
|
* @category conversions
|
|
@@ -551,9 +554,9 @@ export const toNumber = b => {
|
|
|
551
554
|
*/
|
|
552
555
|
export const fromString = s => {
|
|
553
556
|
try {
|
|
554
|
-
return s.trim() === "" ?
|
|
557
|
+
return s.trim() === "" ? Option.none() : Option.some(BigInt(s));
|
|
555
558
|
} catch {
|
|
556
|
-
return
|
|
559
|
+
return Option.none();
|
|
557
560
|
}
|
|
558
561
|
};
|
|
559
562
|
/**
|
|
@@ -561,16 +564,16 @@ export const fromString = s => {
|
|
|
561
564
|
*
|
|
562
565
|
* If the number is outside the safe integer range for JavaScript
|
|
563
566
|
* (`Number.MAX_SAFE_INTEGER` and `Number.MIN_SAFE_INTEGER`) or if the number is
|
|
564
|
-
* not a valid `bigint`, it returns `
|
|
567
|
+
* not a valid `bigint`, it returns `Option.none()`.
|
|
565
568
|
*
|
|
566
569
|
* @example
|
|
567
570
|
* ```ts
|
|
568
571
|
* import { BigInt } from "effect"
|
|
569
572
|
*
|
|
570
|
-
* BigInt.fromNumber(42) // 42n
|
|
573
|
+
* BigInt.fromNumber(42) // Option.some(42n)
|
|
571
574
|
*
|
|
572
|
-
* BigInt.fromNumber(Number.MAX_SAFE_INTEGER + 1) //
|
|
573
|
-
* BigInt.fromNumber(Number.MIN_SAFE_INTEGER - 1) //
|
|
575
|
+
* BigInt.fromNumber(Number.MAX_SAFE_INTEGER + 1) // Option.none()
|
|
576
|
+
* BigInt.fromNumber(Number.MIN_SAFE_INTEGER - 1) // Option.none()
|
|
574
577
|
* ```
|
|
575
578
|
*
|
|
576
579
|
* @category conversions
|
|
@@ -578,12 +581,12 @@ export const fromString = s => {
|
|
|
578
581
|
*/
|
|
579
582
|
export function fromNumber(n) {
|
|
580
583
|
if (n > Number.MAX_SAFE_INTEGER || n < Number.MIN_SAFE_INTEGER) {
|
|
581
|
-
return
|
|
584
|
+
return Option.none();
|
|
582
585
|
}
|
|
583
586
|
try {
|
|
584
|
-
return BigInt(n);
|
|
587
|
+
return Option.some(BigInt(n));
|
|
585
588
|
} catch {
|
|
586
|
-
return
|
|
589
|
+
return Option.none();
|
|
587
590
|
}
|
|
588
591
|
}
|
|
589
592
|
/**
|
package/dist/BigInt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BigInt.js","names":["Combiner","Equ","dual","order","predicate","Reducer","BigInt","globalThis","bigint0","bigint1","bigint2","isBigInt","sum","self","that","multiply","subtract","divide","
|
|
1
|
+
{"version":3,"file":"BigInt.js","names":["Combiner","Equ","dual","Option","order","predicate","Reducer","BigInt","globalThis","bigint0","bigint1","bigint2","isBigInt","sum","self","that","multiply","subtract","divide","none","some","divideUnsafe","increment","n","decrement","Order","Equivalence","isLessThan","isLessThanOrEqualTo","isGreaterThan","isGreaterThanOrEqualTo","between","isBetween","clamp","min","max","sign","abs","gcd","t","lcm","sqrtUnsafe","RangeError","x","sqrt","sumAll","collection","out","multiplyAll","toNumber","b","Number","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","fromString","s","trim","fromNumber","remainder","divisor","ReducerSum","make","a","ReducerMultiply","acc","CombinerMax","CombinerMin"],"sources":["../src/BigInt.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;AAOA,OAAO,KAAKA,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,GAAG,MAAM,kBAAkB;AACvC,SAASC,IAAI,QAAQ,eAAe;AACpC,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OA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} from "./Inspectable.ts";
|
|
78
78
|
import type { NonEmptyIterable } from "./NonEmptyIterable.ts";
|
|
79
79
|
import type { Option } from "./Option.ts";
|
|
80
|
+
import * as O from "./Option.ts";
|
|
80
81
|
import * as Order from "./Order.ts";
|
|
81
82
|
import type { Pipeable } from "./Pipeable.ts";
|
|
82
83
|
import { type Predicate, type Refinement } from "./Predicate.ts";
|
|
@@ -2927,7 +2928,7 @@ export declare const splitWhere: {
|
|
|
2927
2928
|
* @since 2.0.0
|
|
2928
2929
|
* @category elements
|
|
2929
2930
|
*/
|
|
2930
|
-
export declare const tail: <A>(self: Chunk<A>) => Chunk<A
|
|
2931
|
+
export declare const tail: <A>(self: Chunk<A>) => O.Option<Chunk<A>>;
|
|
2931
2932
|
/**
|
|
2932
2933
|
* Returns every elements after the first.
|
|
2933
2934
|
*
|
|
@@ -3519,15 +3520,15 @@ export declare const remove: {
|
|
|
3519
3520
|
*
|
|
3520
3521
|
* const chunk = Chunk.make(1, 2, 3, 4)
|
|
3521
3522
|
* const result = Chunk.modify(chunk, 1, (n) => n * 10)
|
|
3522
|
-
* console.log(result) //
|
|
3523
|
+
* console.log(result) // Option.some(Chunk.make(1, 20, 3, 4))
|
|
3523
3524
|
*
|
|
3524
3525
|
* // Index out of bounds returns None
|
|
3525
|
-
* const outOfBounds = chunk
|
|
3526
|
-
* console.log(outOfBounds
|
|
3526
|
+
* const outOfBounds = chunk.pipe(Chunk.modify(10, (n) => n * 10))
|
|
3527
|
+
* console.log(outOfBounds) // Option.none()
|
|
3527
3528
|
*
|
|
3528
3529
|
* // Negative index returns None
|
|
3529
|
-
* const negative = chunk
|
|
3530
|
-
* console.log(negative
|
|
3530
|
+
* const negative = chunk.pipe(Chunk.modify(-1, (n) => n * 10))
|
|
3531
|
+
* console.log(negative) // Option.none()
|
|
3531
3532
|
* ```
|
|
3532
3533
|
*
|
|
3533
3534
|
* @category elements
|
|
@@ -3544,21 +3545,21 @@ export declare const modify: {
|
|
|
3544
3545
|
*
|
|
3545
3546
|
* const chunk = Chunk.make(1, 2, 3, 4)
|
|
3546
3547
|
* const result = Chunk.modify(chunk, 1, (n) => n * 10)
|
|
3547
|
-
* console.log(result) //
|
|
3548
|
+
* console.log(result) // Option.some(Chunk.make(1, 20, 3, 4))
|
|
3548
3549
|
*
|
|
3549
3550
|
* // Index out of bounds returns None
|
|
3550
|
-
* const outOfBounds = chunk
|
|
3551
|
-
* console.log(outOfBounds
|
|
3551
|
+
* const outOfBounds = chunk.pipe(Chunk.modify(10, (n) => n * 10))
|
|
3552
|
+
* console.log(outOfBounds) // Option.none()
|
|
3552
3553
|
*
|
|
3553
3554
|
* // Negative index returns None
|
|
3554
|
-
* const negative = chunk
|
|
3555
|
-
* console.log(negative
|
|
3555
|
+
* const negative = chunk.pipe(Chunk.modify(-1, (n) => n * 10))
|
|
3556
|
+
* console.log(negative) // Option.none()
|
|
3556
3557
|
* ```
|
|
3557
3558
|
*
|
|
3558
3559
|
* @category elements
|
|
3559
3560
|
* @since 2.0.0
|
|
3560
3561
|
*/
|
|
3561
|
-
<A, B>(i: number, f: (a: A) => B): (self: Chunk<A>) => Chunk<A | B
|
|
3562
|
+
<A, B>(i: number, f: (a: A) => B): (self: Chunk<A>) => O.Option<Chunk<A | B>>;
|
|
3562
3563
|
/**
|
|
3563
3564
|
* Applies a function to the element at the specified index, creating a new `Chunk`,
|
|
3564
3565
|
* or returns `None` if the index is out of bounds.
|
|
@@ -3569,21 +3570,21 @@ export declare const modify: {
|
|
|
3569
3570
|
*
|
|
3570
3571
|
* const chunk = Chunk.make(1, 2, 3, 4)
|
|
3571
3572
|
* const result = Chunk.modify(chunk, 1, (n) => n * 10)
|
|
3572
|
-
* console.log(result) //
|
|
3573
|
+
* console.log(result) // Option.some(Chunk.make(1, 20, 3, 4))
|
|
3573
3574
|
*
|
|
3574
3575
|
* // Index out of bounds returns None
|
|
3575
|
-
* const outOfBounds = chunk
|
|
3576
|
-
* console.log(outOfBounds
|
|
3576
|
+
* const outOfBounds = chunk.pipe(Chunk.modify(10, (n) => n * 10))
|
|
3577
|
+
* console.log(outOfBounds) // Option.none()
|
|
3577
3578
|
*
|
|
3578
3579
|
* // Negative index returns None
|
|
3579
|
-
* const negative = chunk
|
|
3580
|
-
* console.log(negative
|
|
3580
|
+
* const negative = chunk.pipe(Chunk.modify(-1, (n) => n * 10))
|
|
3581
|
+
* console.log(negative) // Option.none()
|
|
3581
3582
|
* ```
|
|
3582
3583
|
*
|
|
3583
3584
|
* @category elements
|
|
3584
3585
|
* @since 2.0.0
|
|
3585
3586
|
*/
|
|
3586
|
-
<A, B>(self: Chunk<A>, i: number, f: (a: A) => B): Chunk<A | B
|
|
3587
|
+
<A, B>(self: Chunk<A>, i: number, f: (a: A) => B): O.Option<Chunk<A | B>>;
|
|
3587
3588
|
};
|
|
3588
3589
|
/**
|
|
3589
3590
|
* Change the element at the specified index, creating a new `Chunk`,
|
|
@@ -3595,15 +3596,15 @@ export declare const modify: {
|
|
|
3595
3596
|
*
|
|
3596
3597
|
* const chunk = Chunk.make("a", "b", "c", "d")
|
|
3597
3598
|
* const result = Chunk.replace(chunk, 1, "X")
|
|
3598
|
-
* console.log(result) //
|
|
3599
|
+
* console.log(result) // Option.some(Chunk.make("a", "X", "c", "d"))
|
|
3599
3600
|
*
|
|
3600
3601
|
* // Index out of bounds returns None
|
|
3601
|
-
* const outOfBounds = chunk
|
|
3602
|
-
* console.log(outOfBounds
|
|
3602
|
+
* const outOfBounds = chunk.pipe(Chunk.replace(10, "Y"))
|
|
3603
|
+
* console.log(outOfBounds) // Option.none()
|
|
3603
3604
|
*
|
|
3604
3605
|
* // Negative index returns None
|
|
3605
|
-
* const negative = chunk
|
|
3606
|
-
* console.log(negative
|
|
3606
|
+
* const negative = chunk.pipe(Chunk.replace(-1, "Z"))
|
|
3607
|
+
* console.log(negative) // Option.none()
|
|
3607
3608
|
* ```
|
|
3608
3609
|
*
|
|
3609
3610
|
* @category elements
|
|
@@ -3620,21 +3621,21 @@ export declare const replace: {
|
|
|
3620
3621
|
*
|
|
3621
3622
|
* const chunk = Chunk.make("a", "b", "c", "d")
|
|
3622
3623
|
* const result = Chunk.replace(chunk, 1, "X")
|
|
3623
|
-
* console.log(result) //
|
|
3624
|
+
* console.log(result) // Option.some(Chunk.make("a", "X", "c", "d"))
|
|
3624
3625
|
*
|
|
3625
3626
|
* // Index out of bounds returns None
|
|
3626
|
-
* const outOfBounds = chunk
|
|
3627
|
-
* console.log(outOfBounds
|
|
3627
|
+
* const outOfBounds = chunk.pipe(Chunk.replace(10, "Y"))
|
|
3628
|
+
* console.log(outOfBounds) // Option.none()
|
|
3628
3629
|
*
|
|
3629
3630
|
* // Negative index returns None
|
|
3630
|
-
* const negative = chunk
|
|
3631
|
-
* console.log(negative
|
|
3631
|
+
* const negative = chunk.pipe(Chunk.replace(-1, "Z"))
|
|
3632
|
+
* console.log(negative) // Option.none()
|
|
3632
3633
|
* ```
|
|
3633
3634
|
*
|
|
3634
3635
|
* @category elements
|
|
3635
3636
|
* @since 2.0.0
|
|
3636
3637
|
*/
|
|
3637
|
-
<B>(i: number, b: B): <A>(self: Chunk<A>) => Chunk<B | A
|
|
3638
|
+
<B>(i: number, b: B): <A>(self: Chunk<A>) => O.Option<Chunk<B | A>>;
|
|
3638
3639
|
/**
|
|
3639
3640
|
* Change the element at the specified index, creating a new `Chunk`,
|
|
3640
3641
|
* or returns `None` if the index is out of bounds.
|
|
@@ -3645,21 +3646,21 @@ export declare const replace: {
|
|
|
3645
3646
|
*
|
|
3646
3647
|
* const chunk = Chunk.make("a", "b", "c", "d")
|
|
3647
3648
|
* const result = Chunk.replace(chunk, 1, "X")
|
|
3648
|
-
* console.log(result) //
|
|
3649
|
+
* console.log(result) // Option.some(Chunk.make("a", "X", "c", "d"))
|
|
3649
3650
|
*
|
|
3650
3651
|
* // Index out of bounds returns None
|
|
3651
|
-
* const outOfBounds = chunk
|
|
3652
|
-
* console.log(outOfBounds
|
|
3652
|
+
* const outOfBounds = chunk.pipe(Chunk.replace(10, "Y"))
|
|
3653
|
+
* console.log(outOfBounds) // Option.none()
|
|
3653
3654
|
*
|
|
3654
3655
|
* // Negative index returns None
|
|
3655
|
-
* const negative = chunk
|
|
3656
|
-
* console.log(negative
|
|
3656
|
+
* const negative = chunk.pipe(Chunk.replace(-1, "Z"))
|
|
3657
|
+
* console.log(negative) // Option.none()
|
|
3657
3658
|
* ```
|
|
3658
3659
|
*
|
|
3659
3660
|
* @category elements
|
|
3660
3661
|
* @since 2.0.0
|
|
3661
3662
|
*/
|
|
3662
|
-
<A, B>(self: Chunk<A>, i: number, b: B): Chunk<B | A
|
|
3663
|
+
<A, B>(self: Chunk<A>, i: number, b: B): O.Option<Chunk<B | A>>;
|
|
3663
3664
|
};
|
|
3664
3665
|
/**
|
|
3665
3666
|
* Return a Chunk of length n with element i initialized with f(i).
|
|
@@ -4000,15 +4001,15 @@ export declare const findFirst: {
|
|
|
4000
4001
|
*
|
|
4001
4002
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
4002
4003
|
* const result = Chunk.findFirstIndex(chunk, (n) => n > 3)
|
|
4003
|
-
* console.log(result) // 3
|
|
4004
|
+
* console.log(result) // Option.some(3)
|
|
4004
4005
|
*
|
|
4005
4006
|
* // No match found
|
|
4006
4007
|
* const notFound = Chunk.findFirstIndex(chunk, (n) => n > 10)
|
|
4007
|
-
* console.log(notFound) //
|
|
4008
|
+
* console.log(notFound) // Option.none()
|
|
4008
4009
|
*
|
|
4009
4010
|
* // Find first even number
|
|
4010
4011
|
* const firstEven = Chunk.findFirstIndex(chunk, (n) => n % 2 === 0)
|
|
4011
|
-
* console.log(firstEven) // 1
|
|
4012
|
+
* console.log(firstEven) // Option.some(1)
|
|
4012
4013
|
* ```
|
|
4013
4014
|
*
|
|
4014
4015
|
* @category elements
|
|
@@ -4024,21 +4025,21 @@ export declare const findFirstIndex: {
|
|
|
4024
4025
|
*
|
|
4025
4026
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
4026
4027
|
* const result = Chunk.findFirstIndex(chunk, (n) => n > 3)
|
|
4027
|
-
* console.log(result) // 3
|
|
4028
|
+
* console.log(result) // Option.some(3)
|
|
4028
4029
|
*
|
|
4029
4030
|
* // No match found
|
|
4030
4031
|
* const notFound = Chunk.findFirstIndex(chunk, (n) => n > 10)
|
|
4031
|
-
* console.log(notFound) //
|
|
4032
|
+
* console.log(notFound) // Option.none()
|
|
4032
4033
|
*
|
|
4033
4034
|
* // Find first even number
|
|
4034
4035
|
* const firstEven = Chunk.findFirstIndex(chunk, (n) => n % 2 === 0)
|
|
4035
|
-
* console.log(firstEven) // 1
|
|
4036
|
+
* console.log(firstEven) // Option.some(1)
|
|
4036
4037
|
* ```
|
|
4037
4038
|
*
|
|
4038
4039
|
* @category elements
|
|
4039
4040
|
* @since 2.0.0
|
|
4040
4041
|
*/
|
|
4041
|
-
<A>(predicate: Predicate<A>): (self: Chunk<A>) => number
|
|
4042
|
+
<A>(predicate: Predicate<A>): (self: Chunk<A>) => O.Option<number>;
|
|
4042
4043
|
/**
|
|
4043
4044
|
* Return the first index for which a predicate holds.
|
|
4044
4045
|
*
|
|
@@ -4048,21 +4049,21 @@ export declare const findFirstIndex: {
|
|
|
4048
4049
|
*
|
|
4049
4050
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
4050
4051
|
* const result = Chunk.findFirstIndex(chunk, (n) => n > 3)
|
|
4051
|
-
* console.log(result) // 3
|
|
4052
|
+
* console.log(result) // Option.some(3)
|
|
4052
4053
|
*
|
|
4053
4054
|
* // No match found
|
|
4054
4055
|
* const notFound = Chunk.findFirstIndex(chunk, (n) => n > 10)
|
|
4055
|
-
* console.log(notFound) //
|
|
4056
|
+
* console.log(notFound) // Option.none()
|
|
4056
4057
|
*
|
|
4057
4058
|
* // Find first even number
|
|
4058
4059
|
* const firstEven = Chunk.findFirstIndex(chunk, (n) => n % 2 === 0)
|
|
4059
|
-
* console.log(firstEven) // 1
|
|
4060
|
+
* console.log(firstEven) // Option.some(1)
|
|
4060
4061
|
* ```
|
|
4061
4062
|
*
|
|
4062
4063
|
* @category elements
|
|
4063
4064
|
* @since 2.0.0
|
|
4064
4065
|
*/
|
|
4065
|
-
<A>(self: Chunk<A>, predicate: Predicate<A>): number
|
|
4066
|
+
<A>(self: Chunk<A>, predicate: Predicate<A>): O.Option<number>;
|
|
4066
4067
|
};
|
|
4067
4068
|
/**
|
|
4068
4069
|
* Find the last element for which a predicate holds.
|
|
@@ -4204,15 +4205,15 @@ export declare const findLast: {
|
|
|
4204
4205
|
*
|
|
4205
4206
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
4206
4207
|
* const result = Chunk.findLastIndex(chunk, (n) => n < 4)
|
|
4207
|
-
* console.log(result) // 2
|
|
4208
|
+
* console.log(result) // Option.some(2)
|
|
4208
4209
|
*
|
|
4209
4210
|
* // No match found
|
|
4210
4211
|
* const notFound = Chunk.findLastIndex(chunk, (n) => n > 10)
|
|
4211
|
-
* console.log(notFound) //
|
|
4212
|
+
* console.log(notFound) // Option.none()
|
|
4212
4213
|
*
|
|
4213
4214
|
* // Find last even number index
|
|
4214
4215
|
* const lastEven = Chunk.findLastIndex(chunk, (n) => n % 2 === 0)
|
|
4215
|
-
* console.log(lastEven) // 3
|
|
4216
|
+
* console.log(lastEven) // Option.some(3)
|
|
4216
4217
|
* ```
|
|
4217
4218
|
*
|
|
4218
4219
|
* @category elements
|
|
@@ -4228,21 +4229,21 @@ export declare const findLastIndex: {
|
|
|
4228
4229
|
*
|
|
4229
4230
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
4230
4231
|
* const result = Chunk.findLastIndex(chunk, (n) => n < 4)
|
|
4231
|
-
* console.log(result) // 2
|
|
4232
|
+
* console.log(result) // Option.some(2)
|
|
4232
4233
|
*
|
|
4233
4234
|
* // No match found
|
|
4234
4235
|
* const notFound = Chunk.findLastIndex(chunk, (n) => n > 10)
|
|
4235
|
-
* console.log(notFound) //
|
|
4236
|
+
* console.log(notFound) // Option.none()
|
|
4236
4237
|
*
|
|
4237
4238
|
* // Find last even number index
|
|
4238
4239
|
* const lastEven = Chunk.findLastIndex(chunk, (n) => n % 2 === 0)
|
|
4239
|
-
* console.log(lastEven) // 3
|
|
4240
|
+
* console.log(lastEven) // Option.some(3)
|
|
4240
4241
|
* ```
|
|
4241
4242
|
*
|
|
4242
4243
|
* @category elements
|
|
4243
4244
|
* @since 2.0.0
|
|
4244
4245
|
*/
|
|
4245
|
-
<A>(predicate: Predicate<A>): (self: Chunk<A>) => number
|
|
4246
|
+
<A>(predicate: Predicate<A>): (self: Chunk<A>) => O.Option<number>;
|
|
4246
4247
|
/**
|
|
4247
4248
|
* Return the last index for which a predicate holds.
|
|
4248
4249
|
*
|
|
@@ -4252,21 +4253,21 @@ export declare const findLastIndex: {
|
|
|
4252
4253
|
*
|
|
4253
4254
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
4254
4255
|
* const result = Chunk.findLastIndex(chunk, (n) => n < 4)
|
|
4255
|
-
* console.log(result) // 2
|
|
4256
|
+
* console.log(result) // Option.some(2)
|
|
4256
4257
|
*
|
|
4257
4258
|
* // No match found
|
|
4258
4259
|
* const notFound = Chunk.findLastIndex(chunk, (n) => n > 10)
|
|
4259
|
-
* console.log(notFound) //
|
|
4260
|
+
* console.log(notFound) // Option.none()
|
|
4260
4261
|
*
|
|
4261
4262
|
* // Find last even number index
|
|
4262
4263
|
* const lastEven = Chunk.findLastIndex(chunk, (n) => n % 2 === 0)
|
|
4263
|
-
* console.log(lastEven) // 3
|
|
4264
|
+
* console.log(lastEven) // Option.some(3)
|
|
4264
4265
|
* ```
|
|
4265
4266
|
*
|
|
4266
4267
|
* @category elements
|
|
4267
4268
|
* @since 2.0.0
|
|
4268
4269
|
*/
|
|
4269
|
-
<A>(self: Chunk<A>, predicate: Predicate<A>): number
|
|
4270
|
+
<A>(self: Chunk<A>, predicate: Predicate<A>): O.Option<number>;
|
|
4270
4271
|
};
|
|
4271
4272
|
/**
|
|
4272
4273
|
* Check if a predicate holds true for every `Chunk` element.
|