effect 4.0.0-beta.0 → 4.0.0-beta.10
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/Cache.d.ts +2 -2
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +1 -1
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +6 -4
- package/dist/Channel.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +3 -3
- package/dist/Config.js +3 -3
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +534 -365
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +132 -79
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +23 -161
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +6 -51
- package/dist/DateTime.js.map +1 -1
- package/dist/Duration.d.ts +12 -12
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +12 -12
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +175 -240
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +73 -119
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +194 -0
- package/dist/Encoding.d.ts.map +1 -0
- package/dist/Encoding.js +352 -0
- package/dist/Encoding.js.map +1 -0
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +124 -48
- package/dist/Equal.js.map +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +5 -5
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +30 -1
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +15 -0
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +229 -51
- package/dist/Formatter.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +2 -2
- package/dist/Graph.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +109 -0
- package/dist/Latch.d.ts.map +1 -0
- package/dist/Latch.js +72 -0
- package/dist/Latch.js.map +1 -0
- package/dist/LayerMap.d.ts +4 -4
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LogLevel.d.ts +27 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +4 -4
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Metric.d.ts +2 -2
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Pipeable.d.ts +17 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +19 -1
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +10 -9
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +2 -2
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +6 -4
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +7 -5
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts +3 -2
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -2
- package/dist/PubSub.js.map +1 -1
- package/dist/Random.d.ts +18 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +29 -12
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +2 -2
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +1 -1
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +2 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +6 -26
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +0 -20
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Result.d.ts +12 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +12 -0
- package/dist/Result.js.map +1 -1
- package/dist/Schedule.d.ts +33 -14
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +65 -24
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +199 -49
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +386 -72
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaGetter.d.ts +2 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +12 -14
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +44 -43
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +43 -24
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +37 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +80 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +211 -0
- package/dist/Semaphore.d.ts.map +1 -0
- package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
- package/dist/Semaphore.js.map +1 -0
- package/dist/Stream.d.ts +19 -19
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +12 -11
- package/dist/Stream.js.map +1 -1
- package/dist/Struct.d.ts +16 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +22 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +2 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Types.d.ts +14 -6
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +499 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +499 -19
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +11 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +3 -11
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +37 -22
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +3 -2
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/testing/TestClock.d.ts +7 -6
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +6 -4
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +6 -6
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +48 -48
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +3 -3
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +4 -3
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +2 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +51 -51
- package/dist/unstable/ai/McpServer.d.ts +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +20 -20
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts +26 -26
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +1 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +5 -5
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +5 -4
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +2 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +4 -3
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +8 -6
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +21 -21
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -4
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +2 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +1 -1
- package/dist/unstable/encoding/Sse.d.ts +4 -4
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -1
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
- package/dist/unstable/http/Cookies.d.ts +3 -3
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +2 -2
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +17 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +28 -1
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +11 -11
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +4 -4
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +27 -11
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +15 -3
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +18 -26
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +4 -9
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +6 -6
- package/dist/unstable/http/HttpServerResponse.js +1 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +3 -3
- package/dist/unstable/http/UrlParams.d.ts +14 -6
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +1 -1
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +5 -5
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +3 -3
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +21 -39
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +15 -24
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +18 -16
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +6 -6
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +12 -11
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -2
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +2 -2
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +6 -0
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +6 -6
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +15 -12
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +6 -6
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +3 -3
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +39 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
- package/dist/unstable/reactivity/Hydration.js +76 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -0
- package/dist/unstable/reactivity/index.d.ts +4 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +4 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +2 -2
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -26
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +6 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +5 -3
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +4 -4
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +2 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +13 -2
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +4 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +3 -2
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +24 -1
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +24 -3
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.js +0 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +2 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +3 -3
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +2 -2
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +2 -2
- package/dist/unstable/workflow/WorkflowEngine.d.ts +2 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +2 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -2
- package/src/Cache.ts +3 -3
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +6 -4
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +3 -3
- package/src/Data.ts +538 -374
- package/src/DateTime.ts +24 -164
- package/src/Duration.ts +15 -15
- package/src/Effect.ts +202 -261
- package/src/Encoding.ts +879 -0
- package/src/Equal.ts +278 -111
- package/src/FileSystem.ts +7 -8
- package/src/Filter.ts +48 -1
- package/src/Formatter.ts +253 -51
- package/src/Graph.ts +8 -5
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +112 -0
- package/src/LayerMap.ts +5 -5
- package/src/LogLevel.ts +31 -0
- package/src/Logger.ts +5 -5
- package/src/Metric.ts +4 -4
- package/src/Optic.ts +948 -19
- package/src/Pipeable.ts +32 -1
- package/src/PlatformError.ts +5 -5
- package/src/Pool.ts +13 -11
- package/src/PubSub.ts +10 -9
- package/src/Random.ts +33 -14
- package/src/RcMap.ts +5 -5
- package/src/RcRef.ts +1 -1
- package/src/Reducer.ts +166 -7
- package/src/Request.ts +3 -2
- package/src/RequestResolver.ts +9 -29
- package/src/Result.ts +13 -0
- package/src/Schedule.ts +279 -140
- package/src/Schema.ts +575 -113
- package/src/SchemaGetter.ts +12 -14
- package/src/SchemaRepresentation.ts +43 -24
- package/src/SchemaTransformation.ts +104 -0
- package/src/ScopedCache.ts +3 -3
- package/src/Semaphore.ts +356 -0
- package/src/Stream.ts +43 -42
- package/src/Struct.ts +26 -0
- package/src/SubscriptionRef.ts +3 -2
- package/src/SynchronizedRef.ts +3 -2
- package/src/Types.ts +12 -2
- package/src/index.ts +502 -20
- package/src/internal/core.ts +12 -5
- package/src/internal/dateTime.ts +9 -30
- package/src/internal/effect.ts +70 -37
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +4 -3
- package/src/testing/TestClock.ts +13 -11
- package/src/testing/TestSchema.ts +8 -8
- package/src/unstable/ai/AiError.ts +2 -2
- package/src/unstable/ai/Chat.ts +12 -11
- package/src/unstable/ai/LanguageModel.ts +3 -3
- package/src/unstable/ai/McpServer.ts +2 -2
- package/src/unstable/ai/Prompt.ts +37 -37
- package/src/unstable/ai/Response.ts +25 -25
- package/src/unstable/cli/Prompt.ts +2 -2
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +3 -2
- package/src/unstable/cluster/Entity.ts +7 -6
- package/src/unstable/cluster/EntityResource.ts +4 -4
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/K8sHttpClient.ts +1 -1
- package/src/unstable/cluster/MessageStorage.ts +3 -5
- package/src/unstable/cluster/Runners.ts +6 -5
- package/src/unstable/cluster/Sharding.ts +11 -9
- package/src/unstable/cluster/ShardingConfig.ts +10 -11
- package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +9 -8
- package/src/unstable/cluster/internal/entityReaper.ts +2 -1
- package/src/unstable/cluster/internal/resourceRef.ts +2 -1
- package/src/unstable/encoding/Sse.ts +2 -4
- package/src/unstable/eventlog/EventLog.ts +2 -1
- package/src/unstable/http/Cookies.ts +3 -3
- package/src/unstable/http/HttpBody.ts +42 -1
- package/src/unstable/http/HttpClient.ts +19 -19
- package/src/unstable/http/HttpClientRequest.ts +38 -13
- package/src/unstable/http/HttpEffect.ts +17 -25
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +5 -10
- package/src/unstable/http/HttpServerResponse.ts +1 -1
- package/src/unstable/http/Multipart.ts +2 -2
- package/src/unstable/http/UrlParams.ts +20 -5
- package/src/unstable/httpapi/HttpApiBuilder.ts +5 -5
- package/src/unstable/httpapi/HttpApiClient.ts +3 -3
- package/src/unstable/httpapi/HttpApiEndpoint.ts +47 -72
- package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
- package/src/unstable/httpapi/OpenApi.ts +18 -16
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +3 -3
- package/src/unstable/observability/OtlpLogger.ts +4 -4
- package/src/unstable/observability/OtlpMetrics.ts +4 -4
- package/src/unstable/observability/OtlpTracer.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +6 -6
- package/src/unstable/persistence/Persistable.ts +2 -2
- package/src/unstable/persistence/PersistedCache.ts +20 -9
- package/src/unstable/persistence/PersistedQueue.ts +25 -24
- package/src/unstable/persistence/Persistence.ts +3 -3
- package/src/unstable/persistence/RateLimiter.ts +4 -4
- package/src/unstable/process/ChildProcess.ts +2 -2
- package/src/unstable/process/ChildProcessSpawner.ts +6 -0
- package/src/unstable/reactivity/Atom.ts +20 -18
- package/src/unstable/reactivity/AtomHttpApi.ts +19 -18
- package/src/unstable/reactivity/AtomRpc.ts +3 -3
- package/src/unstable/reactivity/Hydration.ts +112 -0
- package/src/unstable/reactivity/index.ts +5 -0
- package/src/unstable/rpc/Rpc.ts +3 -3
- package/src/unstable/rpc/RpcClient.ts +12 -54
- package/src/unstable/rpc/RpcServer.ts +6 -4
- package/src/unstable/rpc/Utils.ts +2 -1
- package/src/unstable/schema/VariantSchema.ts +36 -7
- package/src/unstable/socket/Socket.ts +7 -6
- package/src/unstable/sql/SqlModel.ts +2 -2
- package/src/unstable/sql/SqlSchema.ts +62 -13
- package/src/unstable/sql/Statement.ts +0 -1
- package/src/unstable/workers/Worker.ts +2 -1
- package/src/unstable/workflow/DurableClock.ts +8 -8
- package/src/unstable/workflow/DurableDeferred.ts +2 -2
- package/src/unstable/workflow/WorkflowEngine.ts +3 -2
- package/dist/PartitionedSemaphore.d.ts +0 -52
- package/dist/PartitionedSemaphore.d.ts.map +0 -1
- package/dist/PartitionedSemaphore.js.map +0 -1
- package/dist/encoding/Base64.d.ts +0 -67
- package/dist/encoding/Base64.d.ts.map +0 -1
- package/dist/encoding/Base64.js +0 -146
- package/dist/encoding/Base64.js.map +0 -1
- package/dist/encoding/Base64Url.d.ts +0 -60
- package/dist/encoding/Base64Url.d.ts.map +0 -1
- package/dist/encoding/Base64Url.js +0 -89
- package/dist/encoding/Base64Url.js.map +0 -1
- package/dist/encoding/EncodingError.d.ts +0 -31
- package/dist/encoding/EncodingError.d.ts.map +0 -1
- package/dist/encoding/EncodingError.js +0 -22
- package/dist/encoding/EncodingError.js.map +0 -1
- package/dist/encoding/Hex.d.ts +0 -61
- package/dist/encoding/Hex.d.ts.map +0 -1
- package/dist/encoding/Hex.js +0 -115
- package/dist/encoding/Hex.js.map +0 -1
- package/dist/encoding/index.d.ts +0 -26
- package/dist/encoding/index.d.ts.map +0 -1
- package/dist/encoding/index.js +0 -27
- package/dist/encoding/index.js.map +0 -1
- package/src/PartitionedSemaphore.ts +0 -182
- package/src/encoding/Base64.ts +0 -366
- package/src/encoding/Base64Url.ts +0 -104
- package/src/encoding/EncodingError.ts +0 -35
- package/src/encoding/Hex.ts +0 -390
- package/src/encoding/index.ts +0 -31
package/dist/Combiner.d.ts
CHANGED
|
@@ -1,15 +1,91 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* A module for combining two values of the same type into one.
|
|
3
|
+
*
|
|
4
|
+
* A `Combiner<A>` wraps a single binary function `(self: A, that: A) => A`.
|
|
5
|
+
* It describes *how* two values merge but carries no initial/empty value
|
|
6
|
+
* (for that, see {@link Reducer} which extends `Combiner` with an
|
|
7
|
+
* `initialValue`).
|
|
8
|
+
*
|
|
9
|
+
* ## Mental model
|
|
10
|
+
*
|
|
11
|
+
* - **Combiner** – an object with a `combine(self, that)` method that returns
|
|
12
|
+
* a value of the same type.
|
|
13
|
+
* - **Argument order** – `self` is the "left" / accumulator side, `that` is
|
|
14
|
+
* the "right" / incoming side.
|
|
15
|
+
* - **No identity element** – unlike a monoid, a `Combiner` does not require
|
|
16
|
+
* a neutral element. Use {@link Reducer} when you need one.
|
|
17
|
+
* - **Purity** – all combiners produced by this module are pure; they never
|
|
18
|
+
* mutate their arguments.
|
|
19
|
+
* - **Composability** – combiners can be lifted into `Option`, `Struct`,
|
|
20
|
+
* `Tuple`, and other container types via helpers in those modules.
|
|
21
|
+
*
|
|
22
|
+
* ## Common tasks
|
|
23
|
+
*
|
|
24
|
+
* - Create a combiner from any binary function → {@link make}
|
|
25
|
+
* - Swap argument order → {@link flip}
|
|
26
|
+
* - Pick the smaller / larger of two values → {@link min} / {@link max}
|
|
27
|
+
* - Always keep the first or last value → {@link first} / {@link last}
|
|
28
|
+
* - Ignore both values and return a fixed result → {@link constant}
|
|
29
|
+
* - Insert a separator between combined values → {@link intercalate}
|
|
30
|
+
*
|
|
31
|
+
* ## Gotchas
|
|
32
|
+
*
|
|
33
|
+
* - `min` and `max` require an `Order<A>`, not a raw comparator. Import from
|
|
34
|
+
* e.g. `Number.Order` or `String.Order`.
|
|
35
|
+
* - `intercalate` is curried: call it with the separator first, then pass the
|
|
36
|
+
* base combiner.
|
|
37
|
+
* - A `Reducer` (which adds `initialValue`) is also a valid `Combiner` — you
|
|
38
|
+
* can pass a `Reducer` anywhere a `Combiner` is expected.
|
|
39
|
+
*
|
|
40
|
+
* ## Quickstart
|
|
41
|
+
*
|
|
42
|
+
* **Example** (combining strings with a separator)
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { Combiner, String } from "effect"
|
|
46
|
+
*
|
|
47
|
+
* const csv = Combiner.intercalate(",")(String.ReducerConcat)
|
|
48
|
+
*
|
|
49
|
+
* console.log(csv.combine("a", "b"))
|
|
50
|
+
* // Output: "a,b"
|
|
51
|
+
*
|
|
52
|
+
* console.log(csv.combine(csv.combine("a", "b"), "c"))
|
|
53
|
+
* // Output: "a,b,c"
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* ## See also
|
|
57
|
+
*
|
|
58
|
+
* - {@link make} – the primary constructor
|
|
59
|
+
* - {@link Combiner} – the core interface
|
|
60
|
+
*
|
|
2
61
|
* @since 4.0.0
|
|
3
62
|
*/
|
|
4
63
|
import type * as Order from "./Order.ts";
|
|
5
64
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
65
|
+
* Represents a strategy for combining two values of the same type `A`.
|
|
66
|
+
*
|
|
67
|
+
* A `Combiner` contains a single `combine` method that takes two values and
|
|
68
|
+
* returns a merged result. It does not include an identity/empty value; use
|
|
69
|
+
* `Reducer` when you need one.
|
|
70
|
+
*
|
|
71
|
+
* When to use:
|
|
72
|
+
* - You need to describe how two values of the same type merge.
|
|
73
|
+
* - You want to pass a reusable combining strategy to library functions like
|
|
74
|
+
* `Struct.makeCombiner` or `Option.makeCombinerFailFast`.
|
|
75
|
+
* - You are building a `Reducer` and need to define the combining step first.
|
|
76
|
+
*
|
|
77
|
+
* **Example** (number addition combiner)
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { Combiner } from "effect"
|
|
81
|
+
*
|
|
82
|
+
* const Sum = Combiner.make<number>((self, that) => self + that)
|
|
8
83
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
84
|
+
* console.log(Sum.combine(3, 4))
|
|
85
|
+
* // Output: 7
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @see {@link make} – create a `Combiner` from a function
|
|
13
89
|
*
|
|
14
90
|
* @category model
|
|
15
91
|
* @since 4.0.0
|
|
@@ -21,47 +97,238 @@ export interface Combiner<A> {
|
|
|
21
97
|
readonly combine: (self: A, that: A) => A;
|
|
22
98
|
}
|
|
23
99
|
/**
|
|
24
|
-
* Creates a `Combiner` from a
|
|
100
|
+
* Creates a `Combiner` from a binary function.
|
|
101
|
+
*
|
|
102
|
+
* When to use:
|
|
103
|
+
* - You have a custom combining operation that is not covered by the built-in
|
|
104
|
+
* constructors (`min`, `max`, `first`, `last`, `constant`).
|
|
105
|
+
*
|
|
106
|
+
* Behavior:
|
|
107
|
+
* - Returns a new `Combiner` whose `combine` method delegates to the provided
|
|
108
|
+
* function.
|
|
109
|
+
* - Pure – the returned combiner does not mutate its arguments.
|
|
110
|
+
*
|
|
111
|
+
* **Example** (multiplying numbers)
|
|
112
|
+
*
|
|
113
|
+
* ```ts
|
|
114
|
+
* import { Combiner } from "effect"
|
|
115
|
+
*
|
|
116
|
+
* const Product = Combiner.make<number>((self, that) => self * that)
|
|
117
|
+
*
|
|
118
|
+
* console.log(Product.combine(3, 5))
|
|
119
|
+
* // Output: 15
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @see {@link Combiner} – the interface this creates
|
|
25
123
|
*
|
|
26
124
|
* @since 4.0.0
|
|
27
125
|
*/
|
|
28
126
|
export declare function make<A>(combine: (self: A, that: A) => A): Combiner<A>;
|
|
29
127
|
/**
|
|
128
|
+
* Reverses the argument order of a combiner's `combine` method.
|
|
129
|
+
*
|
|
130
|
+
* When to use:
|
|
131
|
+
* - You need the "right" value to act as the accumulator side.
|
|
132
|
+
* - You want to reverse the natural direction of a non-commutative combiner
|
|
133
|
+
* (e.g. string concatenation).
|
|
134
|
+
*
|
|
135
|
+
* Behavior:
|
|
136
|
+
* - Returns a new `Combiner` where `combine(self, that)` calls the original
|
|
137
|
+
* combiner as `combine(that, self)`.
|
|
138
|
+
* - Does not mutate the input combiner.
|
|
139
|
+
*
|
|
140
|
+
* **Example** (reversing string concatenation)
|
|
141
|
+
*
|
|
142
|
+
* ```ts
|
|
143
|
+
* import { Combiner, String } from "effect"
|
|
144
|
+
*
|
|
145
|
+
* const Prepend = Combiner.flip(String.ReducerConcat)
|
|
146
|
+
*
|
|
147
|
+
* console.log(Prepend.combine("a", "b"))
|
|
148
|
+
* // Output: "ba"
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* @see {@link make}
|
|
152
|
+
*
|
|
30
153
|
* @since 4.0.0
|
|
31
154
|
*/
|
|
32
155
|
export declare function flip<A>(combiner: Combiner<A>): Combiner<A>;
|
|
33
156
|
/**
|
|
34
|
-
* Creates a `Combiner` that returns the smaller of two values
|
|
157
|
+
* Creates a `Combiner` that returns the smaller of two values according to
|
|
158
|
+
* the provided `Order`.
|
|
159
|
+
*
|
|
160
|
+
* When to use:
|
|
161
|
+
* - You want to accumulate the minimum value across a collection.
|
|
162
|
+
* - You are building a `Reducer` that tracks the running minimum.
|
|
163
|
+
*
|
|
164
|
+
* Behavior:
|
|
165
|
+
* - Compares using the given `Order`. When values are equal, returns `that`
|
|
166
|
+
* (the second argument).
|
|
167
|
+
* - Pure – does not mutate either argument.
|
|
168
|
+
*
|
|
169
|
+
* **Example** (minimum of two numbers)
|
|
170
|
+
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { Combiner, Number } from "effect"
|
|
173
|
+
*
|
|
174
|
+
* const Min = Combiner.min(Number.Order)
|
|
175
|
+
*
|
|
176
|
+
* console.log(Min.combine(3, 1))
|
|
177
|
+
* // Output: 1
|
|
178
|
+
*
|
|
179
|
+
* console.log(Min.combine(1, 3))
|
|
180
|
+
* // Output: 1
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @see {@link max}
|
|
35
184
|
*
|
|
36
185
|
* @since 4.0.0
|
|
37
186
|
*/
|
|
38
187
|
export declare function min<A>(order: Order.Order<A>): Combiner<A>;
|
|
39
188
|
/**
|
|
40
|
-
* Creates a `Combiner` that returns the larger of two values
|
|
189
|
+
* Creates a `Combiner` that returns the larger of two values according to
|
|
190
|
+
* the provided `Order`.
|
|
191
|
+
*
|
|
192
|
+
* When to use:
|
|
193
|
+
* - You want to accumulate the maximum value across a collection.
|
|
194
|
+
* - You are building a `Reducer` that tracks the running maximum.
|
|
195
|
+
*
|
|
196
|
+
* Behavior:
|
|
197
|
+
* - Compares using the given `Order`. When values are equal, returns `that`
|
|
198
|
+
* (the second argument).
|
|
199
|
+
* - Pure – does not mutate either argument.
|
|
200
|
+
*
|
|
201
|
+
* **Example** (maximum of two numbers)
|
|
202
|
+
*
|
|
203
|
+
* ```ts
|
|
204
|
+
* import { Combiner, Number } from "effect"
|
|
205
|
+
*
|
|
206
|
+
* const Max = Combiner.max(Number.Order)
|
|
207
|
+
*
|
|
208
|
+
* console.log(Max.combine(3, 1))
|
|
209
|
+
* // Output: 3
|
|
210
|
+
*
|
|
211
|
+
* console.log(Max.combine(1, 3))
|
|
212
|
+
* // Output: 3
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @see {@link min}
|
|
41
216
|
*
|
|
42
217
|
* @since 4.0.0
|
|
43
218
|
*/
|
|
44
219
|
export declare function max<A>(order: Order.Order<A>): Combiner<A>;
|
|
45
220
|
/**
|
|
46
|
-
* Creates a `Combiner` that returns the first
|
|
221
|
+
* Creates a `Combiner` that always returns the first (left) argument.
|
|
222
|
+
*
|
|
223
|
+
* When to use:
|
|
224
|
+
* - You want "first write wins" semantics when merging values.
|
|
225
|
+
* - You need a combiner but the combining logic should be a no-op that keeps
|
|
226
|
+
* the existing value.
|
|
227
|
+
*
|
|
228
|
+
* Behavior:
|
|
229
|
+
* - `combine(self, that)` returns `self`, ignoring `that`.
|
|
230
|
+
* - Pure – the second argument is discarded, not mutated.
|
|
231
|
+
*
|
|
232
|
+
* **Example** (keeping the first value)
|
|
233
|
+
*
|
|
234
|
+
* ```ts
|
|
235
|
+
* import { Combiner } from "effect"
|
|
236
|
+
*
|
|
237
|
+
* const First = Combiner.first<number>()
|
|
238
|
+
*
|
|
239
|
+
* console.log(First.combine(1, 2))
|
|
240
|
+
* // Output: 1
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* @see {@link last}
|
|
47
244
|
*
|
|
48
245
|
* @since 4.0.0
|
|
49
246
|
*/
|
|
50
247
|
export declare function first<A>(): Combiner<A>;
|
|
51
248
|
/**
|
|
52
|
-
* Creates a `Combiner` that returns the last
|
|
249
|
+
* Creates a `Combiner` that always returns the last (right) argument.
|
|
250
|
+
*
|
|
251
|
+
* When to use:
|
|
252
|
+
* - You want "last write wins" semantics when merging values.
|
|
253
|
+
* - You need a combiner that replaces the accumulator with each new value.
|
|
254
|
+
*
|
|
255
|
+
* Behavior:
|
|
256
|
+
* - `combine(self, that)` returns `that`, ignoring `self`.
|
|
257
|
+
* - Pure – the first argument is discarded, not mutated.
|
|
258
|
+
*
|
|
259
|
+
* **Example** (keeping the last value)
|
|
260
|
+
*
|
|
261
|
+
* ```ts
|
|
262
|
+
* import { Combiner } from "effect"
|
|
263
|
+
*
|
|
264
|
+
* const Last = Combiner.last<number>()
|
|
265
|
+
*
|
|
266
|
+
* console.log(Last.combine(1, 2))
|
|
267
|
+
* // Output: 2
|
|
268
|
+
* ```
|
|
269
|
+
*
|
|
270
|
+
* @see {@link first}
|
|
53
271
|
*
|
|
54
272
|
* @since 4.0.0
|
|
55
273
|
*/
|
|
56
274
|
export declare function last<A>(): Combiner<A>;
|
|
57
275
|
/**
|
|
58
|
-
* Creates a `Combiner` that
|
|
276
|
+
* Creates a `Combiner` that ignores both arguments and always returns the
|
|
277
|
+
* given constant value.
|
|
278
|
+
*
|
|
279
|
+
* When to use:
|
|
280
|
+
* - You need a combiner that produces a fixed result regardless of input.
|
|
281
|
+
* - You are providing a combiner to a generic API but the combined value is
|
|
282
|
+
* predetermined.
|
|
283
|
+
*
|
|
284
|
+
* Behavior:
|
|
285
|
+
* - `combine(self, that)` returns the constant `a`, ignoring both arguments.
|
|
286
|
+
* - Pure – no mutation occurs.
|
|
287
|
+
*
|
|
288
|
+
* **Example** (always returning zero)
|
|
289
|
+
*
|
|
290
|
+
* ```ts
|
|
291
|
+
* import { Combiner } from "effect"
|
|
292
|
+
*
|
|
293
|
+
* const Zero = Combiner.constant(0)
|
|
294
|
+
*
|
|
295
|
+
* console.log(Zero.combine(42, 99))
|
|
296
|
+
* // Output: 0
|
|
297
|
+
* ```
|
|
298
|
+
*
|
|
299
|
+
* @see {@link first}
|
|
300
|
+
* @see {@link last}
|
|
59
301
|
*
|
|
60
302
|
* @since 4.0.0
|
|
61
303
|
*/
|
|
62
304
|
export declare function constant<A>(a: A): Combiner<A>;
|
|
63
305
|
/**
|
|
64
|
-
*
|
|
306
|
+
* Wraps a `Combiner` so that a separator value is inserted between every
|
|
307
|
+
* pair of combined elements.
|
|
308
|
+
*
|
|
309
|
+
* When to use:
|
|
310
|
+
* - You are building delimited strings (CSV, paths, etc.) by repeated
|
|
311
|
+
* combination.
|
|
312
|
+
* - You need to inject a fixed separator between accumulated values.
|
|
313
|
+
*
|
|
314
|
+
* Behavior:
|
|
315
|
+
* - `intercalate(middle)(combiner).combine(self, that)` is equivalent to
|
|
316
|
+
* `combiner.combine(self, combiner.combine(middle, that))`.
|
|
317
|
+
* - Curried: first provide the separator, then the base combiner.
|
|
318
|
+
* - Does not mutate the input combiner; returns a new one.
|
|
319
|
+
*
|
|
320
|
+
* **Example** (joining strings with a separator)
|
|
321
|
+
*
|
|
322
|
+
* ```ts
|
|
323
|
+
* import { Combiner, String } from "effect"
|
|
324
|
+
*
|
|
325
|
+
* const commaSep = Combiner.intercalate(",")(String.ReducerConcat)
|
|
326
|
+
*
|
|
327
|
+
* console.log(commaSep.combine("a", "b"))
|
|
328
|
+
* // Output: "a,b"
|
|
329
|
+
* ```
|
|
330
|
+
*
|
|
331
|
+
* @see {@link make}
|
|
65
332
|
*
|
|
66
333
|
* @since 4.0.0
|
|
67
334
|
*/
|
package/dist/Combiner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combiner.d.ts","sourceRoot":"","sources":["../src/Combiner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Combiner.d.ts","sourceRoot":"","sources":["../src/Combiner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAA;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAErE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAEzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAEzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,KAAK,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAEtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAErC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,IAC9B,UAAU,QAAQ,CAAC,CAAC,CAAC,KAAG,QAAQ,CAAC,CAAC,CAAC,CAE5C"}
|
package/dist/Combiner.js
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Creates a `Combiner` from a
|
|
2
|
+
* Creates a `Combiner` from a binary function.
|
|
3
|
+
*
|
|
4
|
+
* When to use:
|
|
5
|
+
* - You have a custom combining operation that is not covered by the built-in
|
|
6
|
+
* constructors (`min`, `max`, `first`, `last`, `constant`).
|
|
7
|
+
*
|
|
8
|
+
* Behavior:
|
|
9
|
+
* - Returns a new `Combiner` whose `combine` method delegates to the provided
|
|
10
|
+
* function.
|
|
11
|
+
* - Pure – the returned combiner does not mutate its arguments.
|
|
12
|
+
*
|
|
13
|
+
* **Example** (multiplying numbers)
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { Combiner } from "effect"
|
|
17
|
+
*
|
|
18
|
+
* const Product = Combiner.make<number>((self, that) => self * that)
|
|
19
|
+
*
|
|
20
|
+
* console.log(Product.combine(3, 5))
|
|
21
|
+
* // Output: 15
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see {@link Combiner} – the interface this creates
|
|
3
25
|
*
|
|
4
26
|
* @since 4.0.0
|
|
5
27
|
*/
|
|
@@ -9,13 +31,64 @@ export function make(combine) {
|
|
|
9
31
|
};
|
|
10
32
|
}
|
|
11
33
|
/**
|
|
34
|
+
* Reverses the argument order of a combiner's `combine` method.
|
|
35
|
+
*
|
|
36
|
+
* When to use:
|
|
37
|
+
* - You need the "right" value to act as the accumulator side.
|
|
38
|
+
* - You want to reverse the natural direction of a non-commutative combiner
|
|
39
|
+
* (e.g. string concatenation).
|
|
40
|
+
*
|
|
41
|
+
* Behavior:
|
|
42
|
+
* - Returns a new `Combiner` where `combine(self, that)` calls the original
|
|
43
|
+
* combiner as `combine(that, self)`.
|
|
44
|
+
* - Does not mutate the input combiner.
|
|
45
|
+
*
|
|
46
|
+
* **Example** (reversing string concatenation)
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { Combiner, String } from "effect"
|
|
50
|
+
*
|
|
51
|
+
* const Prepend = Combiner.flip(String.ReducerConcat)
|
|
52
|
+
*
|
|
53
|
+
* console.log(Prepend.combine("a", "b"))
|
|
54
|
+
* // Output: "ba"
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @see {@link make}
|
|
58
|
+
*
|
|
12
59
|
* @since 4.0.0
|
|
13
60
|
*/
|
|
14
61
|
export function flip(combiner) {
|
|
15
62
|
return make((self, that) => combiner.combine(that, self));
|
|
16
63
|
}
|
|
17
64
|
/**
|
|
18
|
-
* Creates a `Combiner` that returns the smaller of two values
|
|
65
|
+
* Creates a `Combiner` that returns the smaller of two values according to
|
|
66
|
+
* the provided `Order`.
|
|
67
|
+
*
|
|
68
|
+
* When to use:
|
|
69
|
+
* - You want to accumulate the minimum value across a collection.
|
|
70
|
+
* - You are building a `Reducer` that tracks the running minimum.
|
|
71
|
+
*
|
|
72
|
+
* Behavior:
|
|
73
|
+
* - Compares using the given `Order`. When values are equal, returns `that`
|
|
74
|
+
* (the second argument).
|
|
75
|
+
* - Pure – does not mutate either argument.
|
|
76
|
+
*
|
|
77
|
+
* **Example** (minimum of two numbers)
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { Combiner, Number } from "effect"
|
|
81
|
+
*
|
|
82
|
+
* const Min = Combiner.min(Number.Order)
|
|
83
|
+
*
|
|
84
|
+
* console.log(Min.combine(3, 1))
|
|
85
|
+
* // Output: 1
|
|
86
|
+
*
|
|
87
|
+
* console.log(Min.combine(1, 3))
|
|
88
|
+
* // Output: 1
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @see {@link max}
|
|
19
92
|
*
|
|
20
93
|
* @since 4.0.0
|
|
21
94
|
*/
|
|
@@ -23,7 +96,33 @@ export function min(order) {
|
|
|
23
96
|
return make((self, that) => order(self, that) === -1 ? self : that);
|
|
24
97
|
}
|
|
25
98
|
/**
|
|
26
|
-
* Creates a `Combiner` that returns the larger of two values
|
|
99
|
+
* Creates a `Combiner` that returns the larger of two values according to
|
|
100
|
+
* the provided `Order`.
|
|
101
|
+
*
|
|
102
|
+
* When to use:
|
|
103
|
+
* - You want to accumulate the maximum value across a collection.
|
|
104
|
+
* - You are building a `Reducer` that tracks the running maximum.
|
|
105
|
+
*
|
|
106
|
+
* Behavior:
|
|
107
|
+
* - Compares using the given `Order`. When values are equal, returns `that`
|
|
108
|
+
* (the second argument).
|
|
109
|
+
* - Pure – does not mutate either argument.
|
|
110
|
+
*
|
|
111
|
+
* **Example** (maximum of two numbers)
|
|
112
|
+
*
|
|
113
|
+
* ```ts
|
|
114
|
+
* import { Combiner, Number } from "effect"
|
|
115
|
+
*
|
|
116
|
+
* const Max = Combiner.max(Number.Order)
|
|
117
|
+
*
|
|
118
|
+
* console.log(Max.combine(3, 1))
|
|
119
|
+
* // Output: 3
|
|
120
|
+
*
|
|
121
|
+
* console.log(Max.combine(1, 3))
|
|
122
|
+
* // Output: 3
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @see {@link min}
|
|
27
126
|
*
|
|
28
127
|
* @since 4.0.0
|
|
29
128
|
*/
|
|
@@ -31,7 +130,29 @@ export function max(order) {
|
|
|
31
130
|
return make((self, that) => order(self, that) === 1 ? self : that);
|
|
32
131
|
}
|
|
33
132
|
/**
|
|
34
|
-
* Creates a `Combiner` that returns the first
|
|
133
|
+
* Creates a `Combiner` that always returns the first (left) argument.
|
|
134
|
+
*
|
|
135
|
+
* When to use:
|
|
136
|
+
* - You want "first write wins" semantics when merging values.
|
|
137
|
+
* - You need a combiner but the combining logic should be a no-op that keeps
|
|
138
|
+
* the existing value.
|
|
139
|
+
*
|
|
140
|
+
* Behavior:
|
|
141
|
+
* - `combine(self, that)` returns `self`, ignoring `that`.
|
|
142
|
+
* - Pure – the second argument is discarded, not mutated.
|
|
143
|
+
*
|
|
144
|
+
* **Example** (keeping the first value)
|
|
145
|
+
*
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { Combiner } from "effect"
|
|
148
|
+
*
|
|
149
|
+
* const First = Combiner.first<number>()
|
|
150
|
+
*
|
|
151
|
+
* console.log(First.combine(1, 2))
|
|
152
|
+
* // Output: 1
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @see {@link last}
|
|
35
156
|
*
|
|
36
157
|
* @since 4.0.0
|
|
37
158
|
*/
|
|
@@ -39,7 +160,28 @@ export function first() {
|
|
|
39
160
|
return make((self, _) => self);
|
|
40
161
|
}
|
|
41
162
|
/**
|
|
42
|
-
* Creates a `Combiner` that returns the last
|
|
163
|
+
* Creates a `Combiner` that always returns the last (right) argument.
|
|
164
|
+
*
|
|
165
|
+
* When to use:
|
|
166
|
+
* - You want "last write wins" semantics when merging values.
|
|
167
|
+
* - You need a combiner that replaces the accumulator with each new value.
|
|
168
|
+
*
|
|
169
|
+
* Behavior:
|
|
170
|
+
* - `combine(self, that)` returns `that`, ignoring `self`.
|
|
171
|
+
* - Pure – the first argument is discarded, not mutated.
|
|
172
|
+
*
|
|
173
|
+
* **Example** (keeping the last value)
|
|
174
|
+
*
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { Combiner } from "effect"
|
|
177
|
+
*
|
|
178
|
+
* const Last = Combiner.last<number>()
|
|
179
|
+
*
|
|
180
|
+
* console.log(Last.combine(1, 2))
|
|
181
|
+
* // Output: 2
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @see {@link first}
|
|
43
185
|
*
|
|
44
186
|
* @since 4.0.0
|
|
45
187
|
*/
|
|
@@ -47,7 +189,31 @@ export function last() {
|
|
|
47
189
|
return make((_, that) => that);
|
|
48
190
|
}
|
|
49
191
|
/**
|
|
50
|
-
* Creates a `Combiner` that
|
|
192
|
+
* Creates a `Combiner` that ignores both arguments and always returns the
|
|
193
|
+
* given constant value.
|
|
194
|
+
*
|
|
195
|
+
* When to use:
|
|
196
|
+
* - You need a combiner that produces a fixed result regardless of input.
|
|
197
|
+
* - You are providing a combiner to a generic API but the combined value is
|
|
198
|
+
* predetermined.
|
|
199
|
+
*
|
|
200
|
+
* Behavior:
|
|
201
|
+
* - `combine(self, that)` returns the constant `a`, ignoring both arguments.
|
|
202
|
+
* - Pure – no mutation occurs.
|
|
203
|
+
*
|
|
204
|
+
* **Example** (always returning zero)
|
|
205
|
+
*
|
|
206
|
+
* ```ts
|
|
207
|
+
* import { Combiner } from "effect"
|
|
208
|
+
*
|
|
209
|
+
* const Zero = Combiner.constant(0)
|
|
210
|
+
*
|
|
211
|
+
* console.log(Zero.combine(42, 99))
|
|
212
|
+
* // Output: 0
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @see {@link first}
|
|
216
|
+
* @see {@link last}
|
|
51
217
|
*
|
|
52
218
|
* @since 4.0.0
|
|
53
219
|
*/
|
|
@@ -55,7 +221,32 @@ export function constant(a) {
|
|
|
55
221
|
return make(() => a);
|
|
56
222
|
}
|
|
57
223
|
/**
|
|
58
|
-
*
|
|
224
|
+
* Wraps a `Combiner` so that a separator value is inserted between every
|
|
225
|
+
* pair of combined elements.
|
|
226
|
+
*
|
|
227
|
+
* When to use:
|
|
228
|
+
* - You are building delimited strings (CSV, paths, etc.) by repeated
|
|
229
|
+
* combination.
|
|
230
|
+
* - You need to inject a fixed separator between accumulated values.
|
|
231
|
+
*
|
|
232
|
+
* Behavior:
|
|
233
|
+
* - `intercalate(middle)(combiner).combine(self, that)` is equivalent to
|
|
234
|
+
* `combiner.combine(self, combiner.combine(middle, that))`.
|
|
235
|
+
* - Curried: first provide the separator, then the base combiner.
|
|
236
|
+
* - Does not mutate the input combiner; returns a new one.
|
|
237
|
+
*
|
|
238
|
+
* **Example** (joining strings with a separator)
|
|
239
|
+
*
|
|
240
|
+
* ```ts
|
|
241
|
+
* import { Combiner, String } from "effect"
|
|
242
|
+
*
|
|
243
|
+
* const commaSep = Combiner.intercalate(",")(String.ReducerConcat)
|
|
244
|
+
*
|
|
245
|
+
* console.log(commaSep.combine("a", "b"))
|
|
246
|
+
* // Output: "a,b"
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* @see {@link make}
|
|
59
250
|
*
|
|
60
251
|
* @since 4.0.0
|
|
61
252
|
*/
|
package/dist/Combiner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combiner.js","names":["make","combine","flip","combiner","self","that","min","order","max","first","_","last","constant","a","intercalate","middle"],"sources":["../src/Combiner.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"Combiner.js","names":["make","combine","flip","combiner","self","that","min","order","max","first","_","last","constant","a","intercalate","middle"],"sources":["../src/Combiner.ts"],"sourcesContent":[null],"mappings":"AAoGA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAM,SAAUA,IAAIA,CAAIC,OAAgC;EACtD,OAAO;IAAEA;EAAO,CAAE;AACpB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,OAAM,SAAUC,IAAIA,CAAIC,QAAqB;EAC3C,OAAOH,IAAI,CAAC,CAACI,IAAI,EAAEC,IAAI,KAAKF,QAAQ,CAACF,OAAO,CAACI,IAAI,EAAED,IAAI,CAAC,CAAC;AAC3D;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAM,SAAUE,GAAGA,CAAIC,KAAqB;EAC1C,OAAOP,IAAI,CAAC,CAACI,IAAI,EAAEC,IAAI,KAAKE,KAAK,CAACH,IAAI,EAAEC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAGD,IAAI,GAAGC,IAAI,CAAC;AACrE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAM,SAAUG,GAAGA,CAAID,KAAqB;EAC1C,OAAOP,IAAI,CAAC,CAACI,IAAI,EAAEC,IAAI,KAAKE,KAAK,CAACH,IAAI,EAAEC,IAAI,CAAC,KAAK,CAAC,GAAGD,IAAI,GAAGC,IAAI,CAAC;AACpE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAM,SAAUI,KAAKA,CAAA;EACnB,OAAOT,IAAI,CAAC,CAACI,IAAI,EAAEM,CAAC,KAAKN,IAAI,CAAC;AAChC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,OAAM,SAAUO,IAAIA,CAAA;EAClB,OAAOX,IAAI,CAAC,CAACU,CAAC,EAAEL,IAAI,KAAKA,IAAI,CAAC;AAChC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,OAAM,SAAUO,QAAQA,CAAIC,CAAI;EAC9B,OAAOb,IAAI,CAAC,MAAMa,CAAC,CAAC;AACtB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,OAAM,SAAUC,WAAWA,CAAIC,MAAS;EACtC,OAAQZ,QAAqB,IAC3BH,IAAI,CAAC,CAACI,IAAI,EAAEC,IAAI,KAAKF,QAAQ,CAACF,OAAO,CAACG,IAAI,EAAED,QAAQ,CAACF,OAAO,CAACc,MAAM,EAAEV,IAAI,CAAC,CAAC,CAAC;AAChF","ignoreList":[]}
|
package/dist/Config.d.ts
CHANGED
|
@@ -689,7 +689,7 @@ export declare const Boolean: Schema.decodeTo<Schema.Boolean, Schema.Literals<re
|
|
|
689
689
|
* - Pass to {@link schema} for custom paths, or use the {@link duration}
|
|
690
690
|
* convenience constructor.
|
|
691
691
|
*
|
|
692
|
-
* Accepts any string that `Duration.
|
|
692
|
+
* Accepts any string that `Duration.fromInput` can parse (e.g.
|
|
693
693
|
* `"10 seconds"`, `"500 millis"`).
|
|
694
694
|
*
|
|
695
695
|
* @see {@link duration} – convenience constructor
|
|
@@ -768,7 +768,7 @@ export declare const LogLevel: Schema.Literals<readonly LogLevel_.LogLevel[]>;
|
|
|
768
768
|
export declare const Record: <K extends Schema.Record.Key, V extends Schema.Top>(key: K, value: V, options?: {
|
|
769
769
|
readonly separator?: string | undefined;
|
|
770
770
|
readonly keyValueSeparator?: string | undefined;
|
|
771
|
-
}) => Schema.Union<readonly [Schema
|
|
771
|
+
}) => Schema.Union<readonly [Schema.$Record<K, V>, Schema.compose<Schema.$Record<K, V>, Schema.decodeTo<Schema.$Record<Schema.String, Schema.String>, Schema.String, never, never>>]>;
|
|
772
772
|
/**
|
|
773
773
|
* Creates a config that always fails with the given error.
|
|
774
774
|
*
|
|
@@ -934,7 +934,7 @@ export declare function boolean(name?: string): Config<boolean>;
|
|
|
934
934
|
*
|
|
935
935
|
* Shortcut for `Config.schema(Config.Duration, name)`.
|
|
936
936
|
*
|
|
937
|
-
* Accepts any string that `Duration.
|
|
937
|
+
* Accepts any string that `Duration.fromInput` can parse (e.g.
|
|
938
938
|
* `"10 seconds"`, `"500 millis"`, `"2 minutes"`).
|
|
939
939
|
*
|
|
940
940
|
* **Example** (Reading a duration)
|
package/dist/Config.js
CHANGED
|
@@ -528,7 +528,7 @@ export const Boolean = /*#__PURE__*/Schema.Literals([...TrueValues.literals, ...
|
|
|
528
528
|
* - Pass to {@link schema} for custom paths, or use the {@link duration}
|
|
529
529
|
* convenience constructor.
|
|
530
530
|
*
|
|
531
|
-
* Accepts any string that `Duration.
|
|
531
|
+
* Accepts any string that `Duration.fromInput` can parse (e.g.
|
|
532
532
|
* `"10 seconds"`, `"500 millis"`).
|
|
533
533
|
*
|
|
534
534
|
* @see {@link duration} – convenience constructor
|
|
@@ -538,7 +538,7 @@ export const Boolean = /*#__PURE__*/Schema.Literals([...TrueValues.literals, ...
|
|
|
538
538
|
*/
|
|
539
539
|
export const Duration = /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.decodeTo(Schema.Duration, {
|
|
540
540
|
decode: /*#__PURE__*/Getter.transformOrFail(s => {
|
|
541
|
-
const d = Duration_.
|
|
541
|
+
const d = Duration_.fromInput(s);
|
|
542
542
|
return d ? Effect.succeed(d) : Effect.fail(new Issue.InvalidValue(Option.some(s)));
|
|
543
543
|
}),
|
|
544
544
|
encode: /*#__PURE__*/Getter.forbidden(() => "Encoding Duration is not supported")
|
|
@@ -804,7 +804,7 @@ export function boolean(name) {
|
|
|
804
804
|
*
|
|
805
805
|
* Shortcut for `Config.schema(Config.Duration, name)`.
|
|
806
806
|
*
|
|
807
|
-
* Accepts any string that `Duration.
|
|
807
|
+
* Accepts any string that `Duration.fromInput` can parse (e.g.
|
|
808
808
|
* `"10 seconds"`, `"500 millis"`, `"2 minutes"`).
|
|
809
809
|
*
|
|
810
810
|
* **Example** (Reading a duration)
|