effect 4.0.0-beta.102 → 4.0.0-beta.103
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 +971 -1037
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +381 -407
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +433 -756
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +200 -325
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +207 -267
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +107 -135
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +146 -188
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +64 -84
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +405 -254
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +166 -101
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +167 -277
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +122 -176
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +729 -768
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +514 -440
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +834 -1173
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +326 -439
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +180 -49
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +96 -31
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +20 -33
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +18 -30
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +225 -173
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +336 -265
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +194 -68
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +115 -80
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +233 -33
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +232 -32
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +151 -274
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +171 -214
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +68 -77
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +57 -66
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +13 -15
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +9 -10
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +60 -80
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +16 -23
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +562 -660
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +307 -362
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +253 -256
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +104 -96
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +216 -308
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +132 -186
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2841 -3247
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1322 -1546
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +22 -40
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +22 -40
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +33 -37
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +29 -21
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +103 -105
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +77 -79
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +51 -27
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +50 -26
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +13 -55
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -28
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +116 -192
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +82 -130
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +82 -146
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +48 -87
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +152 -105
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +106 -73
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +213 -168
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +114 -89
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +123 -81
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +85 -59
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +153 -264
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +42 -147
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +61 -33
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +26 -15
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +25 -33
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +48 -49
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +76 -145
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +40 -57
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +360 -714
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +168 -297
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +12 -6
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +47 -83
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +46 -68
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +319 -411
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +122 -166
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +1 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +177 -284
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +68 -109
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +12 -12
- package/dist/Inspectable.js +8 -8
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +620 -786
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +228 -306
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +11 -13
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +44 -102
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +8 -8
- package/dist/JsonPointer.js +8 -8
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +98 -44
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +297 -234
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +23 -35
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +16 -28
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +359 -260
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +195 -175
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +42 -29
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +31 -21
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +6 -2
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +6 -2
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +114 -214
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +41 -76
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +218 -467
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +204 -450
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +7 -5
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +7 -5
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +217 -252
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +150 -183
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +442 -993
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +198 -642
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +144 -173
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +68 -79
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +84 -89
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +44 -47
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +71 -370
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +59 -284
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +420 -243
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +209 -120
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +21 -14
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +15 -13
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +7 -137
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +5 -93
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +196 -233
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +90 -109
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +97 -189
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +187 -290
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +447 -812
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +211 -392
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +109 -109
- package/dist/Order.js +91 -91
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +20 -23
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +8 -9
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +38 -41
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +3 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +6 -5
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +2 -2
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +3 -3
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +4 -2
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -2
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +200 -181
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +100 -108
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +7 -7
- package/dist/PrimaryKey.js +5 -5
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +425 -494
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +373 -362
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +24 -18
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +11 -9
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +200 -159
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +162 -132
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +49 -74
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +121 -63
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +42 -21
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +24 -13
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +15 -9
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +291 -488
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +111 -202
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -2
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +7 -2
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +25 -25
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +19 -20
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +8 -15
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +6 -12
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +95 -165
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +75 -122
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +102 -168
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +102 -168
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +10 -14
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +10 -14
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +31 -21
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +16 -13
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +201 -90
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +87 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +302 -470
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +133 -217
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +50 -75
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +39 -60
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +290 -1636
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +162 -803
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +5 -5
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +18 -6
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +644 -642
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +491 -527
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +27 -50
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +366 -279
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +7 -6
- package/dist/SchemaError.d.ts.map +1 -1
- package/dist/SchemaError.js +7 -6
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +217 -174
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +218 -185
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +62 -190
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +73 -265
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +2 -2
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +123 -75
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +22 -36
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +20 -26
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +114 -74
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +120 -85
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +123 -151
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +72 -92
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +3 -3
- package/dist/ScopedRef.js +2 -2
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +96 -10
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +78 -39
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +117 -107
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +107 -100
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +1 -1
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2415 -2949
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1078 -1381
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +262 -308
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +184 -215
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +109 -114
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +41 -50
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +282 -250
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +104 -92
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +2 -2
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +100 -54
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +41 -24
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +287 -679
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +109 -251
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +92 -127
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -57
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +201 -121
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +85 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +62 -46
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +30 -22
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +631 -779
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +268 -330
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +297 -236
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +130 -100
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +126 -95
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +74 -56
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +101 -88
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +87 -66
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +200 -180
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +160 -136
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +97 -66
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +67 -45
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +51 -32
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +23 -15
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +129 -95
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +85 -70
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +97 -70
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +44 -34
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +126 -67
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +45 -65
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +6 -9
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +23 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +3 -7
- package/dist/Utils.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/array.js.map +1 -1
- package/dist/internal/core.js +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +4 -0
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/doNotation.js.map +1 -1
- package/dist/internal/effect.js +77 -40
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hashSet.js.map +1 -1
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/metric.js.map +1 -1
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/persistence.d.ts +2 -0
- package/dist/internal/persistence.d.ts.map +1 -0
- package/dist/internal/persistence.js +3 -0
- package/dist/internal/persistence.js.map +1 -0
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/redacted.js.map +1 -1
- package/dist/internal/references.js +3 -0
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/cause.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +13 -11
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/fromRepresentation.js +8 -15
- package/dist/internal/schema/fromRepresentation.js.map +1 -1
- package/dist/internal/schema/parser.d.ts +14 -0
- package/dist/internal/schema/parser.d.ts.map +1 -0
- package/dist/internal/schema/parser.js +13 -0
- package/dist/internal/schema/parser.js.map +1 -0
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/toArbitrary.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/schema/toJsonSchemaDocument.js +48 -6
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toRepresentation.js +87 -107
- package/dist/internal/schema/toRepresentation.js.map +1 -1
- package/dist/internal/stackTraceLimit.js.map +1 -1
- package/dist/internal/stream.js.map +1 -1
- package/dist/internal/tracer.js.map +1 -1
- package/dist/internal/trie.js +13 -9
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +8 -7
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +8 -7
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +57 -28
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +50 -18
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +32 -31
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +24 -22
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +29 -29
- package/dist/testing/TestSchema.js +25 -25
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +95 -118
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +94 -117
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +132 -97
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +55 -51
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +32 -28
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +26 -21
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +107 -67
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +104 -64
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpProtocol.d.ts +30 -0
- package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/McpProtocol.js +20 -0
- package/dist/unstable/ai/McpProtocol.js.map +1 -0
- package/dist/unstable/ai/McpSchema.d.ts +141 -75
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +58 -50
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +68 -59
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +694 -241
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +8 -19
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +9 -20
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +112 -38
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +53 -17
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +28 -14
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +9 -4
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +46 -13
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +18 -7
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +14 -3
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +59 -44
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +48 -39
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +26 -8
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +18 -4
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +4 -0
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +4 -0
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
- package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol.js +22 -0
- package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js +32 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +14 -15
- package/dist/unstable/ai/internal/structured-output.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +273 -69
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +111 -33
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliConfig.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +69 -76
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +57 -61
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +35 -54
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +26 -42
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +705 -107
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +238 -42
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +418 -138
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +197 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +12 -4
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +292 -78
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +128 -46
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +370 -149
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +344 -136
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +23 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +23 -14
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js +17 -7
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +2 -2
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +5 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +10 -10
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +8 -8
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +4 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +4 -2
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/Envelope.js +3 -3
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +6 -4
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +9 -9
- package/dist/unstable/cluster/Message.js +6 -6
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +15 -15
- package/dist/unstable/cluster/MessageStorage.js +5 -5
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -4
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +16 -16
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -2
- package/dist/unstable/cluster/RunnerStorage.js +1 -1
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +6 -6
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +19 -10
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +3 -2
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +3 -3
- package/dist/unstable/cluster/ShardingConfig.js +3 -3
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +8 -8
- package/dist/unstable/cluster/Snowflake.js +8 -8
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -5
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -5
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -1
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +6 -8
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +72 -8
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +58 -8
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +20 -20
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +15 -15
- package/dist/unstable/eventlog/EventJournal.js +13 -13
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +3 -3
- package/dist/unstable/eventlog/EventLog.js +3 -3
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +45 -21
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +13 -5
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +14 -6
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +2 -2
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +30 -18
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +1 -1
- package/dist/unstable/http/Etag.js +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +2 -2
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +5 -3
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +11 -5
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +51 -44
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +46 -17
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
- package/dist/unstable/http/HttpClientResponse.js +2 -2
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +6 -9
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +6 -9
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +164 -39
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +76 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +32 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +88 -89
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +78 -79
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +13 -13
- package/dist/unstable/http/HttpServer.js +6 -6
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -2
- package/dist/unstable/http/HttpServerError.js +2 -2
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.js +4 -4
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +10 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +35 -7
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.js +5 -5
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +33 -63
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +14 -28
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +10 -18
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +9 -17
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/compression.d.ts +2 -0
- package/dist/unstable/http/internal/compression.d.ts.map +1 -0
- package/dist/unstable/http/internal/compression.js +155 -0
- package/dist/unstable/http/internal/compression.js.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +10 -11
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +11 -13
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +42 -42
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -6
- package/dist/unstable/httpapi/HttpApiSchema.js +4 -4
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +13 -13
- package/dist/unstable/httpapi/OpenApi.js +13 -13
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/httpapi/internal/html.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +12 -14
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +17 -4
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +16 -7
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +21 -12
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +10 -3
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
- package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/unstable/observability/internal/protobuf.js +3 -0
- package/dist/unstable/observability/internal/protobuf.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +22 -13
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -8
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.js +6 -6
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +3 -3
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +91 -15
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +26 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +24 -13
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +2 -2
- package/dist/unstable/persistence/Redis.js +1 -1
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +64 -21
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +14 -5
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +10 -10
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +25 -22
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +14 -13
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +24 -3
- package/dist/unstable/reactivity/AtomRegistry.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 +4 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +1 -1
- package/dist/unstable/reactivity/Hydration.js +1 -1
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +35 -33
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +12 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +12 -11
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
- package/dist/unstable/rpc/RpcGroup.js +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +6 -6
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +175 -96
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +13 -13
- package/dist/unstable/rpc/RpcServer.js +17 -13
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +52 -50
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +35 -33
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.js +2 -2
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +11 -3
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +9 -4
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +2 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.js +2 -2
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +5 -5
- package/dist/unstable/sql/SqlResolver.js +2 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +6 -6
- package/dist/unstable/sql/Statement.js +15 -15
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +2 -2
- package/dist/unstable/workers/Worker.js +2 -2
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +7 -7
- package/dist/unstable/workers/WorkerError.js +6 -6
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
- package/dist/unstable/workers/WorkerRunner.js +1 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +2 -2
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +1 -1
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +10 -10
- package/dist/unstable/workflow/DurableDeferred.js +5 -5
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +22 -20
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +21 -21
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +13 -14
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +4 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.js.map +1 -1
- package/dist/unstable/workflow/internal/crypto.js.map +1 -1
- package/package.json +5 -6
- package/src/Array.ts +982 -1045
- package/src/BigDecimal.ts +433 -756
- package/src/BigInt.ts +213 -269
- package/src/Boolean.ts +146 -188
- package/src/Cache.ts +409 -255
- package/src/Cause.ts +167 -277
- package/src/Channel.ts +891 -816
- package/src/ChannelSchema.ts +1 -1
- package/src/Chunk.ts +841 -1181
- package/src/Clock.ts +181 -49
- package/src/Combiner.ts +20 -33
- package/src/Config.ts +615 -332
- package/src/ConfigProvider.ts +214 -120
- package/src/Console.ts +289 -39
- package/src/Context.ts +319 -378
- package/src/Cron.ts +68 -77
- package/src/Crypto.ts +13 -15
- package/src/Data.ts +60 -80
- package/src/DateTime.ts +564 -660
- package/src/Deferred.ts +253 -256
- package/src/Duration.ts +216 -308
- package/src/Effect.ts +2893 -3279
- package/src/Encoding.ts +22 -40
- package/src/Equal.ts +49 -39
- package/src/Equivalence.ts +103 -105
- package/src/ErrorReporter.ts +51 -27
- package/src/ExecutionPlan.ts +13 -55
- package/src/Exit.ts +116 -192
- package/src/Fiber.ts +81 -148
- package/src/FiberHandle.ts +152 -105
- package/src/FiberMap.ts +225 -174
- package/src/FiberSet.ts +124 -82
- package/src/FileSystem.ts +155 -263
- package/src/Filter.ts +61 -33
- package/src/Formatter.ts +54 -56
- package/src/Function.ts +76 -145
- package/src/Graph.ts +416 -770
- package/src/HKT.ts +12 -6
- package/src/Hash.ts +52 -83
- package/src/HashMap.ts +319 -411
- package/src/HashRing.ts +1 -0
- package/src/HashSet.ts +177 -284
- package/src/Inspectable.ts +12 -12
- package/src/Iterable.ts +620 -786
- package/src/JsonPatch.ts +58 -112
- package/src/JsonPointer.ts +8 -8
- package/src/JsonSchema.ts +402 -244
- package/src/Latch.ts +23 -35
- package/src/Layer.ts +359 -260
- package/src/LayerMap.ts +49 -29
- package/src/LayerRef.ts +6 -2
- package/src/LogLevel.ts +114 -214
- package/src/Logger.ts +344 -697
- package/src/ManagedRuntime.ts +7 -5
- package/src/Match.ts +217 -252
- package/src/Metric.ts +516 -1089
- package/src/MutableHashMap.ts +218 -255
- package/src/MutableHashSet.ts +84 -89
- package/src/MutableList.ts +73 -370
- package/src/MutableRef.ts +420 -243
- package/src/Newtype.ts +21 -14
- package/src/NonEmptyIterable.ts +7 -137
- package/src/Number.ts +196 -233
- package/src/Optic.ts +243 -383
- package/src/Option.ts +447 -812
- package/src/Order.ts +109 -109
- package/src/Ordering.ts +20 -23
- package/src/Path.ts +38 -41
- package/src/Pipeable.ts +6 -5
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +4 -2
- package/src/Predicate.ts +200 -181
- package/src/PrimaryKey.ts +7 -7
- package/src/PubSub.ts +526 -552
- package/src/Pull.ts +24 -18
- package/src/Queue.ts +200 -159
- package/src/Random.ts +49 -74
- package/src/RcMap.ts +121 -63
- package/src/RcRef.ts +24 -13
- package/src/Record.ts +291 -488
- package/src/Redactable.ts +10 -3
- package/src/Redacted.ts +25 -25
- package/src/Reducer.ts +8 -15
- package/src/Ref.ts +221 -361
- package/src/References.ts +102 -168
- package/src/RegExp.ts +10 -14
- package/src/Request.ts +31 -21
- package/src/RequestResolver.ts +202 -91
- package/src/Result.ts +312 -484
- package/src/Runtime.ts +50 -75
- package/src/Schedule.ts +308 -1734
- package/src/Scheduler.ts +20 -7
- package/src/Schema.ts +716 -745
- package/src/SchemaAST.ts +466 -358
- package/src/SchemaError.ts +7 -6
- package/src/SchemaGetter.ts +242 -190
- package/src/SchemaIssue.ts +89 -275
- package/src/SchemaParser.ts +180 -93
- package/src/SchemaRepresentation.ts +22 -40
- package/src/SchemaTransformation.ts +129 -88
- package/src/Scope.ts +123 -151
- package/src/ScopedRef.ts +4 -4
- package/src/Semaphore.ts +152 -51
- package/src/Sink.ts +128 -113
- package/src/Stdio.ts +1 -1
- package/src/Stream.ts +2602 -3123
- package/src/String.ts +275 -312
- package/src/Struct.ts +109 -114
- package/src/SubscriptionRef.ts +284 -252
- package/src/Symbol.ts +3 -3
- package/src/Terminal.ts +2 -2
- package/src/Tracer.ts +102 -55
- package/src/Trie.ts +287 -679
- package/src/Tuple.ts +92 -127
- package/src/TxChunk.ts +201 -121
- package/src/TxDeferred.ts +62 -46
- package/src/TxHashMap.ts +645 -799
- package/src/TxHashSet.ts +443 -356
- package/src/TxPriorityQueue.ts +130 -98
- package/src/TxPubSub.ts +107 -80
- package/src/TxQueue.ts +214 -183
- package/src/TxReentrantLock.ts +97 -66
- package/src/TxRef.ts +51 -32
- package/src/TxSemaphore.ts +129 -95
- package/src/TxSubscriptionRef.ts +97 -70
- package/src/Types.ts +126 -67
- package/src/Unify.ts +45 -65
- package/src/Utils.ts +23 -16
- package/src/internal/core.ts +2 -2
- package/src/internal/dateTime.ts +6 -0
- package/src/internal/effect.ts +93 -48
- package/src/internal/persistence.ts +2 -0
- package/src/internal/references.ts +3 -2
- package/src/internal/schema/fromJsonSchemaDocument.ts +15 -13
- package/src/internal/schema/fromRepresentation.ts +10 -16
- package/src/internal/schema/parser.ts +22 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +60 -6
- package/src/internal/schema/toRepresentation.ts +104 -119
- package/src/internal/trie.ts +10 -11
- package/src/testing/FastCheck.ts +8 -7
- package/src/testing/TestClock.ts +72 -30
- package/src/testing/TestConsole.ts +32 -31
- package/src/testing/TestSchema.ts +29 -29
- package/src/unstable/ai/AiError.ts +95 -118
- package/src/unstable/ai/AnthropicStructuredOutput.ts +1 -1
- package/src/unstable/ai/Chat.ts +132 -97
- package/src/unstable/ai/IdGenerator.ts +32 -28
- package/src/unstable/ai/LanguageModel.ts +107 -67
- package/src/unstable/ai/McpProtocol.ts +48 -0
- package/src/unstable/ai/McpSchema.ts +60 -50
- package/src/unstable/ai/McpServer.ts +930 -304
- package/src/unstable/ai/Model.ts +9 -20
- package/src/unstable/ai/OpenAiStructuredOutput.ts +1 -1
- package/src/unstable/ai/Prompt.ts +145 -43
- package/src/unstable/ai/Response.ts +28 -14
- package/src/unstable/ai/Telemetry.ts +46 -13
- package/src/unstable/ai/Tokenizer.ts +14 -3
- package/src/unstable/ai/Tool.ts +59 -44
- package/src/unstable/ai/Toolkit.ts +26 -8
- package/src/unstable/ai/index.ts +5 -0
- package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
- package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
- package/src/unstable/ai/internal/structured-output.ts +13 -18
- package/src/unstable/cli/Argument.ts +273 -69
- package/src/unstable/cli/CliError.ts +69 -76
- package/src/unstable/cli/CliOutput.ts +44 -58
- package/src/unstable/cli/Command.ts +705 -107
- package/src/unstable/cli/Flag.ts +418 -138
- package/src/unstable/cli/GlobalFlag.ts +1 -1
- package/src/unstable/cli/HelpDoc.ts +12 -4
- package/src/unstable/cli/Param.ts +292 -78
- package/src/unstable/cli/Primitive.ts +370 -149
- package/src/unstable/cli/Prompt.ts +28 -14
- package/src/unstable/cli/internal/lexer.ts +8 -2
- package/src/unstable/cli/internal/parser.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -1
- package/src/unstable/cluster/Entity.ts +15 -16
- package/src/unstable/cluster/EntityProxy.ts +4 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +3 -3
- package/src/unstable/cluster/HttpRunner.ts +6 -4
- package/src/unstable/cluster/Message.ts +9 -9
- package/src/unstable/cluster/MessageStorage.ts +15 -15
- package/src/unstable/cluster/Reply.ts +4 -6
- package/src/unstable/cluster/RunnerHealth.ts +1 -1
- package/src/unstable/cluster/RunnerServer.ts +41 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -2
- package/src/unstable/cluster/Runners.ts +23 -12
- package/src/unstable/cluster/Sharding.ts +7 -8
- package/src/unstable/cluster/ShardingConfig.ts +3 -3
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
- package/src/unstable/cluster/SqlRunnerStorage.ts +21 -5
- package/src/unstable/cluster/internal/entityManager.ts +11 -15
- package/src/unstable/encoding/Msgpack.ts +6 -8
- package/src/unstable/encoding/Sse.ts +98 -16
- package/src/unstable/eventlog/Event.ts +20 -20
- package/src/unstable/eventlog/EventGroup.ts +4 -4
- package/src/unstable/eventlog/EventJournal.ts +15 -15
- package/src/unstable/eventlog/EventLog.ts +3 -3
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogMessage.ts +2 -2
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServer.ts +41 -7
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +14 -6
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/http/Cookies.ts +35 -21
- package/src/unstable/http/Etag.ts +1 -1
- package/src/unstable/http/FetchHttpClient.ts +3 -1
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpBody.ts +20 -5
- package/src/unstable/http/HttpClient.ts +83 -55
- package/src/unstable/http/HttpClientRequest.ts +2 -0
- package/src/unstable/http/HttpClientResponse.ts +4 -4
- package/src/unstable/http/HttpEffect.ts +8 -8
- package/src/unstable/http/HttpMethod.ts +6 -9
- package/src/unstable/http/HttpMiddleware.ts +202 -39
- package/src/unstable/http/HttpPlatform.ts +95 -0
- package/src/unstable/http/HttpRouter.ts +102 -98
- package/src/unstable/http/HttpServer.ts +13 -13
- package/src/unstable/http/HttpServerError.ts +2 -2
- package/src/unstable/http/HttpServerRequest.ts +4 -4
- package/src/unstable/http/HttpServerResponse.ts +30 -0
- package/src/unstable/http/HttpStaticServer.ts +35 -7
- package/src/unstable/http/Multipart.ts +6 -6
- package/src/unstable/http/Url.ts +33 -63
- package/src/unstable/http/UrlParams.ts +10 -18
- package/src/unstable/http/internal/compression.ts +196 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +10 -9
- package/src/unstable/httpapi/HttpApiClient.ts +14 -14
- package/src/unstable/httpapi/HttpApiEndpoint.ts +42 -42
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/httpapi/HttpApiGroup.ts +15 -15
- package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
- package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +6 -6
- package/src/unstable/httpapi/OpenApi.ts +13 -13
- package/src/unstable/observability/OtlpExporter.ts +31 -19
- package/src/unstable/observability/OtlpMetrics.ts +4 -1
- package/src/unstable/observability/OtlpResource.ts +26 -17
- package/src/unstable/observability/PrometheusMetrics.ts +13 -4
- package/src/unstable/observability/internal/otlpEnv.ts +1 -1
- package/src/unstable/observability/internal/protobuf.ts +3 -0
- package/src/unstable/persistence/KeyValueStore.ts +72 -49
- package/src/unstable/persistence/Persistable.ts +8 -8
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +126 -19
- package/src/unstable/persistence/RateLimiter.ts +26 -15
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcess.ts +64 -21
- package/src/unstable/process/ChildProcessSpawner.ts +21 -10
- package/src/unstable/reactivity/AsyncResult.ts +12 -13
- package/src/unstable/reactivity/Atom.ts +28 -25
- package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
- package/src/unstable/reactivity/AtomRegistry.ts +24 -3
- package/src/unstable/reactivity/AtomRpc.ts +5 -4
- package/src/unstable/reactivity/Hydration.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +35 -33
- package/src/unstable/rpc/RpcClient.ts +16 -15
- package/src/unstable/rpc/RpcGroup.ts +8 -8
- package/src/unstable/rpc/RpcMessage.ts +31 -30
- package/src/unstable/rpc/RpcMiddleware.ts +10 -10
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +167 -68
- package/src/unstable/rpc/RpcServer.ts +18 -15
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/schema/Model.ts +52 -50
- package/src/unstable/schema/VariantSchema.ts +5 -5
- package/src/unstable/socket/Socket.ts +17 -4
- package/src/unstable/sql/SqlClient.ts +5 -6
- package/src/unstable/sql/SqlModel.ts +2 -2
- package/src/unstable/sql/SqlResolver.ts +5 -5
- package/src/unstable/sql/Statement.ts +24 -23
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +2 -2
- package/src/unstable/workers/WorkerError.ts +7 -7
- package/src/unstable/workers/WorkerRunner.ts +1 -1
- package/src/unstable/workflow/Activity.ts +2 -2
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +10 -10
- package/src/unstable/workflow/DurableQueue.ts +22 -20
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
- package/src/unstable/workflow/WorkflowProxy.ts +4 -2
- package/dist/internal/version.d.ts +0 -3
- package/dist/internal/version.d.ts.map +0 -1
- package/dist/internal/version.js +0 -2
- package/dist/internal/version.js.map +0 -1
- package/src/internal/version.ts +0 -2
package/dist/Option.js
CHANGED
|
@@ -37,15 +37,12 @@ const TypeId = "~effect/data/Option";
|
|
|
37
37
|
*
|
|
38
38
|
* **Example** (Creating an empty Option)
|
|
39
39
|
*
|
|
40
|
-
* ```ts
|
|
40
|
+
* ```ts import.meta.vitest
|
|
41
41
|
* import { Option } from "effect"
|
|
42
42
|
*
|
|
43
43
|
* // ┌─── Option<never>
|
|
44
44
|
* // ▼
|
|
45
|
-
* const noValue = Option.none()
|
|
46
|
-
*
|
|
47
|
-
* console.log(noValue)
|
|
48
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
45
|
+
* const noValue = Option.none() // => Option.none()
|
|
49
46
|
* ```
|
|
50
47
|
*
|
|
51
48
|
* @see {@link some} for the opposite operation.
|
|
@@ -69,15 +66,12 @@ export const none = () => option.none;
|
|
|
69
66
|
*
|
|
70
67
|
* **Example** (Wrapping a value)
|
|
71
68
|
*
|
|
72
|
-
* ```ts
|
|
69
|
+
* ```ts import.meta.vitest
|
|
73
70
|
* import { Option } from "effect"
|
|
74
71
|
*
|
|
75
72
|
* // ┌─── Option<number>
|
|
76
73
|
* // ▼
|
|
77
|
-
* const value = Option.some(1)
|
|
78
|
-
*
|
|
79
|
-
* console.log(value)
|
|
80
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 1 }
|
|
74
|
+
* const value = Option.some(1) // => Option.some(1)
|
|
81
75
|
* ```
|
|
82
76
|
*
|
|
83
77
|
* @see {@link none} for the opposite operation.
|
|
@@ -101,17 +95,12 @@ export const some = option.some;
|
|
|
101
95
|
*
|
|
102
96
|
* **Example** (Checking if a value is an Option)
|
|
103
97
|
*
|
|
104
|
-
* ```ts
|
|
98
|
+
* ```ts import.meta.vitest
|
|
105
99
|
* import { Option } from "effect"
|
|
106
100
|
*
|
|
107
|
-
*
|
|
108
|
-
* //
|
|
109
|
-
*
|
|
110
|
-
* console.log(Option.isOption(Option.none()))
|
|
111
|
-
* // Output: true
|
|
112
|
-
*
|
|
113
|
-
* console.log(Option.isOption({}))
|
|
114
|
-
* // Output: false
|
|
101
|
+
* Option.isOption(Option.some(1)) // => true
|
|
102
|
+
* Option.isOption(Option.none()) // => true
|
|
103
|
+
* Option.isOption({}) // => false
|
|
115
104
|
* ```
|
|
116
105
|
*
|
|
117
106
|
* @see {@link isNone} to check for `None` specifically
|
|
@@ -134,14 +123,11 @@ export const isOption = option.isOption;
|
|
|
134
123
|
*
|
|
135
124
|
* **Example** (Checking for None)
|
|
136
125
|
*
|
|
137
|
-
* ```ts
|
|
126
|
+
* ```ts import.meta.vitest
|
|
138
127
|
* import { Option } from "effect"
|
|
139
128
|
*
|
|
140
|
-
*
|
|
141
|
-
* //
|
|
142
|
-
*
|
|
143
|
-
* console.log(Option.isNone(Option.none()))
|
|
144
|
-
* // Output: true
|
|
129
|
+
* Option.isNone(Option.some(1)) // => false
|
|
130
|
+
* Option.isNone(Option.none()) // => true
|
|
145
131
|
* ```
|
|
146
132
|
*
|
|
147
133
|
* @see {@link isSome} for the opposite check.
|
|
@@ -163,14 +149,11 @@ export const isNone = option.isNone;
|
|
|
163
149
|
*
|
|
164
150
|
* **Example** (Checking for Some)
|
|
165
151
|
*
|
|
166
|
-
* ```ts
|
|
152
|
+
* ```ts import.meta.vitest
|
|
167
153
|
* import { Option } from "effect"
|
|
168
154
|
*
|
|
169
|
-
*
|
|
170
|
-
* //
|
|
171
|
-
*
|
|
172
|
-
* console.log(Option.isSome(Option.none()))
|
|
173
|
-
* // Output: false
|
|
155
|
+
* Option.isSome(Option.some(1)) // => true
|
|
156
|
+
* Option.isSome(Option.none()) // => false
|
|
174
157
|
* ```
|
|
175
158
|
*
|
|
176
159
|
* @see {@link isNone} for the opposite check.
|
|
@@ -195,16 +178,13 @@ export const isSome = option.isSome;
|
|
|
195
178
|
*
|
|
196
179
|
* **Example** (Matching on an Option)
|
|
197
180
|
*
|
|
198
|
-
* ```ts
|
|
181
|
+
* ```ts import.meta.vitest
|
|
199
182
|
* import { Option } from "effect"
|
|
200
183
|
*
|
|
201
|
-
*
|
|
184
|
+
* Option.match(Option.some(1), {
|
|
202
185
|
* onNone: () => "Option is empty",
|
|
203
186
|
* onSome: (value) => `Option has a value: ${value}`
|
|
204
|
-
* })
|
|
205
|
-
*
|
|
206
|
-
* console.log(message)
|
|
207
|
-
* // Output: "Option has a value: 1"
|
|
187
|
+
* }) // => "Option has a value: 1"
|
|
208
188
|
* ```
|
|
209
189
|
*
|
|
210
190
|
* @see {@link getOrElse} for unwrapping with a default
|
|
@@ -232,7 +212,7 @@ export const match = /*#__PURE__*/dual(2, (self, {
|
|
|
232
212
|
*
|
|
233
213
|
* **Example** (Converting a parser to a type guard)
|
|
234
214
|
*
|
|
235
|
-
* ```ts
|
|
215
|
+
* ```ts import.meta.vitest
|
|
236
216
|
* import { Option } from "effect"
|
|
237
217
|
*
|
|
238
218
|
* type MyData = string | number
|
|
@@ -244,11 +224,8 @@ export const match = /*#__PURE__*/dual(2, (self, {
|
|
|
244
224
|
* // ▼
|
|
245
225
|
* const isString = Option.toRefinement(parseString)
|
|
246
226
|
*
|
|
247
|
-
*
|
|
248
|
-
* //
|
|
249
|
-
*
|
|
250
|
-
* console.log(isString(1))
|
|
251
|
-
* // Output: false
|
|
227
|
+
* isString("a") // => true
|
|
228
|
+
* isString(1) // => false
|
|
252
229
|
* ```
|
|
253
230
|
*
|
|
254
231
|
* @see {@link liftPredicate} for the reverse direction
|
|
@@ -273,14 +250,11 @@ export const toRefinement = f => a => isSome(f(a));
|
|
|
273
250
|
*
|
|
274
251
|
* **Example** (Getting the first element)
|
|
275
252
|
*
|
|
276
|
-
* ```ts
|
|
253
|
+
* ```ts import.meta.vitest
|
|
277
254
|
* import { Option } from "effect"
|
|
278
255
|
*
|
|
279
|
-
*
|
|
280
|
-
* //
|
|
281
|
-
*
|
|
282
|
-
* console.log(Option.fromIterable([]))
|
|
283
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
256
|
+
* Option.fromIterable([1, 2, 3]) // => Option.some(1)
|
|
257
|
+
* Option.fromIterable([]) // => Option.none()
|
|
284
258
|
* ```
|
|
285
259
|
*
|
|
286
260
|
* @see {@link toArray} for the inverse direction
|
|
@@ -309,14 +283,11 @@ export const fromIterable = collection => {
|
|
|
309
283
|
*
|
|
310
284
|
* **Example** (Extracting the success side)
|
|
311
285
|
*
|
|
312
|
-
* ```ts
|
|
286
|
+
* ```ts import.meta.vitest
|
|
313
287
|
* import { Option, Result } from "effect"
|
|
314
288
|
*
|
|
315
|
-
*
|
|
316
|
-
* //
|
|
317
|
-
*
|
|
318
|
-
* console.log(Option.getSuccess(Result.fail("err")))
|
|
319
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
289
|
+
* Option.getSuccess(Result.succeed("ok")) // => Option.some("ok")
|
|
290
|
+
* Option.getSuccess(Result.fail("err")) // => Option.none()
|
|
320
291
|
* ```
|
|
321
292
|
*
|
|
322
293
|
* @see {@link getFailure} for the opposite operation.
|
|
@@ -340,14 +311,11 @@ export const getSuccess = result.getSuccess;
|
|
|
340
311
|
*
|
|
341
312
|
* **Example** (Extracting the failure side)
|
|
342
313
|
*
|
|
343
|
-
* ```ts
|
|
314
|
+
* ```ts import.meta.vitest
|
|
344
315
|
* import { Option, Result } from "effect"
|
|
345
316
|
*
|
|
346
|
-
*
|
|
347
|
-
* //
|
|
348
|
-
*
|
|
349
|
-
* console.log(Option.getFailure(Result.fail("err")))
|
|
350
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 'err' }
|
|
317
|
+
* Option.getFailure(Result.succeed("ok")) // => Option.none()
|
|
318
|
+
* Option.getFailure(Result.fail("err")) // => Option.some("err")
|
|
351
319
|
* ```
|
|
352
320
|
*
|
|
353
321
|
* @see {@link getSuccess} for the opposite operation.
|
|
@@ -372,14 +340,11 @@ export const getFailure = result.getFailure;
|
|
|
372
340
|
*
|
|
373
341
|
* **Example** (Unwrapping with a fallback)
|
|
374
342
|
*
|
|
375
|
-
* ```ts
|
|
343
|
+
* ```ts import.meta.vitest
|
|
376
344
|
* import { Option } from "effect"
|
|
377
345
|
*
|
|
378
|
-
*
|
|
379
|
-
* //
|
|
380
|
-
*
|
|
381
|
-
* console.log(Option.none().pipe(Option.getOrElse(() => 0)))
|
|
382
|
-
* // Output: 0
|
|
346
|
+
* Option.some(1).pipe(Option.getOrElse(() => 0)) // => 1
|
|
347
|
+
* Option.none().pipe(Option.getOrElse(() => 0)) // => 0
|
|
383
348
|
* ```
|
|
384
349
|
*
|
|
385
350
|
* @see {@link getOrNull} to fall back to `null`
|
|
@@ -406,14 +371,11 @@ export const getOrElse = /*#__PURE__*/dual(2, (self, onNone) => isNone(self) ? o
|
|
|
406
371
|
*
|
|
407
372
|
* **Example** (Providing a fallback Option)
|
|
408
373
|
*
|
|
409
|
-
* ```ts
|
|
374
|
+
* ```ts import.meta.vitest
|
|
410
375
|
* import { Option } from "effect"
|
|
411
376
|
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* console.log(Option.some("a").pipe(Option.orElse(() => Option.some("b"))))
|
|
416
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
|
|
377
|
+
* Option.none().pipe(Option.orElse(() => Option.some("b"))) // => Option.some("b")
|
|
378
|
+
* Option.some("a").pipe(Option.orElse(() => Option.some("b"))) // => Option.some("a")
|
|
417
379
|
* ```
|
|
418
380
|
*
|
|
419
381
|
* @see {@link orElseSome} to wrap the fallback value in `Some` automatically
|
|
@@ -438,14 +400,11 @@ export const orElse = /*#__PURE__*/dual(2, (self, that) => isNone(self) ? that()
|
|
|
438
400
|
*
|
|
439
401
|
* **Example** (Providing a fallback value)
|
|
440
402
|
*
|
|
441
|
-
* ```ts
|
|
403
|
+
* ```ts import.meta.vitest
|
|
442
404
|
* import { Option } from "effect"
|
|
443
405
|
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
* console.log(Option.some("a").pipe(Option.orElseSome(() => "b")))
|
|
448
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
|
|
406
|
+
* Option.none().pipe(Option.orElseSome(() => "b")) // => Option.some("b")
|
|
407
|
+
* Option.some("a").pipe(Option.orElseSome(() => "b")) // => Option.some("a")
|
|
449
408
|
* ```
|
|
450
409
|
*
|
|
451
410
|
* @see {@link orElse} when the fallback is itself an `Option`
|
|
@@ -470,14 +429,13 @@ export const orElseSome = /*#__PURE__*/dual(2, (self, onNone) => isNone(self) ?
|
|
|
470
429
|
*
|
|
471
430
|
* **Example** (Tracking value source)
|
|
472
431
|
*
|
|
473
|
-
* ```ts
|
|
474
|
-
* import { Option } from "effect"
|
|
432
|
+
* ```ts import.meta.vitest
|
|
433
|
+
* import { Option, Result } from "effect"
|
|
475
434
|
*
|
|
476
|
-
*
|
|
477
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: { _tag: 'Failure', value: 'primary' } }
|
|
435
|
+
* const fallback = () => Option.some("fallback")
|
|
478
436
|
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
437
|
+
* Option.orElseResult(Option.some("primary"), fallback) // => Option.some(Result.fail("primary"))
|
|
438
|
+
* Option.orElseResult(Option.none(), fallback) // => Option.some(Result.succeed("fallback"))
|
|
481
439
|
* ```
|
|
482
440
|
*
|
|
483
441
|
* @see {@link orElse} for the simpler variant without source tracking
|
|
@@ -501,15 +459,14 @@ export const orElseResult = /*#__PURE__*/dual(2, (self, that) => isNone(self) ?
|
|
|
501
459
|
*
|
|
502
460
|
* **Example** (Finding the first Some)
|
|
503
461
|
*
|
|
504
|
-
* ```ts
|
|
462
|
+
* ```ts import.meta.vitest
|
|
505
463
|
* import { Option } from "effect"
|
|
506
464
|
*
|
|
507
|
-
*
|
|
465
|
+
* Option.firstSomeOf([
|
|
508
466
|
* Option.none(),
|
|
509
467
|
* Option.some(1),
|
|
510
468
|
* Option.some(2)
|
|
511
|
-
* ]))
|
|
512
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 1 }
|
|
469
|
+
* ]) // => Option.some(1)
|
|
513
470
|
* ```
|
|
514
471
|
*
|
|
515
472
|
* @see {@link orElse} for a two-option fallback
|
|
@@ -541,17 +498,12 @@ export const firstSomeOf = collection => {
|
|
|
541
498
|
*
|
|
542
499
|
* **Example** (Converting nullable values to an Option)
|
|
543
500
|
*
|
|
544
|
-
* ```ts
|
|
501
|
+
* ```ts import.meta.vitest
|
|
545
502
|
* import { Option } from "effect"
|
|
546
503
|
*
|
|
547
|
-
*
|
|
548
|
-
* //
|
|
549
|
-
*
|
|
550
|
-
* console.log(Option.fromNullishOr(null))
|
|
551
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
552
|
-
*
|
|
553
|
-
* console.log(Option.fromNullishOr(1))
|
|
554
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 1 }
|
|
504
|
+
* Option.fromNullishOr(undefined) // => Option.none()
|
|
505
|
+
* Option.fromNullishOr(null) // => Option.none()
|
|
506
|
+
* Option.fromNullishOr(1) // => Option.some(1)
|
|
555
507
|
* ```
|
|
556
508
|
*
|
|
557
509
|
* @see {@link fromNullOr} to only treat `null` as absent
|
|
@@ -578,17 +530,12 @@ export const fromNullishOr = a => a == null ? none() : some(a);
|
|
|
578
530
|
*
|
|
579
531
|
* **Example** (Converting possibly undefined values to an Option)
|
|
580
532
|
*
|
|
581
|
-
* ```ts
|
|
533
|
+
* ```ts import.meta.vitest
|
|
582
534
|
* import { Option } from "effect"
|
|
583
535
|
*
|
|
584
|
-
*
|
|
585
|
-
* //
|
|
586
|
-
*
|
|
587
|
-
* console.log(Option.fromUndefinedOr(null))
|
|
588
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: null }
|
|
589
|
-
*
|
|
590
|
-
* console.log(Option.fromUndefinedOr(42))
|
|
591
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 42 }
|
|
536
|
+
* Option.fromUndefinedOr(undefined) // => Option.none()
|
|
537
|
+
* Option.fromUndefinedOr(null) // => Option.some(null)
|
|
538
|
+
* Option.fromUndefinedOr(42) // => Option.some(42)
|
|
592
539
|
* ```
|
|
593
540
|
*
|
|
594
541
|
* @see {@link fromNullishOr} to treat both `null` and `undefined` as absent
|
|
@@ -614,17 +561,12 @@ export const fromUndefinedOr = a => a === undefined ? none() : some(a);
|
|
|
614
561
|
*
|
|
615
562
|
* **Example** (Converting possibly null values to an Option)
|
|
616
563
|
*
|
|
617
|
-
* ```ts
|
|
564
|
+
* ```ts import.meta.vitest
|
|
618
565
|
* import { Option } from "effect"
|
|
619
566
|
*
|
|
620
|
-
*
|
|
621
|
-
* //
|
|
622
|
-
*
|
|
623
|
-
* console.log(Option.fromNullOr(undefined))
|
|
624
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: undefined }
|
|
625
|
-
*
|
|
626
|
-
* console.log(Option.fromNullOr(42))
|
|
627
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 42 }
|
|
567
|
+
* Option.fromNullOr(null) // => Option.none()
|
|
568
|
+
* Option.fromNullOr(undefined) // => Option.some(undefined)
|
|
569
|
+
* Option.fromNullOr(42) // => Option.some(42)
|
|
628
570
|
* ```
|
|
629
571
|
*
|
|
630
572
|
* @see {@link fromNullishOr} to treat both `null` and `undefined` as absent
|
|
@@ -649,7 +591,7 @@ export const fromNullOr = a => a === null ? none() : some(a);
|
|
|
649
591
|
*
|
|
650
592
|
* **Example** (Lifting a parser)
|
|
651
593
|
*
|
|
652
|
-
* ```ts
|
|
594
|
+
* ```ts import.meta.vitest
|
|
653
595
|
* import { Option } from "effect"
|
|
654
596
|
*
|
|
655
597
|
* const parse = (s: string): number | undefined => {
|
|
@@ -659,11 +601,8 @@ export const fromNullOr = a => a === null ? none() : some(a);
|
|
|
659
601
|
*
|
|
660
602
|
* const parseOption = Option.liftNullishOr(parse)
|
|
661
603
|
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
* console.log(parseOption("not a number"))
|
|
666
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
604
|
+
* parseOption("1") // => Option.some(1)
|
|
605
|
+
* parseOption("not a number") // => Option.none()
|
|
667
606
|
* ```
|
|
668
607
|
*
|
|
669
608
|
* @see {@link fromNullishOr} for converting a single value
|
|
@@ -687,14 +626,11 @@ export const liftNullishOr = f => (...a) => fromNullishOr(f(...a));
|
|
|
687
626
|
*
|
|
688
627
|
* **Example** (Unwrapping to null)
|
|
689
628
|
*
|
|
690
|
-
* ```ts
|
|
629
|
+
* ```ts import.meta.vitest
|
|
691
630
|
* import { Option } from "effect"
|
|
692
631
|
*
|
|
693
|
-
*
|
|
694
|
-
* //
|
|
695
|
-
*
|
|
696
|
-
* console.log(Option.getOrNull(Option.none()))
|
|
697
|
-
* // Output: null
|
|
632
|
+
* Option.getOrNull(Option.some(1)) // => 1
|
|
633
|
+
* Option.getOrNull(Option.none()) // => null
|
|
698
634
|
* ```
|
|
699
635
|
*
|
|
700
636
|
* @see {@link getOrUndefined} to return `undefined` instead
|
|
@@ -719,14 +655,11 @@ export const getOrNull = /*#__PURE__*/getOrElse(constNull);
|
|
|
719
655
|
*
|
|
720
656
|
* **Example** (Unwrapping to undefined)
|
|
721
657
|
*
|
|
722
|
-
* ```ts
|
|
658
|
+
* ```ts import.meta.vitest
|
|
723
659
|
* import { Option } from "effect"
|
|
724
660
|
*
|
|
725
|
-
*
|
|
726
|
-
* //
|
|
727
|
-
*
|
|
728
|
-
* console.log(Option.getOrUndefined(Option.none()))
|
|
729
|
-
* // Output: undefined
|
|
661
|
+
* Option.getOrUndefined(Option.some(1)) // => 1
|
|
662
|
+
* Option.getOrUndefined(Option.none()) // => undefined
|
|
730
663
|
* ```
|
|
731
664
|
*
|
|
732
665
|
* @see {@link getOrNull} to return `null` instead
|
|
@@ -750,16 +683,13 @@ export const getOrUndefined = /*#__PURE__*/getOrElse(constUndefined);
|
|
|
750
683
|
*
|
|
751
684
|
* **Example** (Lifting JSON.parse)
|
|
752
685
|
*
|
|
753
|
-
* ```ts
|
|
686
|
+
* ```ts import.meta.vitest
|
|
754
687
|
* import { Option } from "effect"
|
|
755
688
|
*
|
|
756
689
|
* const parse = Option.liftThrowable(JSON.parse)
|
|
757
690
|
*
|
|
758
|
-
*
|
|
759
|
-
* //
|
|
760
|
-
*
|
|
761
|
-
* console.log(parse(""))
|
|
762
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
691
|
+
* parse("1") // => Option.some(1)
|
|
692
|
+
* parse("") // => Option.none()
|
|
763
693
|
* ```
|
|
764
694
|
*
|
|
765
695
|
* @see {@link liftNullishOr} for nullable-returning functions
|
|
@@ -789,14 +719,16 @@ export const liftThrowable = f => (...a) => {
|
|
|
789
719
|
*
|
|
790
720
|
* **Example** (Throwing a custom error)
|
|
791
721
|
*
|
|
792
|
-
* ```ts
|
|
793
|
-
* import { Option } from "effect"
|
|
722
|
+
* ```ts import.meta.vitest
|
|
723
|
+
* import { Option, Result } from "effect"
|
|
794
724
|
*
|
|
795
|
-
*
|
|
796
|
-
* // Output: 1
|
|
725
|
+
* Option.getOrThrowWith(Option.some(1), () => new Error("missing")) // => 1
|
|
797
726
|
*
|
|
798
|
-
*
|
|
799
|
-
*
|
|
727
|
+
* const failure = Result.try({
|
|
728
|
+
* try: () => Option.getOrThrowWith(Option.none(), () => new Error("missing")),
|
|
729
|
+
* catch: (error) => (error as Error).message
|
|
730
|
+
* })
|
|
731
|
+
* Result.getFailure(failure).pipe(Option.getOrElse(() => "no error")) // => "missing"
|
|
800
732
|
* ```
|
|
801
733
|
*
|
|
802
734
|
* @see {@link getOrThrow} for a version with a default error
|
|
@@ -826,14 +758,16 @@ export const getOrThrowWith = /*#__PURE__*/dual(2, (self, onNone) => {
|
|
|
826
758
|
*
|
|
827
759
|
* **Example** (Throwing a default error)
|
|
828
760
|
*
|
|
829
|
-
* ```ts
|
|
830
|
-
* import { Option } from "effect"
|
|
761
|
+
* ```ts import.meta.vitest
|
|
762
|
+
* import { Option, Result } from "effect"
|
|
831
763
|
*
|
|
832
|
-
*
|
|
833
|
-
* // Output: 1
|
|
764
|
+
* Option.getOrThrow(Option.some(1)) // => 1
|
|
834
765
|
*
|
|
835
|
-
*
|
|
836
|
-
*
|
|
766
|
+
* const failure = Result.try({
|
|
767
|
+
* try: () => Option.getOrThrow(Option.none()),
|
|
768
|
+
* catch: (error) => (error as Error).message
|
|
769
|
+
* })
|
|
770
|
+
* Result.getFailure(failure).pipe(Option.getOrElse(() => "no error")) // => "getOrThrow called on a None"
|
|
837
771
|
* ```
|
|
838
772
|
*
|
|
839
773
|
* @see {@link getOrThrowWith} for a custom error
|
|
@@ -859,14 +793,11 @@ export const getOrThrow = /*#__PURE__*/getOrThrowWith(() => new Error("getOrThro
|
|
|
859
793
|
*
|
|
860
794
|
* **Example** (Mapping over an Option)
|
|
861
795
|
*
|
|
862
|
-
* ```ts
|
|
796
|
+
* ```ts import.meta.vitest
|
|
863
797
|
* import { Option } from "effect"
|
|
864
798
|
*
|
|
865
|
-
*
|
|
866
|
-
*
|
|
867
|
-
*
|
|
868
|
-
* console.log(Option.map(Option.none(), (n: number) => n * 2))
|
|
869
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
799
|
+
* Option.map(Option.some(2), (n) => n * 2) // => Option.some(4)
|
|
800
|
+
* Option.map(Option.none(), (n: number) => n * 2) // => Option.none()
|
|
870
801
|
* ```
|
|
871
802
|
*
|
|
872
803
|
* @see {@link flatMap} when `f` returns an `Option`
|
|
@@ -886,14 +817,11 @@ export const map = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : som
|
|
|
886
817
|
*
|
|
887
818
|
* **Example** (Replacing a value)
|
|
888
819
|
*
|
|
889
|
-
* ```ts
|
|
820
|
+
* ```ts import.meta.vitest
|
|
890
821
|
* import { Option } from "effect"
|
|
891
822
|
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* console.log(Option.as(Option.none(), "new value"))
|
|
896
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
823
|
+
* Option.as(Option.some(42), "new value") // => Option.some("new value")
|
|
824
|
+
* Option.as(Option.none(), "new value") // => Option.none()
|
|
897
825
|
* ```
|
|
898
826
|
*
|
|
899
827
|
* @see {@link asVoid} to replace with `undefined`
|
|
@@ -914,14 +842,11 @@ export const as = /*#__PURE__*/dual(2, (self, b) => map(self, () => b));
|
|
|
914
842
|
*
|
|
915
843
|
* **Example** (Voiding the value)
|
|
916
844
|
*
|
|
917
|
-
* ```ts
|
|
845
|
+
* ```ts import.meta.vitest
|
|
918
846
|
* import { Option } from "effect"
|
|
919
847
|
*
|
|
920
|
-
*
|
|
921
|
-
* //
|
|
922
|
-
*
|
|
923
|
-
* console.log(Option.asVoid(Option.none()))
|
|
924
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
848
|
+
* Option.asVoid(Option.some(42)) // => Option.some(undefined)
|
|
849
|
+
* Option.asVoid(Option.none()) // => Option.none()
|
|
925
850
|
* ```
|
|
926
851
|
*
|
|
927
852
|
* @see {@link as} to replace with a specific constant
|
|
@@ -941,11 +866,10 @@ export {
|
|
|
941
866
|
*
|
|
942
867
|
* **Example** (Referencing Option.void)
|
|
943
868
|
*
|
|
944
|
-
* ```ts
|
|
869
|
+
* ```ts import.meta.vitest
|
|
945
870
|
* import { Option } from "effect"
|
|
946
871
|
*
|
|
947
|
-
*
|
|
948
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: undefined }
|
|
872
|
+
* Option.void // => Option.some(undefined)
|
|
949
873
|
* ```
|
|
950
874
|
*
|
|
951
875
|
* @see {@link asVoid} to convert an existing `Option` to `Option<void>`
|
|
@@ -971,7 +895,7 @@ void_ as void };
|
|
|
971
895
|
*
|
|
972
896
|
* **Example** (Chaining optional lookups)
|
|
973
897
|
*
|
|
974
|
-
* ```ts
|
|
898
|
+
* ```ts import.meta.vitest
|
|
975
899
|
* import { Option } from "effect"
|
|
976
900
|
*
|
|
977
901
|
* interface User {
|
|
@@ -984,12 +908,9 @@ void_ as void };
|
|
|
984
908
|
* address: Option.some({ street: Option.some("123 Main St") })
|
|
985
909
|
* }
|
|
986
910
|
*
|
|
987
|
-
*
|
|
911
|
+
* user.address.pipe(
|
|
988
912
|
* Option.flatMap((addr) => addr.street)
|
|
989
|
-
* )
|
|
990
|
-
*
|
|
991
|
-
* console.log(street)
|
|
992
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: '123 Main St' }
|
|
913
|
+
* ) // => Option.some("123 Main St")
|
|
993
914
|
* ```
|
|
994
915
|
*
|
|
995
916
|
* @see {@link map} when `f` returns a plain value
|
|
@@ -1018,20 +939,17 @@ export const flatMap = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() :
|
|
|
1018
939
|
*
|
|
1019
940
|
* **Example** (Chaining with andThen)
|
|
1020
941
|
*
|
|
1021
|
-
* ```ts
|
|
942
|
+
* ```ts import.meta.vitest
|
|
1022
943
|
* import { Option } from "effect"
|
|
1023
944
|
*
|
|
1024
945
|
* // Chain with a function returning Option
|
|
1025
|
-
*
|
|
1026
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 10 }
|
|
946
|
+
* Option.andThen(Option.some(5), (x) => Option.some(x * 2)) // => Option.some(10)
|
|
1027
947
|
*
|
|
1028
948
|
* // Chain with a static value
|
|
1029
|
-
*
|
|
1030
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: "hello" }
|
|
949
|
+
* Option.andThen(Option.some(5), "hello") // => Option.some("hello")
|
|
1031
950
|
*
|
|
1032
951
|
* // Chain with None - skips
|
|
1033
|
-
*
|
|
1034
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
952
|
+
* Option.andThen(Option.none(), (x) => Option.some(x * 2)) // => Option.none()
|
|
1035
953
|
* ```
|
|
1036
954
|
*
|
|
1037
955
|
* @see {@link flatMap} for the standard monadic bind
|
|
@@ -1060,7 +978,7 @@ export const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {
|
|
|
1060
978
|
*
|
|
1061
979
|
* **Example** (Navigating optional properties)
|
|
1062
980
|
*
|
|
1063
|
-
* ```ts
|
|
981
|
+
* ```ts import.meta.vitest
|
|
1064
982
|
* import { Option } from "effect"
|
|
1065
983
|
*
|
|
1066
984
|
* interface Employee {
|
|
@@ -1071,12 +989,9 @@ export const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {
|
|
|
1071
989
|
* company: { address: { street: { name: "high street" } } }
|
|
1072
990
|
* }
|
|
1073
991
|
*
|
|
1074
|
-
*
|
|
1075
|
-
* Option.
|
|
1076
|
-
*
|
|
1077
|
-
* )
|
|
1078
|
-
* )
|
|
1079
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 'high street' }
|
|
992
|
+
* Option.some(emp).pipe(
|
|
993
|
+
* Option.flatMapNullishOr((e) => e.company?.address?.street?.name)
|
|
994
|
+
* ) // => Option.some("high street")
|
|
1080
995
|
* ```
|
|
1081
996
|
*
|
|
1082
997
|
* @see {@link flatMap} when the function already returns `Option`
|
|
@@ -1101,14 +1016,11 @@ export const flatMapNullishOr = /*#__PURE__*/dual(2, (self, f) => isNone(self) ?
|
|
|
1101
1016
|
*
|
|
1102
1017
|
* **Example** (Flattening nested Options)
|
|
1103
1018
|
*
|
|
1104
|
-
* ```ts
|
|
1019
|
+
* ```ts import.meta.vitest
|
|
1105
1020
|
* import { Option } from "effect"
|
|
1106
1021
|
*
|
|
1107
|
-
*
|
|
1108
|
-
* //
|
|
1109
|
-
*
|
|
1110
|
-
* console.log(Option.flatten(Option.some(Option.none())))
|
|
1111
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1022
|
+
* Option.flatten(Option.some(Option.some("value"))) // => Option.some("value")
|
|
1023
|
+
* Option.flatten(Option.some(Option.none())) // => Option.none()
|
|
1112
1024
|
* ```
|
|
1113
1025
|
*
|
|
1114
1026
|
* @see {@link flatMap} which is `map` + `flatten`
|
|
@@ -1132,14 +1044,11 @@ export const flatten = /*#__PURE__*/flatMap(identity);
|
|
|
1132
1044
|
*
|
|
1133
1045
|
* **Example** (Keeping the second value)
|
|
1134
1046
|
*
|
|
1135
|
-
* ```ts
|
|
1047
|
+
* ```ts import.meta.vitest
|
|
1136
1048
|
* import { Option } from "effect"
|
|
1137
1049
|
*
|
|
1138
|
-
*
|
|
1139
|
-
*
|
|
1140
|
-
*
|
|
1141
|
-
* console.log(Option.zipRight(Option.none(), Option.some("hello")))
|
|
1142
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1050
|
+
* Option.zipRight(Option.some(1), Option.some("hello")) // => Option.some("hello")
|
|
1051
|
+
* Option.zipRight(Option.none(), Option.some("hello")) // => Option.none()
|
|
1143
1052
|
* ```
|
|
1144
1053
|
*
|
|
1145
1054
|
* @see {@link zipLeft} to keep the first value instead
|
|
@@ -1164,14 +1073,11 @@ export const zipRight = /*#__PURE__*/dual(2, (self, that) => flatMap(self, () =>
|
|
|
1164
1073
|
*
|
|
1165
1074
|
* **Example** (Keeping the first value)
|
|
1166
1075
|
*
|
|
1167
|
-
* ```ts
|
|
1076
|
+
* ```ts import.meta.vitest
|
|
1168
1077
|
* import { Option } from "effect"
|
|
1169
1078
|
*
|
|
1170
|
-
*
|
|
1171
|
-
*
|
|
1172
|
-
*
|
|
1173
|
-
* console.log(Option.zipLeft(Option.some("hello"), Option.none()))
|
|
1174
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1079
|
+
* Option.zipLeft(Option.some("hello"), Option.some(1)) // => Option.some("hello")
|
|
1080
|
+
* Option.zipLeft(Option.some("hello"), Option.none()) // => Option.none()
|
|
1175
1081
|
* ```
|
|
1176
1082
|
*
|
|
1177
1083
|
* @see {@link zipRight} to keep the second value instead
|
|
@@ -1197,7 +1103,7 @@ export const zipLeft = /*#__PURE__*/dual(2, (self, that) => tap(self, () => that
|
|
|
1197
1103
|
*
|
|
1198
1104
|
* **Example** (Composing parsers)
|
|
1199
1105
|
*
|
|
1200
|
-
* ```ts
|
|
1106
|
+
* ```ts import.meta.vitest
|
|
1201
1107
|
* import { Option } from "effect"
|
|
1202
1108
|
*
|
|
1203
1109
|
* const parse = (s: string): Option.Option<number> =>
|
|
@@ -1208,11 +1114,8 @@ export const zipLeft = /*#__PURE__*/dual(2, (self, that) => tap(self, () => that
|
|
|
1208
1114
|
*
|
|
1209
1115
|
* const parseAndDouble = Option.composeK(parse, double)
|
|
1210
1116
|
*
|
|
1211
|
-
*
|
|
1212
|
-
*
|
|
1213
|
-
*
|
|
1214
|
-
* console.log(parseAndDouble("not a number"))
|
|
1215
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1117
|
+
* parseAndDouble("42") // => Option.some(84)
|
|
1118
|
+
* parseAndDouble("not a number") // => Option.none()
|
|
1216
1119
|
* ```
|
|
1217
1120
|
*
|
|
1218
1121
|
* @see {@link flatMap} for single-step chaining
|
|
@@ -1238,17 +1141,14 @@ export const composeK = /*#__PURE__*/dual(2, (afb, bfc) => a => flatMap(afb(a),
|
|
|
1238
1141
|
*
|
|
1239
1142
|
* **Example** (Validating without transforming)
|
|
1240
1143
|
*
|
|
1241
|
-
* ```ts
|
|
1144
|
+
* ```ts import.meta.vitest
|
|
1242
1145
|
* import { Option } from "effect"
|
|
1243
1146
|
*
|
|
1244
1147
|
* const getInteger = (n: number) =>
|
|
1245
1148
|
* Number.isInteger(n) ? Option.some(n) : Option.none()
|
|
1246
1149
|
*
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
* console.log(Option.tap(Option.some(1.14), getInteger))
|
|
1251
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1150
|
+
* Option.tap(Option.some(1), getInteger) // => Option.some(1)
|
|
1151
|
+
* Option.tap(Option.some(1.14), getInteger) // => Option.none()
|
|
1252
1152
|
* ```
|
|
1253
1153
|
*
|
|
1254
1154
|
* @see {@link flatMap} when you want to transform the value
|
|
@@ -1274,14 +1174,11 @@ export const tap = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => map(f(a)
|
|
|
1274
1174
|
*
|
|
1275
1175
|
* **Example** (Pairing two Options)
|
|
1276
1176
|
*
|
|
1277
|
-
* ```ts
|
|
1177
|
+
* ```ts import.meta.vitest
|
|
1278
1178
|
* import { Option } from "effect"
|
|
1279
1179
|
*
|
|
1280
|
-
*
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1283
|
-
* console.log(Option.product(Option.none(), Option.some(42)))
|
|
1284
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1180
|
+
* Option.product(Option.some("hello"), Option.some(42)) // => Option.some(["hello", 42])
|
|
1181
|
+
* Option.product(Option.none(), Option.some(42)) // => Option.none()
|
|
1285
1182
|
* ```
|
|
1286
1183
|
*
|
|
1287
1184
|
* @see {@link zipWith} to combine with a function instead of a tuple
|
|
@@ -1307,17 +1204,14 @@ export const product = (self, that) => isSome(self) && isSome(that) ? some([self
|
|
|
1307
1204
|
*
|
|
1308
1205
|
* **Example** (Combining many Options)
|
|
1309
1206
|
*
|
|
1310
|
-
* ```ts
|
|
1207
|
+
* ```ts import.meta.vitest
|
|
1311
1208
|
* import { Option } from "effect"
|
|
1312
1209
|
*
|
|
1313
1210
|
* const first = Option.some(1)
|
|
1314
1211
|
* const rest = [Option.some(2), Option.some(3)]
|
|
1315
1212
|
*
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
*
|
|
1319
|
-
* console.log(Option.productMany(first, [Option.some(2), Option.none()]))
|
|
1320
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1213
|
+
* Option.productMany(first, rest) // => Option.some([1, 2, 3])
|
|
1214
|
+
* Option.productMany(first, [Option.some(2), Option.none()]) // => Option.none()
|
|
1321
1215
|
* ```
|
|
1322
1216
|
*
|
|
1323
1217
|
* @see {@link product} for combining exactly two
|
|
@@ -1357,7 +1251,7 @@ export const productMany = (self, collection) => {
|
|
|
1357
1251
|
*
|
|
1358
1252
|
* **Example** (Combining a tuple and a struct)
|
|
1359
1253
|
*
|
|
1360
|
-
* ```ts
|
|
1254
|
+
* ```ts import.meta.vitest
|
|
1361
1255
|
* import { Option } from "effect"
|
|
1362
1256
|
*
|
|
1363
1257
|
* const maybeName: Option.Option<string> = Option.some("John")
|
|
@@ -1365,17 +1259,11 @@ export const productMany = (self, collection) => {
|
|
|
1365
1259
|
*
|
|
1366
1260
|
* // ┌─── Option<[string, number]>
|
|
1367
1261
|
* // ▼
|
|
1368
|
-
* const tuple = Option.all([maybeName, maybeAge])
|
|
1369
|
-
* console.log(tuple)
|
|
1370
|
-
* // Output:
|
|
1371
|
-
* // { _id: 'Option', _tag: 'Some', value: [ 'John', 25 ] }
|
|
1262
|
+
* const tuple = Option.all([maybeName, maybeAge]) // => Option.some(["John", 25])
|
|
1372
1263
|
*
|
|
1373
1264
|
* // ┌─── Option<{ name: string; age: number; }>
|
|
1374
1265
|
* // ▼
|
|
1375
|
-
* const struct = Option.all({ name: maybeName, age: maybeAge })
|
|
1376
|
-
* console.log(struct)
|
|
1377
|
-
* // Output:
|
|
1378
|
-
* // { _id: 'Option', _tag: 'Some', value: { name: 'John', age: 25 } }
|
|
1266
|
+
* const struct = Option.all({ name: maybeName, age: maybeAge }) // => Option.some({ name: "John", age: 25 })
|
|
1379
1267
|
* ```
|
|
1380
1268
|
*
|
|
1381
1269
|
* @see {@link product} for combining exactly two
|
|
@@ -1421,18 +1309,14 @@ export const all = input => {
|
|
|
1421
1309
|
*
|
|
1422
1310
|
* **Example** (Combining with a function)
|
|
1423
1311
|
*
|
|
1424
|
-
* ```ts
|
|
1312
|
+
* ```ts import.meta.vitest
|
|
1425
1313
|
* import { Option } from "effect"
|
|
1426
1314
|
*
|
|
1427
|
-
*
|
|
1315
|
+
* Option.zipWith(
|
|
1428
1316
|
* Option.some("John"),
|
|
1429
1317
|
* Option.some(25),
|
|
1430
1318
|
* (name, age) => ({ name: name.toUpperCase(), age })
|
|
1431
|
-
* )
|
|
1432
|
-
*
|
|
1433
|
-
* console.log(person)
|
|
1434
|
-
* // Output:
|
|
1435
|
-
* // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }
|
|
1319
|
+
* ) // => Option.some({ name: "JOHN", age: 25 })
|
|
1436
1320
|
* ```
|
|
1437
1321
|
*
|
|
1438
1322
|
* @see {@link product} to combine into a tuple instead
|
|
@@ -1458,16 +1342,15 @@ export const zipWith = /*#__PURE__*/dual(3, (self, that, f) => map(product(self,
|
|
|
1458
1342
|
*
|
|
1459
1343
|
* **Example** (Summing present values)
|
|
1460
1344
|
*
|
|
1461
|
-
* ```ts
|
|
1345
|
+
* ```ts import.meta.vitest
|
|
1462
1346
|
* import { Option, pipe } from "effect"
|
|
1463
1347
|
*
|
|
1464
1348
|
* const items = [Option.some(1), Option.none(), Option.some(2), Option.none()]
|
|
1465
1349
|
*
|
|
1466
|
-
*
|
|
1467
|
-
* // Output: 3
|
|
1350
|
+
* pipe(items, Option.reduceCompact(0, (b, a) => b + a)) // => 3
|
|
1468
1351
|
* ```
|
|
1469
1352
|
*
|
|
1470
|
-
* @category
|
|
1353
|
+
* @category folding
|
|
1471
1354
|
* @since 2.0.0
|
|
1472
1355
|
*/
|
|
1473
1356
|
export const reduceCompact = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
@@ -1494,14 +1377,11 @@ export const reduceCompact = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
|
1494
1377
|
*
|
|
1495
1378
|
* **Example** (Converting to an array)
|
|
1496
1379
|
*
|
|
1497
|
-
* ```ts
|
|
1380
|
+
* ```ts import.meta.vitest
|
|
1498
1381
|
* import { Option } from "effect"
|
|
1499
1382
|
*
|
|
1500
|
-
*
|
|
1501
|
-
* //
|
|
1502
|
-
*
|
|
1503
|
-
* console.log(Option.toArray(Option.none()))
|
|
1504
|
-
* // Output: []
|
|
1383
|
+
* Option.toArray(Option.some(1)) // => [1]
|
|
1384
|
+
* Option.toArray(Option.none()) // => []
|
|
1505
1385
|
* ```
|
|
1506
1386
|
*
|
|
1507
1387
|
* @see {@link fromIterable} for the inverse direction
|
|
@@ -1526,7 +1406,7 @@ export const toArray = self => isNone(self) ? [] : [self.value];
|
|
|
1526
1406
|
*
|
|
1527
1407
|
* **Example** (Partitioning by Result)
|
|
1528
1408
|
*
|
|
1529
|
-
* ```ts
|
|
1409
|
+
* ```ts import.meta.vitest
|
|
1530
1410
|
* import { Option, Result } from "effect"
|
|
1531
1411
|
*
|
|
1532
1412
|
* const parseNumber = (s: string): Result.Result<number, string> => {
|
|
@@ -1534,14 +1414,9 @@ export const toArray = self => isNone(self) ? [] : [self.value];
|
|
|
1534
1414
|
* return isNaN(n) ? Result.fail("Not a number") : Result.succeed(n)
|
|
1535
1415
|
* }
|
|
1536
1416
|
*
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
* console.log(Option.partitionMap(Option.some("abc"), parseNumber))
|
|
1541
|
-
* // Output: [{ _id: 'Option', _tag: 'Some', value: 'Not a number' }, { _id: 'Option', _tag: 'None' }]
|
|
1542
|
-
*
|
|
1543
|
-
* console.log(Option.partitionMap(Option.none(), parseNumber))
|
|
1544
|
-
* // Output: [{ _id: 'Option', _tag: 'None' }, { _id: 'Option', _tag: 'None' }]
|
|
1417
|
+
* Option.partitionMap(Option.some("42"), parseNumber) // => [Option.none(), Option.some(42)]
|
|
1418
|
+
* Option.partitionMap(Option.some("abc"), parseNumber) // => [Option.some("Not a number"), Option.none()]
|
|
1419
|
+
* Option.partitionMap(Option.none(), parseNumber) // => [Option.none(), Option.none()]
|
|
1545
1420
|
* ```
|
|
1546
1421
|
*
|
|
1547
1422
|
* @see {@link filter} for simple predicate-based filtering
|
|
@@ -1571,14 +1446,13 @@ export const partitionMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1571
1446
|
*
|
|
1572
1447
|
* **Example** (Filtering and transforming)
|
|
1573
1448
|
*
|
|
1574
|
-
* ```ts
|
|
1449
|
+
* ```ts import.meta.vitest
|
|
1575
1450
|
* import { Option, Result } from "effect"
|
|
1576
1451
|
*
|
|
1577
|
-
*
|
|
1452
|
+
* Option.filterMap(
|
|
1578
1453
|
* Option.some(2),
|
|
1579
1454
|
* (n) => (n % 2 === 0 ? Result.succeed(`Even: ${n}`) : Result.failVoid)
|
|
1580
|
-
* ))
|
|
1581
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 'Even: 2' }
|
|
1455
|
+
* ) // => Option.some("Even: 2")
|
|
1582
1456
|
* ```
|
|
1583
1457
|
*
|
|
1584
1458
|
* @see {@link filter} for predicate-based filtering
|
|
@@ -1611,20 +1485,15 @@ export const filterMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1611
1485
|
*
|
|
1612
1486
|
* **Example** (Filtering with a predicate)
|
|
1613
1487
|
*
|
|
1614
|
-
* ```ts
|
|
1488
|
+
* ```ts import.meta.vitest
|
|
1615
1489
|
* import { Option } from "effect"
|
|
1616
1490
|
*
|
|
1617
1491
|
* const removeEmpty = (input: Option.Option<string>) =>
|
|
1618
1492
|
* Option.filter(input, (value) => value !== "")
|
|
1619
1493
|
*
|
|
1620
|
-
*
|
|
1621
|
-
* //
|
|
1622
|
-
*
|
|
1623
|
-
* console.log(removeEmpty(Option.some("")))
|
|
1624
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1625
|
-
*
|
|
1626
|
-
* console.log(removeEmpty(Option.none()))
|
|
1627
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1494
|
+
* removeEmpty(Option.some("hello")) // => Option.some("hello")
|
|
1495
|
+
* removeEmpty(Option.some("")) // => Option.none()
|
|
1496
|
+
* removeEmpty(Option.none()) // => Option.none()
|
|
1628
1497
|
* ```
|
|
1629
1498
|
*
|
|
1630
1499
|
* @see {@link filterMap} to transform and filter simultaneously
|
|
@@ -1650,19 +1519,14 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => isNone(self) ? n
|
|
|
1650
1519
|
*
|
|
1651
1520
|
* **Example** (Comparing Options)
|
|
1652
1521
|
*
|
|
1653
|
-
* ```ts
|
|
1522
|
+
* ```ts import.meta.vitest
|
|
1654
1523
|
* import { Equivalence, Option } from "effect"
|
|
1655
1524
|
*
|
|
1656
1525
|
* const eq = Option.makeEquivalence(Equivalence.strictEqual<number>())
|
|
1657
1526
|
*
|
|
1658
|
-
*
|
|
1659
|
-
* //
|
|
1660
|
-
*
|
|
1661
|
-
* console.log(eq(Option.some(1), Option.some(2)))
|
|
1662
|
-
* // Output: false
|
|
1663
|
-
*
|
|
1664
|
-
* console.log(eq(Option.none(), Option.none()))
|
|
1665
|
-
* // Output: true
|
|
1527
|
+
* eq(Option.some(1), Option.some(1)) // => true
|
|
1528
|
+
* eq(Option.some(1), Option.some(2)) // => false
|
|
1529
|
+
* eq(Option.none(), Option.none()) // => true
|
|
1666
1530
|
* ```
|
|
1667
1531
|
*
|
|
1668
1532
|
* @category instances
|
|
@@ -1686,19 +1550,14 @@ export const makeEquivalence = isEquivalent => Equivalence.make((x, y) => isNone
|
|
|
1686
1550
|
*
|
|
1687
1551
|
* **Example** (Ordering Options)
|
|
1688
1552
|
*
|
|
1689
|
-
* ```ts
|
|
1553
|
+
* ```ts import.meta.vitest
|
|
1690
1554
|
* import { Number as N, Option } from "effect"
|
|
1691
1555
|
*
|
|
1692
1556
|
* const ord = Option.makeOrder(N.Order)
|
|
1693
1557
|
*
|
|
1694
|
-
*
|
|
1695
|
-
* //
|
|
1696
|
-
*
|
|
1697
|
-
* console.log(ord(Option.some(1), Option.none()))
|
|
1698
|
-
* // Output: 1
|
|
1699
|
-
*
|
|
1700
|
-
* console.log(ord(Option.some(1), Option.some(2)))
|
|
1701
|
-
* // Output: -1
|
|
1558
|
+
* ord(Option.none(), Option.some(1)) // => -1
|
|
1559
|
+
* ord(Option.some(1), Option.none()) // => 1
|
|
1560
|
+
* ord(Option.some(1), Option.some(2)) // => -1
|
|
1702
1561
|
* ```
|
|
1703
1562
|
*
|
|
1704
1563
|
* @category sorting
|
|
@@ -1720,16 +1579,13 @@ export const makeOrder = O => order.make((self, that) => isSome(self) ? isSome(t
|
|
|
1720
1579
|
*
|
|
1721
1580
|
* **Example** (Lifting addition)
|
|
1722
1581
|
*
|
|
1723
|
-
* ```ts
|
|
1582
|
+
* ```ts import.meta.vitest
|
|
1724
1583
|
* import { Option } from "effect"
|
|
1725
1584
|
*
|
|
1726
1585
|
* const addOptions = Option.lift2((a: number, b: number) => a + b)
|
|
1727
1586
|
*
|
|
1728
|
-
*
|
|
1729
|
-
*
|
|
1730
|
-
*
|
|
1731
|
-
* console.log(addOptions(Option.some(2), Option.none()))
|
|
1732
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1587
|
+
* addOptions(Option.some(2), Option.some(3)) // => Option.some(5)
|
|
1588
|
+
* addOptions(Option.some(2), Option.none()) // => Option.none()
|
|
1733
1589
|
* ```
|
|
1734
1590
|
*
|
|
1735
1591
|
* @see {@link zipWith} for a non-lifted variant
|
|
@@ -1755,16 +1611,13 @@ export const lift2 = f => dual(2, (self, that) => zipWith(self, that, f));
|
|
|
1755
1611
|
*
|
|
1756
1612
|
* **Example** (Validating positive numbers)
|
|
1757
1613
|
*
|
|
1758
|
-
* ```ts
|
|
1614
|
+
* ```ts import.meta.vitest
|
|
1759
1615
|
* import { Option } from "effect"
|
|
1760
1616
|
*
|
|
1761
1617
|
* const parsePositive = Option.liftPredicate((n: number) => n > 0)
|
|
1762
1618
|
*
|
|
1763
|
-
*
|
|
1764
|
-
* //
|
|
1765
|
-
*
|
|
1766
|
-
* console.log(parsePositive(-1))
|
|
1767
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1619
|
+
* parsePositive(1) // => Option.some(1)
|
|
1620
|
+
* parsePositive(-1) // => Option.none()
|
|
1768
1621
|
* ```
|
|
1769
1622
|
*
|
|
1770
1623
|
* @see {@link filter} to apply a predicate to an existing `Option`
|
|
@@ -1790,24 +1643,19 @@ export const liftPredicate = /*#__PURE__*/dual(2, (b, predicate) => predicate(b)
|
|
|
1790
1643
|
*
|
|
1791
1644
|
* **Example** (Checking with custom equivalence)
|
|
1792
1645
|
*
|
|
1793
|
-
* ```ts
|
|
1646
|
+
* ```ts import.meta.vitest
|
|
1794
1647
|
* import { Equivalence, Option } from "effect"
|
|
1795
1648
|
*
|
|
1796
1649
|
* const check = Option.containsWith(Equivalence.strictEqual<number>())
|
|
1797
1650
|
*
|
|
1798
|
-
*
|
|
1799
|
-
* //
|
|
1800
|
-
*
|
|
1801
|
-
* console.log(Option.some(1).pipe(check(2)))
|
|
1802
|
-
* // Output: false
|
|
1803
|
-
*
|
|
1804
|
-
* console.log(Option.none().pipe(check(2)))
|
|
1805
|
-
* // Output: false
|
|
1651
|
+
* Option.some(2).pipe(check(2)) // => true
|
|
1652
|
+
* Option.some(1).pipe(check(2)) // => false
|
|
1653
|
+
* Option.none().pipe(check(2)) // => false
|
|
1806
1654
|
* ```
|
|
1807
1655
|
*
|
|
1808
1656
|
* @see {@link contains} for a version using default equality
|
|
1809
1657
|
*
|
|
1810
|
-
* @category
|
|
1658
|
+
* @category predicates
|
|
1811
1659
|
* @since 2.0.0
|
|
1812
1660
|
*/
|
|
1813
1661
|
export const containsWith = isEquivalent => dual(2, (self, a) => isNone(self) ? false : isEquivalent(self.value, a));
|
|
@@ -1827,23 +1675,18 @@ export const containsWith = isEquivalent => dual(2, (self, a) => isNone(self) ?
|
|
|
1827
1675
|
*
|
|
1828
1676
|
* **Example** (Checking containment)
|
|
1829
1677
|
*
|
|
1830
|
-
* ```ts
|
|
1678
|
+
* ```ts import.meta.vitest
|
|
1831
1679
|
* import { Option } from "effect"
|
|
1832
1680
|
*
|
|
1833
|
-
*
|
|
1834
|
-
* //
|
|
1835
|
-
*
|
|
1836
|
-
* console.log(Option.some(1).pipe(Option.contains(2)))
|
|
1837
|
-
* // Output: false
|
|
1838
|
-
*
|
|
1839
|
-
* console.log(Option.none().pipe(Option.contains(2)))
|
|
1840
|
-
* // Output: false
|
|
1681
|
+
* Option.some(2).pipe(Option.contains(2)) // => true
|
|
1682
|
+
* Option.some(1).pipe(Option.contains(2)) // => false
|
|
1683
|
+
* Option.none().pipe(Option.contains(2)) // => false
|
|
1841
1684
|
* ```
|
|
1842
1685
|
*
|
|
1843
1686
|
* @see {@link containsWith} for custom equality
|
|
1844
1687
|
* @see {@link exists} to test with a predicate
|
|
1845
1688
|
*
|
|
1846
|
-
* @category
|
|
1689
|
+
* @category predicates
|
|
1847
1690
|
* @since 2.0.0
|
|
1848
1691
|
*/
|
|
1849
1692
|
export const contains = /*#__PURE__*/containsWith(/*#__PURE__*/Equal.asEquivalence());
|
|
@@ -1863,25 +1706,20 @@ export const contains = /*#__PURE__*/containsWith(/*#__PURE__*/Equal.asEquivalen
|
|
|
1863
1706
|
*
|
|
1864
1707
|
* **Example** (Testing a condition)
|
|
1865
1708
|
*
|
|
1866
|
-
* ```ts
|
|
1709
|
+
* ```ts import.meta.vitest
|
|
1867
1710
|
* import { Option } from "effect"
|
|
1868
1711
|
*
|
|
1869
1712
|
* const isEven = (n: number) => n % 2 === 0
|
|
1870
1713
|
*
|
|
1871
|
-
*
|
|
1872
|
-
* //
|
|
1873
|
-
*
|
|
1874
|
-
* console.log(Option.some(1).pipe(Option.exists(isEven)))
|
|
1875
|
-
* // Output: false
|
|
1876
|
-
*
|
|
1877
|
-
* console.log(Option.none().pipe(Option.exists(isEven)))
|
|
1878
|
-
* // Output: false
|
|
1714
|
+
* Option.some(2).pipe(Option.exists(isEven)) // => true
|
|
1715
|
+
* Option.some(1).pipe(Option.exists(isEven)) // => false
|
|
1716
|
+
* Option.none().pipe(Option.exists(isEven)) // => false
|
|
1879
1717
|
* ```
|
|
1880
1718
|
*
|
|
1881
1719
|
* @see {@link filter} to keep or discard based on a predicate
|
|
1882
1720
|
* @see {@link contains} to test for a specific value
|
|
1883
1721
|
*
|
|
1884
|
-
* @category
|
|
1722
|
+
* @category predicates
|
|
1885
1723
|
* @since 2.0.0
|
|
1886
1724
|
*/
|
|
1887
1725
|
export const exists = /*#__PURE__*/dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
|
|
@@ -1899,24 +1737,22 @@ export const exists = /*#__PURE__*/dual(2, (self, refinement) => isNone(self) ?
|
|
|
1899
1737
|
*
|
|
1900
1738
|
* **Example** (Starting do notation)
|
|
1901
1739
|
*
|
|
1902
|
-
* ```ts
|
|
1740
|
+
* ```ts import.meta.vitest
|
|
1903
1741
|
* import { Option, pipe } from "effect"
|
|
1904
|
-
* import * as assert from "node:assert"
|
|
1905
1742
|
*
|
|
1906
|
-
*
|
|
1743
|
+
* pipe(
|
|
1907
1744
|
* Option.some(2),
|
|
1908
1745
|
* Option.bindTo("x"),
|
|
1909
1746
|
* Option.bind("y", () => Option.some(3)),
|
|
1910
1747
|
* Option.let("sum", ({ x, y }) => x + y)
|
|
1911
|
-
* )
|
|
1912
|
-
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1748
|
+
* ) // => Option.some({ x: 2, y: 3, sum: 5 })
|
|
1913
1749
|
* ```
|
|
1914
1750
|
*
|
|
1915
1751
|
* @see {@link Do} for starting with an empty record
|
|
1916
1752
|
* @see {@link bind} to add `Option` values
|
|
1917
1753
|
* @see {@link let_ let} to add plain values
|
|
1918
1754
|
*
|
|
1919
|
-
* @category
|
|
1755
|
+
* @category mapping
|
|
1920
1756
|
* @since 2.0.0
|
|
1921
1757
|
*/
|
|
1922
1758
|
export const bindTo = /*#__PURE__*/doNotation.bindTo(map);
|
|
@@ -1932,24 +1768,22 @@ export {
|
|
|
1932
1768
|
*
|
|
1933
1769
|
* **Example** (Adding a computed value)
|
|
1934
1770
|
*
|
|
1935
|
-
* ```ts
|
|
1771
|
+
* ```ts import.meta.vitest
|
|
1936
1772
|
* import { Option, pipe } from "effect"
|
|
1937
|
-
* import * as assert from "node:assert"
|
|
1938
1773
|
*
|
|
1939
|
-
*
|
|
1774
|
+
* pipe(
|
|
1940
1775
|
* Option.Do,
|
|
1941
1776
|
* Option.bind("x", () => Option.some(2)),
|
|
1942
1777
|
* Option.bind("y", () => Option.some(3)),
|
|
1943
1778
|
* Option.let("sum", ({ x, y }) => x + y)
|
|
1944
|
-
* )
|
|
1945
|
-
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1779
|
+
* ) // => Option.some({ x: 2, y: 3, sum: 5 })
|
|
1946
1780
|
* ```
|
|
1947
1781
|
*
|
|
1948
1782
|
* @see {@link Do} for starting the chain
|
|
1949
1783
|
* @see {@link bind} to add `Option` values
|
|
1950
1784
|
* @see {@link bindTo} to start by naming an existing `Option`
|
|
1951
1785
|
*
|
|
1952
|
-
* @category
|
|
1786
|
+
* @category mapping
|
|
1953
1787
|
* @since 2.0.0
|
|
1954
1788
|
*/
|
|
1955
1789
|
let_ as let };
|
|
@@ -1963,25 +1797,23 @@ let_ as let };
|
|
|
1963
1797
|
*
|
|
1964
1798
|
* **Example** (Binding Option values)
|
|
1965
1799
|
*
|
|
1966
|
-
* ```ts
|
|
1800
|
+
* ```ts import.meta.vitest
|
|
1967
1801
|
* import { Option, pipe } from "effect"
|
|
1968
|
-
* import * as assert from "node:assert"
|
|
1969
1802
|
*
|
|
1970
|
-
*
|
|
1803
|
+
* pipe(
|
|
1971
1804
|
* Option.Do,
|
|
1972
1805
|
* Option.bind("x", () => Option.some(2)),
|
|
1973
1806
|
* Option.bind("y", () => Option.some(3)),
|
|
1974
1807
|
* Option.let("sum", ({ x, y }) => x + y),
|
|
1975
1808
|
* Option.filter(({ x, y }) => x * y > 5)
|
|
1976
|
-
* )
|
|
1977
|
-
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1809
|
+
* ) // => Option.some({ x: 2, y: 3, sum: 5 })
|
|
1978
1810
|
* ```
|
|
1979
1811
|
*
|
|
1980
1812
|
* @see {@link Do} for starting the chain
|
|
1981
1813
|
* @see {@link let_ let} to add plain values
|
|
1982
1814
|
* @see {@link bindTo} to start by naming an existing `Option`
|
|
1983
1815
|
*
|
|
1984
|
-
* @category
|
|
1816
|
+
* @category sequencing
|
|
1985
1817
|
* @since 2.0.0
|
|
1986
1818
|
*/
|
|
1987
1819
|
export const bind = /*#__PURE__*/doNotation.bind(map, flatMap);
|
|
@@ -1996,25 +1828,23 @@ export const bind = /*#__PURE__*/doNotation.bind(map, flatMap);
|
|
|
1996
1828
|
*
|
|
1997
1829
|
* **Example** (Building Option pipelines with do notation)
|
|
1998
1830
|
*
|
|
1999
|
-
* ```ts
|
|
1831
|
+
* ```ts import.meta.vitest
|
|
2000
1832
|
* import { Option, pipe } from "effect"
|
|
2001
|
-
* import * as assert from "node:assert"
|
|
2002
1833
|
*
|
|
2003
|
-
*
|
|
1834
|
+
* pipe(
|
|
2004
1835
|
* Option.Do,
|
|
2005
1836
|
* Option.bind("x", () => Option.some(2)),
|
|
2006
1837
|
* Option.bind("y", () => Option.some(3)),
|
|
2007
1838
|
* Option.let("sum", ({ x, y }) => x + y),
|
|
2008
1839
|
* Option.filter(({ x, y }) => x * y > 5)
|
|
2009
|
-
* )
|
|
2010
|
-
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1840
|
+
* ) // => Option.some({ x: 2, y: 3, sum: 5 })
|
|
2011
1841
|
* ```
|
|
2012
1842
|
*
|
|
2013
1843
|
* @see {@link bind} to add `Option` values
|
|
2014
1844
|
* @see {@link let_ let} to add plain values
|
|
2015
1845
|
* @see {@link bindTo} to start by naming an existing `Option`
|
|
2016
1846
|
*
|
|
2017
|
-
* @category
|
|
1847
|
+
* @category constructors
|
|
2018
1848
|
* @since 2.0.0
|
|
2019
1849
|
*/
|
|
2020
1850
|
export const Do = /*#__PURE__*/some({});
|
|
@@ -2035,21 +1865,17 @@ export const Do = /*#__PURE__*/some({});
|
|
|
2035
1865
|
*
|
|
2036
1866
|
* **Example** (Sequencing Option computations with generator syntax)
|
|
2037
1867
|
*
|
|
2038
|
-
* ```ts
|
|
1868
|
+
* ```ts import.meta.vitest
|
|
2039
1869
|
* import { Option } from "effect"
|
|
2040
1870
|
*
|
|
2041
1871
|
* const maybeName: Option.Option<string> = Option.some("John")
|
|
2042
1872
|
* const maybeAge: Option.Option<number> = Option.some(25)
|
|
2043
1873
|
*
|
|
2044
|
-
*
|
|
1874
|
+
* Option.gen(function*() {
|
|
2045
1875
|
* const name = (yield* maybeName).toUpperCase()
|
|
2046
1876
|
* const age = yield* maybeAge
|
|
2047
1877
|
* return { name, age }
|
|
2048
|
-
* })
|
|
2049
|
-
*
|
|
2050
|
-
* console.log(person)
|
|
2051
|
-
* // Output:
|
|
2052
|
-
* // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }
|
|
1878
|
+
* }) // => Option.some({ name: "JOHN", age: 25 })
|
|
2053
1879
|
* ```
|
|
2054
1880
|
*
|
|
2055
1881
|
* @see {@link Do} / {@link bind} for the do notation alternative
|
|
@@ -2089,17 +1915,16 @@ export const gen = (...args) => {
|
|
|
2089
1915
|
*
|
|
2090
1916
|
* **Example** (Reducing with first-wins semantics)
|
|
2091
1917
|
*
|
|
2092
|
-
* ```ts
|
|
1918
|
+
* ```ts import.meta.vitest
|
|
2093
1919
|
* import { Number, Option } from "effect"
|
|
2094
1920
|
*
|
|
2095
1921
|
* const reducer = Option.makeReducer(Number.ReducerSum)
|
|
2096
|
-
*
|
|
2097
|
-
* // Output: { _id: 'Option', _tag: 'Some', value: 3 }
|
|
1922
|
+
* reducer.combineAll([Option.some(1), Option.none(), Option.some(2)]) // => Option.some(3)
|
|
2098
1923
|
* ```
|
|
2099
1924
|
*
|
|
2100
1925
|
* @see {@link makeReducerFailFast} for fail-fast semantics
|
|
2101
1926
|
*
|
|
2102
|
-
* @category
|
|
1927
|
+
* @category constructors
|
|
2103
1928
|
* @since 4.0.0
|
|
2104
1929
|
*/
|
|
2105
1930
|
export function makeReducer(combiner) {
|
|
@@ -2126,20 +1951,17 @@ export function makeReducer(combiner) {
|
|
|
2126
1951
|
*
|
|
2127
1952
|
* **Example** (Fail-fast combining)
|
|
2128
1953
|
*
|
|
2129
|
-
* ```ts
|
|
1954
|
+
* ```ts import.meta.vitest
|
|
2130
1955
|
* import { Number, Option } from "effect"
|
|
2131
1956
|
*
|
|
2132
1957
|
* const combiner = Option.makeCombinerFailFast(Number.ReducerSum)
|
|
2133
|
-
*
|
|
2134
|
-
*
|
|
2135
|
-
*
|
|
2136
|
-
* console.log(combiner.combine(Option.some(1), Option.none()))
|
|
2137
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1958
|
+
* combiner.combine(Option.some(1), Option.some(2)) // => Option.some(3)
|
|
1959
|
+
* combiner.combine(Option.some(1), Option.none()) // => Option.none()
|
|
2138
1960
|
* ```
|
|
2139
1961
|
*
|
|
2140
1962
|
* @see {@link makeReducerFailFast} to get a full `Reducer`
|
|
2141
1963
|
*
|
|
2142
|
-
* @category
|
|
1964
|
+
* @category constructors
|
|
2143
1965
|
* @since 4.0.0
|
|
2144
1966
|
*/
|
|
2145
1967
|
export function makeCombinerFailFast(combiner) {
|
|
@@ -2165,21 +1987,18 @@ export function makeCombinerFailFast(combiner) {
|
|
|
2165
1987
|
*
|
|
2166
1988
|
* **Example** (Fail-fast reducing)
|
|
2167
1989
|
*
|
|
2168
|
-
* ```ts
|
|
1990
|
+
* ```ts import.meta.vitest
|
|
2169
1991
|
* import { Number, Option } from "effect"
|
|
2170
1992
|
*
|
|
2171
1993
|
* const reducer = Option.makeReducerFailFast(Number.ReducerSum)
|
|
2172
|
-
*
|
|
2173
|
-
*
|
|
2174
|
-
*
|
|
2175
|
-
* console.log(reducer.combineAll([Option.some(1), Option.none()]))
|
|
2176
|
-
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1994
|
+
* reducer.combineAll([Option.some(1), Option.some(2)]) // => Option.some(3)
|
|
1995
|
+
* reducer.combineAll([Option.some(1), Option.none()]) // => Option.none()
|
|
2177
1996
|
* ```
|
|
2178
1997
|
*
|
|
2179
1998
|
* @see {@link makeCombinerFailFast} for just the combiner
|
|
2180
1999
|
* @see {@link makeReducer} for non-fail-fast semantics
|
|
2181
2000
|
*
|
|
2182
|
-
* @category
|
|
2001
|
+
* @category constructors
|
|
2183
2002
|
* @since 4.0.0
|
|
2184
2003
|
*/
|
|
2185
2004
|
export function makeReducerFailFast(reducer) {
|