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/TxHashMap.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ declare const TypeId = "~effect/transactions/TxHashMap";
|
|
|
24
24
|
*
|
|
25
25
|
* **Example** (Using transactional hash maps)
|
|
26
26
|
*
|
|
27
|
-
* ```ts
|
|
28
|
-
* import { Effect, TxHashMap } from "effect"
|
|
27
|
+
* ```ts import.meta.vitest
|
|
28
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
29
29
|
*
|
|
30
30
|
* const program = Effect.gen(function*() {
|
|
31
31
|
* // Create a transactional hash map
|
|
@@ -33,8 +33,7 @@ declare const TypeId = "~effect/transactions/TxHashMap";
|
|
|
33
33
|
*
|
|
34
34
|
* // Single operations are automatically transactional
|
|
35
35
|
* yield* TxHashMap.set(txMap, "user3", "Charlie")
|
|
36
|
-
*
|
|
37
|
-
* console.log(user) // Option.some("Alice")
|
|
36
|
+
* yield* TxHashMap.get(txMap, "user1") // => Option.some("Alice")
|
|
38
37
|
*
|
|
39
38
|
* // Multi-step atomic operations
|
|
40
39
|
* yield* Effect.tx(
|
|
@@ -47,9 +46,10 @@ declare const TypeId = "~effect/transactions/TxHashMap";
|
|
|
47
46
|
* })
|
|
48
47
|
* )
|
|
49
48
|
*
|
|
50
|
-
*
|
|
51
|
-
* console.log(size) // 2
|
|
49
|
+
* return yield* TxHashMap.size(txMap)
|
|
52
50
|
* })
|
|
51
|
+
*
|
|
52
|
+
* await Effect.runPromise(program) // => 2
|
|
53
53
|
* ```
|
|
54
54
|
*
|
|
55
55
|
* @category models
|
|
@@ -65,8 +65,8 @@ export interface TxHashMap<in out K, in out V> extends Inspectable, Pipeable {
|
|
|
65
65
|
*
|
|
66
66
|
* **Example** (Reusing extracted TxHashMap types)
|
|
67
67
|
*
|
|
68
|
-
* ```ts
|
|
69
|
-
* import { Effect, TxHashMap } from "effect"
|
|
68
|
+
* ```ts import.meta.vitest
|
|
69
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
70
70
|
*
|
|
71
71
|
* const program = Effect.gen(function*() {
|
|
72
72
|
* // Create a transactional inventory map
|
|
@@ -89,7 +89,10 @@ export interface TxHashMap<in out K, in out V> extends Inspectable, Pipeable {
|
|
|
89
89
|
* )
|
|
90
90
|
*
|
|
91
91
|
* yield* updateStock("laptop", 3)
|
|
92
|
+
* return yield* TxHashMap.get(inventory, "laptop")
|
|
92
93
|
* })
|
|
94
|
+
*
|
|
95
|
+
* await Effect.runPromise(program) // => Option.some({ stock: 3, price: 999 })
|
|
93
96
|
* ```
|
|
94
97
|
*
|
|
95
98
|
* @since 4.0.0
|
|
@@ -100,8 +103,8 @@ export declare namespace TxHashMap {
|
|
|
100
103
|
*
|
|
101
104
|
* **Example** (Extracting key types)
|
|
102
105
|
*
|
|
103
|
-
* ```ts
|
|
104
|
-
* import { Effect, TxHashMap } from "effect"
|
|
106
|
+
* ```ts import.meta.vitest
|
|
107
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
105
108
|
*
|
|
106
109
|
* const program = Effect.gen(function*() {
|
|
107
110
|
* // Create a user map to extract key type from
|
|
@@ -115,8 +118,10 @@ export declare namespace TxHashMap {
|
|
|
115
118
|
*
|
|
116
119
|
* // Use the extracted type in functions
|
|
117
120
|
* const getUserById = (id: UserKey) => TxHashMap.get(userMap, id)
|
|
118
|
-
*
|
|
121
|
+
* return yield* getUserById("alice")
|
|
119
122
|
* })
|
|
123
|
+
*
|
|
124
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Alice", age: 30 })
|
|
120
125
|
* ```
|
|
121
126
|
*
|
|
122
127
|
* @category utility types
|
|
@@ -128,8 +133,8 @@ export declare namespace TxHashMap {
|
|
|
128
133
|
*
|
|
129
134
|
* **Example** (Extracting value types)
|
|
130
135
|
*
|
|
131
|
-
* ```ts
|
|
132
|
-
* import { Effect, TxHashMap } from "effect"
|
|
136
|
+
* ```ts import.meta.vitest
|
|
137
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
133
138
|
*
|
|
134
139
|
* const program = Effect.gen(function*() {
|
|
135
140
|
* // Create a product catalog TxHashMap
|
|
@@ -146,9 +151,10 @@ export declare namespace TxHashMap {
|
|
|
146
151
|
* return `${product.category}: $${product.price}`
|
|
147
152
|
* }
|
|
148
153
|
*
|
|
149
|
-
*
|
|
150
|
-
* // laptop has type Option<Product> thanks to type extraction
|
|
154
|
+
* return Option.map(yield* TxHashMap.get(catalog, "laptop"), processProduct)
|
|
151
155
|
* })
|
|
156
|
+
*
|
|
157
|
+
* await Effect.runPromise(program) // => Option.some("electronics: $999")
|
|
152
158
|
* ```
|
|
153
159
|
*
|
|
154
160
|
* @category utility types
|
|
@@ -160,7 +166,7 @@ export declare namespace TxHashMap {
|
|
|
160
166
|
*
|
|
161
167
|
* **Example** (Extracting entry types)
|
|
162
168
|
*
|
|
163
|
-
* ```ts
|
|
169
|
+
* ```ts import.meta.vitest
|
|
164
170
|
* import { Effect, TxHashMap } from "effect"
|
|
165
171
|
*
|
|
166
172
|
* const program = Effect.gen(function*() {
|
|
@@ -180,10 +186,10 @@ export declare namespace TxHashMap {
|
|
|
180
186
|
* }
|
|
181
187
|
*
|
|
182
188
|
* // Get all entries and process them
|
|
183
|
-
*
|
|
184
|
-
* const configLines = entries.map(processEntry)
|
|
185
|
-
* console.log(configLines) // ["api_url=https://api.example.com", ...]
|
|
189
|
+
* return (yield* TxHashMap.entries(config)).map(processEntry).sort()
|
|
186
190
|
* })
|
|
191
|
+
*
|
|
192
|
+
* await Effect.runPromise(program) // => ["api_url=https://api.example.com", "retries=3", "timeout=5000"]
|
|
187
193
|
* ```
|
|
188
194
|
*
|
|
189
195
|
* @category utility types
|
|
@@ -196,7 +202,7 @@ export declare namespace TxHashMap {
|
|
|
196
202
|
*
|
|
197
203
|
* **Example** (Creating an empty map)
|
|
198
204
|
*
|
|
199
|
-
* ```ts
|
|
205
|
+
* ```ts import.meta.vitest
|
|
200
206
|
* import { Effect, TxHashMap } from "effect"
|
|
201
207
|
*
|
|
202
208
|
* const program = Effect.gen(function*() {
|
|
@@ -204,17 +210,15 @@ export declare namespace TxHashMap {
|
|
|
204
210
|
* const emptyMap = yield* TxHashMap.empty<string, number>()
|
|
205
211
|
*
|
|
206
212
|
* // Verify it's empty
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* const size = yield* TxHashMap.size(emptyMap)
|
|
211
|
-
* console.log(size) // 0
|
|
213
|
+
* yield* TxHashMap.isEmpty(emptyMap) // => true
|
|
214
|
+
* yield* TxHashMap.size(emptyMap) // => 0
|
|
212
215
|
*
|
|
213
216
|
* // Start adding elements
|
|
214
217
|
* yield* TxHashMap.set(emptyMap, "first", 1)
|
|
215
|
-
*
|
|
216
|
-
* console.log(newSize) // 1
|
|
218
|
+
* return yield* TxHashMap.size(emptyMap)
|
|
217
219
|
* })
|
|
220
|
+
*
|
|
221
|
+
* await Effect.runPromise(program) // => 1
|
|
218
222
|
* ```
|
|
219
223
|
*
|
|
220
224
|
* @category constructors
|
|
@@ -226,8 +230,8 @@ export declare const empty: <K, V>() => Effect.Effect<TxHashMap<K, V>>;
|
|
|
226
230
|
*
|
|
227
231
|
* **Example** (Creating a map from entries)
|
|
228
232
|
*
|
|
229
|
-
* ```ts
|
|
230
|
-
* import { Effect, TxHashMap } from "effect"
|
|
233
|
+
* ```ts import.meta.vitest
|
|
234
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
231
235
|
*
|
|
232
236
|
* const program = Effect.gen(function*() {
|
|
233
237
|
* // Create a user directory
|
|
@@ -238,16 +242,14 @@ export declare const empty: <K, V>() => Effect.Effect<TxHashMap<K, V>>;
|
|
|
238
242
|
* )
|
|
239
243
|
*
|
|
240
244
|
* // Check the initial size
|
|
241
|
-
*
|
|
242
|
-
* console.log(size) // 3
|
|
245
|
+
* yield* TxHashMap.size(userMap) // => 3
|
|
243
246
|
*
|
|
244
247
|
* // Access users
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* const nonExistent = yield* TxHashMap.get(userMap, "david")
|
|
249
|
-
* console.log(nonExistent) // Option.none()
|
|
248
|
+
* yield* TxHashMap.get(userMap, "alice") // => Option.some({ name: "Alice Smith", role: "admin" })
|
|
249
|
+
* return yield* TxHashMap.get(userMap, "david")
|
|
250
250
|
* })
|
|
251
|
+
*
|
|
252
|
+
* await Effect.runPromise(program) // => Option.none()
|
|
251
253
|
* ```
|
|
252
254
|
*
|
|
253
255
|
* @category constructors
|
|
@@ -259,8 +261,8 @@ export declare const make: <K, V>(...entries: Array<readonly [K, V]>) => Effect.
|
|
|
259
261
|
*
|
|
260
262
|
* **Example** (Creating a map from an iterable)
|
|
261
263
|
*
|
|
262
|
-
* ```ts
|
|
263
|
-
* import { Effect, TxHashMap } from "effect"
|
|
264
|
+
* ```ts import.meta.vitest
|
|
265
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
264
266
|
*
|
|
265
267
|
* const program = Effect.gen(function*() {
|
|
266
268
|
* // Create from various iterable sources
|
|
@@ -274,16 +276,15 @@ export declare const make: <K, V>(...entries: Array<readonly [K, V]>) => Effect.
|
|
|
274
276
|
* const configMap = yield* TxHashMap.fromIterable(configEntries)
|
|
275
277
|
*
|
|
276
278
|
* // Verify the configuration was loaded
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
* const dbHost = yield* TxHashMap.get(configMap, "database.host")
|
|
281
|
-
* console.log(dbHost) // Option.some("localhost")
|
|
279
|
+
* yield* TxHashMap.size(configMap) // => 4
|
|
280
|
+
* yield* TxHashMap.get(configMap, "database.host") // => Option.some("localhost")
|
|
282
281
|
*
|
|
283
282
|
* // Can also create from Map, Set of tuples, etc.
|
|
284
283
|
* const jsMap = new Map([["key1", "value1"], ["key2", "value2"]])
|
|
285
|
-
*
|
|
284
|
+
* return yield* TxHashMap.fromIterable(jsMap)
|
|
286
285
|
* })
|
|
286
|
+
*
|
|
287
|
+
* await Effect.runPromise(program)
|
|
287
288
|
* ```
|
|
288
289
|
*
|
|
289
290
|
* @category constructors
|
|
@@ -295,7 +296,7 @@ export declare const fromIterable: <K, V>(entries: Iterable<readonly [K, V]>) =>
|
|
|
295
296
|
*
|
|
296
297
|
* **Example** (Looking up values safely)
|
|
297
298
|
*
|
|
298
|
-
* ```ts
|
|
299
|
+
* ```ts import.meta.vitest
|
|
299
300
|
* import { Effect, Option, TxHashMap } from "effect"
|
|
300
301
|
*
|
|
301
302
|
* const program = Effect.gen(function*() {
|
|
@@ -305,18 +306,14 @@ export declare const fromIterable: <K, V>(entries: Iterable<readonly [K, V]>) =>
|
|
|
305
306
|
* )
|
|
306
307
|
*
|
|
307
308
|
* // Safe lookup - returns Option
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
* const nonExistent = yield* TxHashMap.get(userMap, "charlie")
|
|
312
|
-
* console.log(nonExistent) // Option.none()
|
|
309
|
+
* yield* TxHashMap.get(userMap, "alice") // => Option.some({ name: "Alice", role: "admin" })
|
|
310
|
+
* yield* TxHashMap.get(userMap, "charlie") // => Option.none()
|
|
313
311
|
*
|
|
314
312
|
* // Use with pipe syntax for type-safe access
|
|
315
|
-
*
|
|
316
|
-
* if (bobRole._tag === "Some") {
|
|
317
|
-
* console.log(bobRole.value.role) // "user"
|
|
318
|
-
* }
|
|
313
|
+
* return yield* TxHashMap.get(userMap, "bob")
|
|
319
314
|
* })
|
|
315
|
+
*
|
|
316
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Bob", role: "user" })
|
|
320
317
|
* ```
|
|
321
318
|
*
|
|
322
319
|
* @category combinators
|
|
@@ -328,7 +325,7 @@ export declare const get: {
|
|
|
328
325
|
*
|
|
329
326
|
* **Example** (Looking up values safely)
|
|
330
327
|
*
|
|
331
|
-
* ```ts
|
|
328
|
+
* ```ts import.meta.vitest
|
|
332
329
|
* import { Effect, Option, TxHashMap } from "effect"
|
|
333
330
|
*
|
|
334
331
|
* const program = Effect.gen(function*() {
|
|
@@ -338,18 +335,14 @@ export declare const get: {
|
|
|
338
335
|
* )
|
|
339
336
|
*
|
|
340
337
|
* // Safe lookup - returns Option
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
* const nonExistent = yield* TxHashMap.get(userMap, "charlie")
|
|
345
|
-
* console.log(nonExistent) // Option.none()
|
|
338
|
+
* yield* TxHashMap.get(userMap, "alice") // => Option.some({ name: "Alice", role: "admin" })
|
|
339
|
+
* yield* TxHashMap.get(userMap, "charlie") // => Option.none()
|
|
346
340
|
*
|
|
347
341
|
* // Use with pipe syntax for type-safe access
|
|
348
|
-
*
|
|
349
|
-
* if (bobRole._tag === "Some") {
|
|
350
|
-
* console.log(bobRole.value.role) // "user"
|
|
351
|
-
* }
|
|
342
|
+
* return yield* TxHashMap.get(userMap, "bob")
|
|
352
343
|
* })
|
|
344
|
+
*
|
|
345
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Bob", role: "user" })
|
|
353
346
|
* ```
|
|
354
347
|
*
|
|
355
348
|
* @category combinators
|
|
@@ -361,7 +354,7 @@ export declare const get: {
|
|
|
361
354
|
*
|
|
362
355
|
* **Example** (Looking up values safely)
|
|
363
356
|
*
|
|
364
|
-
* ```ts
|
|
357
|
+
* ```ts import.meta.vitest
|
|
365
358
|
* import { Effect, Option, TxHashMap } from "effect"
|
|
366
359
|
*
|
|
367
360
|
* const program = Effect.gen(function*() {
|
|
@@ -371,18 +364,14 @@ export declare const get: {
|
|
|
371
364
|
* )
|
|
372
365
|
*
|
|
373
366
|
* // Safe lookup - returns Option
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
* const nonExistent = yield* TxHashMap.get(userMap, "charlie")
|
|
378
|
-
* console.log(nonExistent) // Option.none()
|
|
367
|
+
* yield* TxHashMap.get(userMap, "alice") // => Option.some({ name: "Alice", role: "admin" })
|
|
368
|
+
* yield* TxHashMap.get(userMap, "charlie") // => Option.none()
|
|
379
369
|
*
|
|
380
370
|
* // Use with pipe syntax for type-safe access
|
|
381
|
-
*
|
|
382
|
-
* if (bobRole._tag === "Some") {
|
|
383
|
-
* console.log(bobRole.value.role) // "user"
|
|
384
|
-
* }
|
|
371
|
+
* return yield* TxHashMap.get(userMap, "bob")
|
|
385
372
|
* })
|
|
373
|
+
*
|
|
374
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Bob", role: "user" })
|
|
386
375
|
* ```
|
|
387
376
|
*
|
|
388
377
|
* @category combinators
|
|
@@ -400,8 +389,8 @@ export declare const get: {
|
|
|
400
389
|
*
|
|
401
390
|
* **Example** (Setting values)
|
|
402
391
|
*
|
|
403
|
-
* ```ts
|
|
404
|
-
* import { Effect, TxHashMap } from "effect"
|
|
392
|
+
* ```ts import.meta.vitest
|
|
393
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
405
394
|
*
|
|
406
395
|
* const program = Effect.gen(function*() {
|
|
407
396
|
* const inventory = yield* TxHashMap.make(
|
|
@@ -411,17 +400,18 @@ export declare const get: {
|
|
|
411
400
|
*
|
|
412
401
|
* // Update existing item
|
|
413
402
|
* yield* TxHashMap.set(inventory, "laptop", 3)
|
|
414
|
-
*
|
|
415
|
-
* console.log(laptopStock) // Option.some(3)
|
|
403
|
+
* yield* TxHashMap.get(inventory, "laptop") // => Option.some(3)
|
|
416
404
|
*
|
|
417
405
|
* // Add new item
|
|
418
406
|
* yield* TxHashMap.set(inventory, "keyboard", 15)
|
|
419
|
-
*
|
|
420
|
-
* console.log(keyboardStock) // Option.some(15)
|
|
407
|
+
* yield* TxHashMap.get(inventory, "keyboard") // => Option.some(15)
|
|
421
408
|
*
|
|
422
409
|
* // Use with pipe syntax
|
|
423
410
|
* yield* TxHashMap.set("tablet", 8)(inventory)
|
|
411
|
+
* return yield* TxHashMap.get(inventory, "tablet")
|
|
424
412
|
* })
|
|
413
|
+
*
|
|
414
|
+
* await Effect.runPromise(program) // => Option.some(8)
|
|
425
415
|
* ```
|
|
426
416
|
*
|
|
427
417
|
* @category combinators
|
|
@@ -438,8 +428,8 @@ export declare const set: {
|
|
|
438
428
|
*
|
|
439
429
|
* **Example** (Setting values)
|
|
440
430
|
*
|
|
441
|
-
* ```ts
|
|
442
|
-
* import { Effect, TxHashMap } from "effect"
|
|
431
|
+
* ```ts import.meta.vitest
|
|
432
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
443
433
|
*
|
|
444
434
|
* const program = Effect.gen(function*() {
|
|
445
435
|
* const inventory = yield* TxHashMap.make(
|
|
@@ -449,17 +439,18 @@ export declare const set: {
|
|
|
449
439
|
*
|
|
450
440
|
* // Update existing item
|
|
451
441
|
* yield* TxHashMap.set(inventory, "laptop", 3)
|
|
452
|
-
*
|
|
453
|
-
* console.log(laptopStock) // Option.some(3)
|
|
442
|
+
* yield* TxHashMap.get(inventory, "laptop") // => Option.some(3)
|
|
454
443
|
*
|
|
455
444
|
* // Add new item
|
|
456
445
|
* yield* TxHashMap.set(inventory, "keyboard", 15)
|
|
457
|
-
*
|
|
458
|
-
* console.log(keyboardStock) // Option.some(15)
|
|
446
|
+
* yield* TxHashMap.get(inventory, "keyboard") // => Option.some(15)
|
|
459
447
|
*
|
|
460
448
|
* // Use with pipe syntax
|
|
461
449
|
* yield* TxHashMap.set("tablet", 8)(inventory)
|
|
450
|
+
* return yield* TxHashMap.get(inventory, "tablet")
|
|
462
451
|
* })
|
|
452
|
+
*
|
|
453
|
+
* await Effect.runPromise(program) // => Option.some(8)
|
|
463
454
|
* ```
|
|
464
455
|
*
|
|
465
456
|
* @category combinators
|
|
@@ -476,8 +467,8 @@ export declare const set: {
|
|
|
476
467
|
*
|
|
477
468
|
* **Example** (Setting values)
|
|
478
469
|
*
|
|
479
|
-
* ```ts
|
|
480
|
-
* import { Effect, TxHashMap } from "effect"
|
|
470
|
+
* ```ts import.meta.vitest
|
|
471
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
481
472
|
*
|
|
482
473
|
* const program = Effect.gen(function*() {
|
|
483
474
|
* const inventory = yield* TxHashMap.make(
|
|
@@ -487,17 +478,18 @@ export declare const set: {
|
|
|
487
478
|
*
|
|
488
479
|
* // Update existing item
|
|
489
480
|
* yield* TxHashMap.set(inventory, "laptop", 3)
|
|
490
|
-
*
|
|
491
|
-
* console.log(laptopStock) // Option.some(3)
|
|
481
|
+
* yield* TxHashMap.get(inventory, "laptop") // => Option.some(3)
|
|
492
482
|
*
|
|
493
483
|
* // Add new item
|
|
494
484
|
* yield* TxHashMap.set(inventory, "keyboard", 15)
|
|
495
|
-
*
|
|
496
|
-
* console.log(keyboardStock) // Option.some(15)
|
|
485
|
+
* yield* TxHashMap.get(inventory, "keyboard") // => Option.some(15)
|
|
497
486
|
*
|
|
498
487
|
* // Use with pipe syntax
|
|
499
488
|
* yield* TxHashMap.set("tablet", 8)(inventory)
|
|
489
|
+
* return yield* TxHashMap.get(inventory, "tablet")
|
|
500
490
|
* })
|
|
491
|
+
*
|
|
492
|
+
* await Effect.runPromise(program) // => Option.some(8)
|
|
501
493
|
* ```
|
|
502
494
|
*
|
|
503
495
|
* @category combinators
|
|
@@ -510,7 +502,7 @@ export declare const set: {
|
|
|
510
502
|
*
|
|
511
503
|
* **Example** (Checking for keys)
|
|
512
504
|
*
|
|
513
|
-
* ```ts
|
|
505
|
+
* ```ts import.meta.vitest
|
|
514
506
|
* import { Effect, TxHashMap } from "effect"
|
|
515
507
|
*
|
|
516
508
|
* const program = Effect.gen(function*() {
|
|
@@ -521,19 +513,17 @@ export declare const set: {
|
|
|
521
513
|
* )
|
|
522
514
|
*
|
|
523
515
|
* // Check if users exist
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
* const hasDavid = yield* TxHashMap.has(permissions, "david")
|
|
528
|
-
* console.log(hasDavid) // false
|
|
516
|
+
* yield* TxHashMap.has(permissions, "alice") // => true
|
|
517
|
+
* yield* TxHashMap.has(permissions, "david") // => false
|
|
529
518
|
*
|
|
530
519
|
* // Use direct method call for type-safe access
|
|
531
|
-
*
|
|
532
|
-
* console.log(hasBob) // true
|
|
520
|
+
* return yield* TxHashMap.has(permissions, "bob")
|
|
533
521
|
* })
|
|
522
|
+
*
|
|
523
|
+
* await Effect.runPromise(program) // => true
|
|
534
524
|
* ```
|
|
535
525
|
*
|
|
536
|
-
* @category
|
|
526
|
+
* @category predicates
|
|
537
527
|
* @since 2.0.0
|
|
538
528
|
*/
|
|
539
529
|
export declare const has: {
|
|
@@ -542,7 +532,7 @@ export declare const has: {
|
|
|
542
532
|
*
|
|
543
533
|
* **Example** (Checking for keys)
|
|
544
534
|
*
|
|
545
|
-
* ```ts
|
|
535
|
+
* ```ts import.meta.vitest
|
|
546
536
|
* import { Effect, TxHashMap } from "effect"
|
|
547
537
|
*
|
|
548
538
|
* const program = Effect.gen(function*() {
|
|
@@ -553,19 +543,17 @@ export declare const has: {
|
|
|
553
543
|
* )
|
|
554
544
|
*
|
|
555
545
|
* // Check if users exist
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
* const hasDavid = yield* TxHashMap.has(permissions, "david")
|
|
560
|
-
* console.log(hasDavid) // false
|
|
546
|
+
* yield* TxHashMap.has(permissions, "alice") // => true
|
|
547
|
+
* yield* TxHashMap.has(permissions, "david") // => false
|
|
561
548
|
*
|
|
562
549
|
* // Use direct method call for type-safe access
|
|
563
|
-
*
|
|
564
|
-
* console.log(hasBob) // true
|
|
550
|
+
* return yield* TxHashMap.has(permissions, "bob")
|
|
565
551
|
* })
|
|
552
|
+
*
|
|
553
|
+
* await Effect.runPromise(program) // => true
|
|
566
554
|
* ```
|
|
567
555
|
*
|
|
568
|
-
* @category
|
|
556
|
+
* @category predicates
|
|
569
557
|
* @since 2.0.0
|
|
570
558
|
*/
|
|
571
559
|
<K1 extends K, K>(key: K1): <V>(self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -574,7 +562,7 @@ export declare const has: {
|
|
|
574
562
|
*
|
|
575
563
|
* **Example** (Checking for keys)
|
|
576
564
|
*
|
|
577
|
-
* ```ts
|
|
565
|
+
* ```ts import.meta.vitest
|
|
578
566
|
* import { Effect, TxHashMap } from "effect"
|
|
579
567
|
*
|
|
580
568
|
* const program = Effect.gen(function*() {
|
|
@@ -585,19 +573,17 @@ export declare const has: {
|
|
|
585
573
|
* )
|
|
586
574
|
*
|
|
587
575
|
* // Check if users exist
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
* const hasDavid = yield* TxHashMap.has(permissions, "david")
|
|
592
|
-
* console.log(hasDavid) // false
|
|
576
|
+
* yield* TxHashMap.has(permissions, "alice") // => true
|
|
577
|
+
* yield* TxHashMap.has(permissions, "david") // => false
|
|
593
578
|
*
|
|
594
579
|
* // Use direct method call for type-safe access
|
|
595
|
-
*
|
|
596
|
-
* console.log(hasBob) // true
|
|
580
|
+
* return yield* TxHashMap.has(permissions, "bob")
|
|
597
581
|
* })
|
|
582
|
+
*
|
|
583
|
+
* await Effect.runPromise(program) // => true
|
|
598
584
|
* ```
|
|
599
585
|
*
|
|
600
|
-
* @category
|
|
586
|
+
* @category predicates
|
|
601
587
|
* @since 2.0.0
|
|
602
588
|
*/
|
|
603
589
|
<K1 extends K, K, V>(self: TxHashMap<K, V>, key: K1): Effect.Effect<boolean>;
|
|
@@ -612,7 +598,7 @@ export declare const has: {
|
|
|
612
598
|
*
|
|
613
599
|
* **Example** (Removing keys)
|
|
614
600
|
*
|
|
615
|
-
* ```ts
|
|
601
|
+
* ```ts import.meta.vitest
|
|
616
602
|
* import { Effect, TxHashMap } from "effect"
|
|
617
603
|
*
|
|
618
604
|
* const program = Effect.gen(function*() {
|
|
@@ -623,20 +609,17 @@ export declare const has: {
|
|
|
623
609
|
* )
|
|
624
610
|
*
|
|
625
611
|
* // Remove expired user
|
|
626
|
-
*
|
|
627
|
-
* console.log(removed) // true (key existed and was removed)
|
|
612
|
+
* yield* TxHashMap.remove(cache, "user:3") // => true
|
|
628
613
|
*
|
|
629
614
|
* // Try to remove non-existent key
|
|
630
|
-
*
|
|
631
|
-
* console.log(notRemoved) // false (key didn't exist)
|
|
615
|
+
* yield* TxHashMap.remove(cache, "user:999") // => false
|
|
632
616
|
*
|
|
633
617
|
* // Verify removal
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
* const size = yield* TxHashMap.size(cache)
|
|
638
|
-
* console.log(size) // 2
|
|
618
|
+
* yield* TxHashMap.has(cache, "user:3") // => false
|
|
619
|
+
* return yield* TxHashMap.size(cache)
|
|
639
620
|
* })
|
|
621
|
+
*
|
|
622
|
+
* await Effect.runPromise(program) // => 2
|
|
640
623
|
* ```
|
|
641
624
|
*
|
|
642
625
|
* @category combinators
|
|
@@ -653,7 +636,7 @@ export declare const remove: {
|
|
|
653
636
|
*
|
|
654
637
|
* **Example** (Removing keys)
|
|
655
638
|
*
|
|
656
|
-
* ```ts
|
|
639
|
+
* ```ts import.meta.vitest
|
|
657
640
|
* import { Effect, TxHashMap } from "effect"
|
|
658
641
|
*
|
|
659
642
|
* const program = Effect.gen(function*() {
|
|
@@ -664,20 +647,17 @@ export declare const remove: {
|
|
|
664
647
|
* )
|
|
665
648
|
*
|
|
666
649
|
* // Remove expired user
|
|
667
|
-
*
|
|
668
|
-
* console.log(removed) // true (key existed and was removed)
|
|
650
|
+
* yield* TxHashMap.remove(cache, "user:3") // => true
|
|
669
651
|
*
|
|
670
652
|
* // Try to remove non-existent key
|
|
671
|
-
*
|
|
672
|
-
* console.log(notRemoved) // false (key didn't exist)
|
|
653
|
+
* yield* TxHashMap.remove(cache, "user:999") // => false
|
|
673
654
|
*
|
|
674
655
|
* // Verify removal
|
|
675
|
-
*
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
* const size = yield* TxHashMap.size(cache)
|
|
679
|
-
* console.log(size) // 2
|
|
656
|
+
* yield* TxHashMap.has(cache, "user:3") // => false
|
|
657
|
+
* return yield* TxHashMap.size(cache)
|
|
680
658
|
* })
|
|
659
|
+
*
|
|
660
|
+
* await Effect.runPromise(program) // => 2
|
|
681
661
|
* ```
|
|
682
662
|
*
|
|
683
663
|
* @category combinators
|
|
@@ -694,7 +674,7 @@ export declare const remove: {
|
|
|
694
674
|
*
|
|
695
675
|
* **Example** (Removing keys)
|
|
696
676
|
*
|
|
697
|
-
* ```ts
|
|
677
|
+
* ```ts import.meta.vitest
|
|
698
678
|
* import { Effect, TxHashMap } from "effect"
|
|
699
679
|
*
|
|
700
680
|
* const program = Effect.gen(function*() {
|
|
@@ -705,20 +685,17 @@ export declare const remove: {
|
|
|
705
685
|
* )
|
|
706
686
|
*
|
|
707
687
|
* // Remove expired user
|
|
708
|
-
*
|
|
709
|
-
* console.log(removed) // true (key existed and was removed)
|
|
688
|
+
* yield* TxHashMap.remove(cache, "user:3") // => true
|
|
710
689
|
*
|
|
711
690
|
* // Try to remove non-existent key
|
|
712
|
-
*
|
|
713
|
-
* console.log(notRemoved) // false (key didn't exist)
|
|
691
|
+
* yield* TxHashMap.remove(cache, "user:999") // => false
|
|
714
692
|
*
|
|
715
693
|
* // Verify removal
|
|
716
|
-
*
|
|
717
|
-
*
|
|
718
|
-
*
|
|
719
|
-
* const size = yield* TxHashMap.size(cache)
|
|
720
|
-
* console.log(size) // 2
|
|
694
|
+
* yield* TxHashMap.has(cache, "user:3") // => false
|
|
695
|
+
* return yield* TxHashMap.size(cache)
|
|
721
696
|
* })
|
|
697
|
+
*
|
|
698
|
+
* await Effect.runPromise(program) // => 2
|
|
722
699
|
* ```
|
|
723
700
|
*
|
|
724
701
|
* @category combinators
|
|
@@ -736,7 +713,7 @@ export declare const remove: {
|
|
|
736
713
|
*
|
|
737
714
|
* **Example** (Clearing all entries)
|
|
738
715
|
*
|
|
739
|
-
* ```ts
|
|
716
|
+
* ```ts import.meta.vitest
|
|
740
717
|
* import { Effect, TxHashMap } from "effect"
|
|
741
718
|
*
|
|
742
719
|
* const program = Effect.gen(function*() {
|
|
@@ -747,19 +724,17 @@ export declare const remove: {
|
|
|
747
724
|
* )
|
|
748
725
|
*
|
|
749
726
|
* // Check initial state
|
|
750
|
-
*
|
|
751
|
-
* console.log(initialSize) // 3
|
|
727
|
+
* yield* TxHashMap.size(sessionMap) // => 3
|
|
752
728
|
*
|
|
753
729
|
* // Clear all sessions (e.g., during maintenance)
|
|
754
730
|
* yield* TxHashMap.clear(sessionMap)
|
|
755
731
|
*
|
|
756
732
|
* // Verify cleared
|
|
757
|
-
*
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
* const isEmpty = yield* TxHashMap.isEmpty(sessionMap)
|
|
761
|
-
* console.log(isEmpty) // true
|
|
733
|
+
* yield* TxHashMap.size(sessionMap) // => 0
|
|
734
|
+
* return yield* TxHashMap.isEmpty(sessionMap)
|
|
762
735
|
* })
|
|
736
|
+
*
|
|
737
|
+
* await Effect.runPromise(program) // => true
|
|
763
738
|
* ```
|
|
764
739
|
*
|
|
765
740
|
* @category combinators
|
|
@@ -771,7 +746,7 @@ export declare const clear: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<void>
|
|
|
771
746
|
*
|
|
772
747
|
* **Example** (Counting entries)
|
|
773
748
|
*
|
|
774
|
-
* ```ts
|
|
749
|
+
* ```ts import.meta.vitest
|
|
775
750
|
* import { Effect, TxHashMap } from "effect"
|
|
776
751
|
*
|
|
777
752
|
* const program = Effect.gen(function*() {
|
|
@@ -781,19 +756,18 @@ export declare const clear: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<void>
|
|
|
781
756
|
* ["users", 50]
|
|
782
757
|
* )
|
|
783
758
|
*
|
|
784
|
-
*
|
|
785
|
-
* console.log(count) // 3
|
|
759
|
+
* yield* TxHashMap.size(metrics) // => 3
|
|
786
760
|
*
|
|
787
761
|
* // Add more metrics
|
|
788
762
|
* yield* TxHashMap.set(metrics, "response_time", 250)
|
|
789
|
-
*
|
|
790
|
-
* console.log(newCount) // 4
|
|
763
|
+
* yield* TxHashMap.size(metrics) // => 4
|
|
791
764
|
*
|
|
792
765
|
* // Remove a metric
|
|
793
766
|
* yield* TxHashMap.remove(metrics, "errors")
|
|
794
|
-
*
|
|
795
|
-
* console.log(finalCount) // 3
|
|
767
|
+
* return yield* TxHashMap.size(metrics)
|
|
796
768
|
* })
|
|
769
|
+
*
|
|
770
|
+
* await Effect.runPromise(program) // => 3
|
|
797
771
|
* ```
|
|
798
772
|
*
|
|
799
773
|
* @category combinators
|
|
@@ -805,28 +779,27 @@ export declare const size: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<number
|
|
|
805
779
|
*
|
|
806
780
|
* **Example** (Checking for an empty map)
|
|
807
781
|
*
|
|
808
|
-
* ```ts
|
|
782
|
+
* ```ts import.meta.vitest
|
|
809
783
|
* import { Effect, TxHashMap } from "effect"
|
|
810
784
|
*
|
|
811
785
|
* const program = Effect.gen(function*() {
|
|
812
786
|
* // Start with empty map
|
|
813
787
|
* const cache = yield* TxHashMap.empty<string, any>()
|
|
814
|
-
*
|
|
815
|
-
* console.log(empty) // true
|
|
788
|
+
* yield* TxHashMap.isEmpty(cache) // => true
|
|
816
789
|
*
|
|
817
790
|
* // Add an item
|
|
818
791
|
* yield* TxHashMap.set(cache, "key1", "value1")
|
|
819
|
-
*
|
|
820
|
-
* console.log(stillEmpty) // false
|
|
792
|
+
* yield* TxHashMap.isEmpty(cache) // => false
|
|
821
793
|
*
|
|
822
794
|
* // Clear and check again
|
|
823
795
|
* yield* TxHashMap.clear(cache)
|
|
824
|
-
*
|
|
825
|
-
* console.log(emptyAgain) // true
|
|
796
|
+
* return yield* TxHashMap.isEmpty(cache)
|
|
826
797
|
* })
|
|
798
|
+
*
|
|
799
|
+
* await Effect.runPromise(program) // => true
|
|
827
800
|
* ```
|
|
828
801
|
*
|
|
829
|
-
* @category
|
|
802
|
+
* @category predicates
|
|
830
803
|
* @since 2.0.0
|
|
831
804
|
*/
|
|
832
805
|
export declare const isEmpty: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -835,23 +808,23 @@ export declare const isEmpty: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<boo
|
|
|
835
808
|
*
|
|
836
809
|
* **Example** (Checking for a non-empty map)
|
|
837
810
|
*
|
|
838
|
-
* ```ts
|
|
811
|
+
* ```ts import.meta.vitest
|
|
839
812
|
* import { Effect, TxHashMap } from "effect"
|
|
840
813
|
*
|
|
841
814
|
* const program = Effect.gen(function*() {
|
|
842
815
|
* const inventory = yield* TxHashMap.make(["laptop", 5])
|
|
843
816
|
*
|
|
844
|
-
*
|
|
845
|
-
* console.log(hasItems) // true
|
|
817
|
+
* yield* TxHashMap.isNonEmpty(inventory) // => true
|
|
846
818
|
*
|
|
847
819
|
* // Clear inventory
|
|
848
820
|
* yield* TxHashMap.clear(inventory)
|
|
849
|
-
*
|
|
850
|
-
* console.log(stillHasItems) // false
|
|
821
|
+
* return yield* TxHashMap.isNonEmpty(inventory)
|
|
851
822
|
* })
|
|
823
|
+
*
|
|
824
|
+
* await Effect.runPromise(program) // => false
|
|
852
825
|
* ```
|
|
853
826
|
*
|
|
854
|
-
* @category
|
|
827
|
+
* @category predicates
|
|
855
828
|
* @since 4.0.0
|
|
856
829
|
*/
|
|
857
830
|
export declare const isNonEmpty: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -865,8 +838,8 @@ export declare const isNonEmpty: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<
|
|
|
865
838
|
*
|
|
866
839
|
* **Example** (Updating existing values)
|
|
867
840
|
*
|
|
868
|
-
* ```ts
|
|
869
|
-
* import { Effect, TxHashMap } from "effect"
|
|
841
|
+
* ```ts import.meta.vitest
|
|
842
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
870
843
|
*
|
|
871
844
|
* const program = Effect.gen(function*() {
|
|
872
845
|
* const counters = yield* TxHashMap.make(
|
|
@@ -880,10 +853,9 @@ export declare const isNonEmpty: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<
|
|
|
880
853
|
* "downloads",
|
|
881
854
|
* (count) => count + 1
|
|
882
855
|
* )
|
|
883
|
-
*
|
|
856
|
+
* oldDownloads // => Option.some(100)
|
|
884
857
|
*
|
|
885
|
-
*
|
|
886
|
-
* console.log(newDownloads) // Option.some(101)
|
|
858
|
+
* yield* TxHashMap.get(counters, "downloads") // => Option.some(101)
|
|
887
859
|
*
|
|
888
860
|
* // Try to modify non-existent key
|
|
889
861
|
* const nonExistent = yield* TxHashMap.modify(
|
|
@@ -891,11 +863,14 @@ export declare const isNonEmpty: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<
|
|
|
891
863
|
* "clicks",
|
|
892
864
|
* (count) => count + 1
|
|
893
865
|
* )
|
|
894
|
-
*
|
|
866
|
+
* nonExistent // => Option.none()
|
|
895
867
|
*
|
|
896
868
|
* // Update views counter with direct method call
|
|
897
869
|
* yield* TxHashMap.modify(counters, "views", (views) => views * 2)
|
|
870
|
+
* return yield* TxHashMap.get(counters, "views")
|
|
898
871
|
* })
|
|
872
|
+
*
|
|
873
|
+
* await Effect.runPromise(program) // => Option.some(500)
|
|
899
874
|
* ```
|
|
900
875
|
*
|
|
901
876
|
* @category combinators
|
|
@@ -912,8 +887,8 @@ export declare const modify: {
|
|
|
912
887
|
*
|
|
913
888
|
* **Example** (Updating existing values)
|
|
914
889
|
*
|
|
915
|
-
* ```ts
|
|
916
|
-
* import { Effect, TxHashMap } from "effect"
|
|
890
|
+
* ```ts import.meta.vitest
|
|
891
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
917
892
|
*
|
|
918
893
|
* const program = Effect.gen(function*() {
|
|
919
894
|
* const counters = yield* TxHashMap.make(
|
|
@@ -927,10 +902,9 @@ export declare const modify: {
|
|
|
927
902
|
* "downloads",
|
|
928
903
|
* (count) => count + 1
|
|
929
904
|
* )
|
|
930
|
-
*
|
|
905
|
+
* oldDownloads // => Option.some(100)
|
|
931
906
|
*
|
|
932
|
-
*
|
|
933
|
-
* console.log(newDownloads) // Option.some(101)
|
|
907
|
+
* yield* TxHashMap.get(counters, "downloads") // => Option.some(101)
|
|
934
908
|
*
|
|
935
909
|
* // Try to modify non-existent key
|
|
936
910
|
* const nonExistent = yield* TxHashMap.modify(
|
|
@@ -938,11 +912,14 @@ export declare const modify: {
|
|
|
938
912
|
* "clicks",
|
|
939
913
|
* (count) => count + 1
|
|
940
914
|
* )
|
|
941
|
-
*
|
|
915
|
+
* nonExistent // => Option.none()
|
|
942
916
|
*
|
|
943
917
|
* // Update views counter with direct method call
|
|
944
918
|
* yield* TxHashMap.modify(counters, "views", (views) => views * 2)
|
|
919
|
+
* return yield* TxHashMap.get(counters, "views")
|
|
945
920
|
* })
|
|
921
|
+
*
|
|
922
|
+
* await Effect.runPromise(program) // => Option.some(500)
|
|
946
923
|
* ```
|
|
947
924
|
*
|
|
948
925
|
* @category combinators
|
|
@@ -959,8 +936,8 @@ export declare const modify: {
|
|
|
959
936
|
*
|
|
960
937
|
* **Example** (Updating existing values)
|
|
961
938
|
*
|
|
962
|
-
* ```ts
|
|
963
|
-
* import { Effect, TxHashMap } from "effect"
|
|
939
|
+
* ```ts import.meta.vitest
|
|
940
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
964
941
|
*
|
|
965
942
|
* const program = Effect.gen(function*() {
|
|
966
943
|
* const counters = yield* TxHashMap.make(
|
|
@@ -974,10 +951,9 @@ export declare const modify: {
|
|
|
974
951
|
* "downloads",
|
|
975
952
|
* (count) => count + 1
|
|
976
953
|
* )
|
|
977
|
-
*
|
|
954
|
+
* oldDownloads // => Option.some(100)
|
|
978
955
|
*
|
|
979
|
-
*
|
|
980
|
-
* console.log(newDownloads) // Option.some(101)
|
|
956
|
+
* yield* TxHashMap.get(counters, "downloads") // => Option.some(101)
|
|
981
957
|
*
|
|
982
958
|
* // Try to modify non-existent key
|
|
983
959
|
* const nonExistent = yield* TxHashMap.modify(
|
|
@@ -985,11 +961,14 @@ export declare const modify: {
|
|
|
985
961
|
* "clicks",
|
|
986
962
|
* (count) => count + 1
|
|
987
963
|
* )
|
|
988
|
-
*
|
|
964
|
+
* nonExistent // => Option.none()
|
|
989
965
|
*
|
|
990
966
|
* // Update views counter with direct method call
|
|
991
967
|
* yield* TxHashMap.modify(counters, "views", (views) => views * 2)
|
|
968
|
+
* return yield* TxHashMap.get(counters, "views")
|
|
992
969
|
* })
|
|
970
|
+
*
|
|
971
|
+
* await Effect.runPromise(program) // => Option.some(500)
|
|
993
972
|
* ```
|
|
994
973
|
*
|
|
995
974
|
* @category combinators
|
|
@@ -1008,42 +987,34 @@ export declare const modify: {
|
|
|
1008
987
|
*
|
|
1009
988
|
* **Example** (Updating values with Option)
|
|
1010
989
|
*
|
|
1011
|
-
* ```ts
|
|
1012
|
-
* import { Effect, TxHashMap } from "effect"
|
|
990
|
+
* ```ts import.meta.vitest
|
|
991
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1013
992
|
*
|
|
1014
993
|
* const program = Effect.gen(function*() {
|
|
1015
994
|
* const storage = yield* TxHashMap.make<string, string | number>([
|
|
1016
995
|
* "file1.txt",
|
|
1017
996
|
* "content1"
|
|
1018
997
|
* ], ["access_count", 0])
|
|
998
|
+
* const increment = Option.map((value: string | number) => typeof value === "number" ? value + 1 : value)
|
|
1019
999
|
*
|
|
1020
1000
|
* // Increment existing counter
|
|
1021
|
-
* yield* TxHashMap.modifyAt(storage, "access_count",
|
|
1022
|
-
*
|
|
1023
|
-
* ? { ...current, value: current.value + 1 }
|
|
1024
|
-
* : current
|
|
1025
|
-
* )
|
|
1026
|
-
* const count1 = yield* TxHashMap.get(storage, "access_count")
|
|
1027
|
-
* console.log(count1) // Option.some(1)
|
|
1001
|
+
* yield* TxHashMap.modifyAt(storage, "access_count", increment)
|
|
1002
|
+
* yield* TxHashMap.get(storage, "access_count") // => Option.some(1)
|
|
1028
1003
|
*
|
|
1029
1004
|
* // Increment existing counter again
|
|
1030
|
-
* yield* TxHashMap.modifyAt(storage, "access_count",
|
|
1031
|
-
*
|
|
1032
|
-
* ? { ...current, value: current.value + 1 }
|
|
1033
|
-
* : current
|
|
1034
|
-
* )
|
|
1035
|
-
* const count2 = yield* TxHashMap.get(storage, "access_count")
|
|
1036
|
-
* console.log(count2) // Option.some(2)
|
|
1005
|
+
* yield* TxHashMap.modifyAt(storage, "access_count", increment)
|
|
1006
|
+
* yield* TxHashMap.get(storage, "access_count") // => Option.some(2)
|
|
1037
1007
|
*
|
|
1038
1008
|
* // Update an existing string entry
|
|
1039
|
-
* yield* TxHashMap.modifyAt(
|
|
1040
|
-
*
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1009
|
+
* yield* TxHashMap.modifyAt(
|
|
1010
|
+
* storage,
|
|
1011
|
+
* "file1.txt",
|
|
1012
|
+
* Option.map((value) => typeof value === "string" ? `${value}.bak` : value)
|
|
1043
1013
|
* )
|
|
1044
|
-
*
|
|
1045
|
-
* console.log(backup) // Option.some("content1.bak")
|
|
1014
|
+
* return yield* TxHashMap.get(storage, "file1.txt")
|
|
1046
1015
|
* })
|
|
1016
|
+
*
|
|
1017
|
+
* await Effect.runPromise(program) // => Option.some("content1.bak")
|
|
1047
1018
|
* ```
|
|
1048
1019
|
*
|
|
1049
1020
|
* @category combinators
|
|
@@ -1061,42 +1032,34 @@ export declare const modifyAt: {
|
|
|
1061
1032
|
*
|
|
1062
1033
|
* **Example** (Updating values with Option)
|
|
1063
1034
|
*
|
|
1064
|
-
* ```ts
|
|
1065
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1035
|
+
* ```ts import.meta.vitest
|
|
1036
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1066
1037
|
*
|
|
1067
1038
|
* const program = Effect.gen(function*() {
|
|
1068
1039
|
* const storage = yield* TxHashMap.make<string, string | number>([
|
|
1069
1040
|
* "file1.txt",
|
|
1070
1041
|
* "content1"
|
|
1071
1042
|
* ], ["access_count", 0])
|
|
1043
|
+
* const increment = Option.map((value: string | number) => typeof value === "number" ? value + 1 : value)
|
|
1072
1044
|
*
|
|
1073
1045
|
* // Increment existing counter
|
|
1074
|
-
* yield* TxHashMap.modifyAt(storage, "access_count",
|
|
1075
|
-
*
|
|
1076
|
-
* ? { ...current, value: current.value + 1 }
|
|
1077
|
-
* : current
|
|
1078
|
-
* )
|
|
1079
|
-
* const count1 = yield* TxHashMap.get(storage, "access_count")
|
|
1080
|
-
* console.log(count1) // Option.some(1)
|
|
1046
|
+
* yield* TxHashMap.modifyAt(storage, "access_count", increment)
|
|
1047
|
+
* yield* TxHashMap.get(storage, "access_count") // => Option.some(1)
|
|
1081
1048
|
*
|
|
1082
1049
|
* // Increment existing counter again
|
|
1083
|
-
* yield* TxHashMap.modifyAt(storage, "access_count",
|
|
1084
|
-
*
|
|
1085
|
-
* ? { ...current, value: current.value + 1 }
|
|
1086
|
-
* : current
|
|
1087
|
-
* )
|
|
1088
|
-
* const count2 = yield* TxHashMap.get(storage, "access_count")
|
|
1089
|
-
* console.log(count2) // Option.some(2)
|
|
1050
|
+
* yield* TxHashMap.modifyAt(storage, "access_count", increment)
|
|
1051
|
+
* yield* TxHashMap.get(storage, "access_count") // => Option.some(2)
|
|
1090
1052
|
*
|
|
1091
1053
|
* // Update an existing string entry
|
|
1092
|
-
* yield* TxHashMap.modifyAt(
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1054
|
+
* yield* TxHashMap.modifyAt(
|
|
1055
|
+
* storage,
|
|
1056
|
+
* "file1.txt",
|
|
1057
|
+
* Option.map((value) => typeof value === "string" ? `${value}.bak` : value)
|
|
1096
1058
|
* )
|
|
1097
|
-
*
|
|
1098
|
-
* console.log(backup) // Option.some("content1.bak")
|
|
1059
|
+
* return yield* TxHashMap.get(storage, "file1.txt")
|
|
1099
1060
|
* })
|
|
1061
|
+
*
|
|
1062
|
+
* await Effect.runPromise(program) // => Option.some("content1.bak")
|
|
1100
1063
|
* ```
|
|
1101
1064
|
*
|
|
1102
1065
|
* @category combinators
|
|
@@ -1114,42 +1077,34 @@ export declare const modifyAt: {
|
|
|
1114
1077
|
*
|
|
1115
1078
|
* **Example** (Updating values with Option)
|
|
1116
1079
|
*
|
|
1117
|
-
* ```ts
|
|
1118
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1080
|
+
* ```ts import.meta.vitest
|
|
1081
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1119
1082
|
*
|
|
1120
1083
|
* const program = Effect.gen(function*() {
|
|
1121
1084
|
* const storage = yield* TxHashMap.make<string, string | number>([
|
|
1122
1085
|
* "file1.txt",
|
|
1123
1086
|
* "content1"
|
|
1124
1087
|
* ], ["access_count", 0])
|
|
1088
|
+
* const increment = Option.map((value: string | number) => typeof value === "number" ? value + 1 : value)
|
|
1125
1089
|
*
|
|
1126
1090
|
* // Increment existing counter
|
|
1127
|
-
* yield* TxHashMap.modifyAt(storage, "access_count",
|
|
1128
|
-
*
|
|
1129
|
-
* ? { ...current, value: current.value + 1 }
|
|
1130
|
-
* : current
|
|
1131
|
-
* )
|
|
1132
|
-
* const count1 = yield* TxHashMap.get(storage, "access_count")
|
|
1133
|
-
* console.log(count1) // Option.some(1)
|
|
1091
|
+
* yield* TxHashMap.modifyAt(storage, "access_count", increment)
|
|
1092
|
+
* yield* TxHashMap.get(storage, "access_count") // => Option.some(1)
|
|
1134
1093
|
*
|
|
1135
1094
|
* // Increment existing counter again
|
|
1136
|
-
* yield* TxHashMap.modifyAt(storage, "access_count",
|
|
1137
|
-
*
|
|
1138
|
-
* ? { ...current, value: current.value + 1 }
|
|
1139
|
-
* : current
|
|
1140
|
-
* )
|
|
1141
|
-
* const count2 = yield* TxHashMap.get(storage, "access_count")
|
|
1142
|
-
* console.log(count2) // Option.some(2)
|
|
1095
|
+
* yield* TxHashMap.modifyAt(storage, "access_count", increment)
|
|
1096
|
+
* yield* TxHashMap.get(storage, "access_count") // => Option.some(2)
|
|
1143
1097
|
*
|
|
1144
1098
|
* // Update an existing string entry
|
|
1145
|
-
* yield* TxHashMap.modifyAt(
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
*
|
|
1099
|
+
* yield* TxHashMap.modifyAt(
|
|
1100
|
+
* storage,
|
|
1101
|
+
* "file1.txt",
|
|
1102
|
+
* Option.map((value) => typeof value === "string" ? `${value}.bak` : value)
|
|
1149
1103
|
* )
|
|
1150
|
-
*
|
|
1151
|
-
* console.log(backup) // Option.some("content1.bak")
|
|
1104
|
+
* return yield* TxHashMap.get(storage, "file1.txt")
|
|
1152
1105
|
* })
|
|
1106
|
+
*
|
|
1107
|
+
* await Effect.runPromise(program) // => Option.some("content1.bak")
|
|
1153
1108
|
* ```
|
|
1154
1109
|
*
|
|
1155
1110
|
* @category combinators
|
|
@@ -1162,7 +1117,7 @@ export declare const modifyAt: {
|
|
|
1162
1117
|
*
|
|
1163
1118
|
* **Example** (Reading keys)
|
|
1164
1119
|
*
|
|
1165
|
-
* ```ts
|
|
1120
|
+
* ```ts import.meta.vitest
|
|
1166
1121
|
* import { Effect, Option, TxHashMap } from "effect"
|
|
1167
1122
|
*
|
|
1168
1123
|
* const program = Effect.gen(function*() {
|
|
@@ -1172,17 +1127,21 @@ export declare const modifyAt: {
|
|
|
1172
1127
|
* ["charlie", "moderator"]
|
|
1173
1128
|
* )
|
|
1174
1129
|
*
|
|
1175
|
-
* const usernames = yield* TxHashMap.keys(userRoles)
|
|
1176
|
-
*
|
|
1130
|
+
* const usernames = (yield* TxHashMap.keys(userRoles)).sort()
|
|
1131
|
+
* usernames // => ["alice", "bob", "charlie"]
|
|
1177
1132
|
*
|
|
1178
1133
|
* // Useful for iteration
|
|
1134
|
+
* const assignments: Array<string> = []
|
|
1179
1135
|
* for (const username of usernames) {
|
|
1180
1136
|
* const role = yield* TxHashMap.get(userRoles, username)
|
|
1181
1137
|
* if (role._tag === "Some") {
|
|
1182
|
-
*
|
|
1138
|
+
* assignments.push(`${username}: ${role.value}`)
|
|
1183
1139
|
* }
|
|
1184
1140
|
* }
|
|
1141
|
+
* return assignments
|
|
1185
1142
|
* })
|
|
1143
|
+
*
|
|
1144
|
+
* await Effect.runPromise(program) // => ["alice: admin", "bob: user", "charlie: moderator"]
|
|
1186
1145
|
* ```
|
|
1187
1146
|
*
|
|
1188
1147
|
* @category combinators
|
|
@@ -1194,7 +1153,7 @@ export declare const keys: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Array<
|
|
|
1194
1153
|
*
|
|
1195
1154
|
* **Example** (Reading values)
|
|
1196
1155
|
*
|
|
1197
|
-
* ```ts
|
|
1156
|
+
* ```ts import.meta.vitest
|
|
1198
1157
|
* import { Effect, TxHashMap } from "effect"
|
|
1199
1158
|
*
|
|
1200
1159
|
* const program = Effect.gen(function*() {
|
|
@@ -1204,18 +1163,19 @@ export declare const keys: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Array<
|
|
|
1204
1163
|
* ["charlie", 92]
|
|
1205
1164
|
* )
|
|
1206
1165
|
*
|
|
1207
|
-
* const allScores = yield* TxHashMap.values(scores)
|
|
1208
|
-
*
|
|
1166
|
+
* const allScores = (yield* TxHashMap.values(scores)).sort((a, b) => a - b)
|
|
1167
|
+
* allScores // => [87, 92, 95]
|
|
1209
1168
|
*
|
|
1210
1169
|
* // Calculate average
|
|
1211
1170
|
* const average = allScores.reduce((sum, score) => sum + score, 0) /
|
|
1212
1171
|
* allScores.length
|
|
1213
|
-
*
|
|
1172
|
+
* average.toFixed(2) // => "91.33"
|
|
1214
1173
|
*
|
|
1215
1174
|
* // Find maximum
|
|
1216
|
-
*
|
|
1217
|
-
* console.log(maxScore) // 95
|
|
1175
|
+
* return Math.max(...allScores)
|
|
1218
1176
|
* })
|
|
1177
|
+
*
|
|
1178
|
+
* await Effect.runPromise(program) // => 95
|
|
1219
1179
|
* ```
|
|
1220
1180
|
*
|
|
1221
1181
|
* @category combinators
|
|
@@ -1227,7 +1187,7 @@ export declare const values: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Arra
|
|
|
1227
1187
|
*
|
|
1228
1188
|
* **Example** (Reading entries)
|
|
1229
1189
|
*
|
|
1230
|
-
* ```ts
|
|
1190
|
+
* ```ts import.meta.vitest
|
|
1231
1191
|
* import { Effect, TxHashMap } from "effect"
|
|
1232
1192
|
*
|
|
1233
1193
|
* const program = Effect.gen(function*() {
|
|
@@ -1237,19 +1197,10 @@ export declare const values: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Arra
|
|
|
1237
1197
|
* ["ssl", "false"]
|
|
1238
1198
|
* )
|
|
1239
1199
|
*
|
|
1240
|
-
*
|
|
1241
|
-
* const sortedEntries = allEntries.toSorted(([left], [right]) => left.localeCompare(right))
|
|
1242
|
-
* console.log(sortedEntries)
|
|
1243
|
-
* // [["host", "localhost"], ["port", "3000"], ["ssl", "false"]]
|
|
1244
|
-
*
|
|
1245
|
-
* // Process configuration entries
|
|
1246
|
-
* for (const [key, value] of sortedEntries) {
|
|
1247
|
-
* console.log(`${key}=${value}`)
|
|
1248
|
-
* }
|
|
1249
|
-
* // host=localhost
|
|
1250
|
-
* // port=3000
|
|
1251
|
-
* // ssl=false
|
|
1200
|
+
* return (yield* TxHashMap.entries(config)).toSorted(([left], [right]) => left.localeCompare(right))
|
|
1252
1201
|
* })
|
|
1202
|
+
*
|
|
1203
|
+
* await Effect.runPromise(program) // => [["host", "localhost"], ["port", "3000"], ["ssl", "false"]]
|
|
1253
1204
|
* ```
|
|
1254
1205
|
*
|
|
1255
1206
|
* @category combinators
|
|
@@ -1261,8 +1212,8 @@ export declare const entries: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Arr
|
|
|
1261
1212
|
*
|
|
1262
1213
|
* **Example** (Taking immutable snapshots)
|
|
1263
1214
|
*
|
|
1264
|
-
* ```ts
|
|
1265
|
-
* import { Effect, HashMap, TxHashMap } from "effect"
|
|
1215
|
+
* ```ts import.meta.vitest
|
|
1216
|
+
* import { Effect, HashMap, Option, TxHashMap } from "effect"
|
|
1266
1217
|
*
|
|
1267
1218
|
* const program = Effect.gen(function*() {
|
|
1268
1219
|
* const liveData = yield* TxHashMap.make(
|
|
@@ -1279,13 +1230,14 @@ export declare const entries: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Arr
|
|
|
1279
1230
|
* yield* TxHashMap.set(liveData, "wind_speed", 5.3)
|
|
1280
1231
|
*
|
|
1281
1232
|
* // Snapshot remains unchanged
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1233
|
+
* HashMap.size(snapshot) // => 3
|
|
1234
|
+
* HashMap.get(snapshot, "temperature") // => Option.some(22.5)
|
|
1284
1235
|
*
|
|
1285
1236
|
* // Can use regular HashMap operations on snapshot
|
|
1286
|
-
*
|
|
1287
|
-
* const humidityReading = HashMap.get(snapshot, "humidity")
|
|
1237
|
+
* return HashMap.get(snapshot, "humidity")
|
|
1288
1238
|
* })
|
|
1239
|
+
*
|
|
1240
|
+
* await Effect.runPromise(program) // => Option.some(45.2)
|
|
1289
1241
|
* ```
|
|
1290
1242
|
*
|
|
1291
1243
|
* @category combinators
|
|
@@ -1303,8 +1255,8 @@ export declare const snapshot: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Ha
|
|
|
1303
1255
|
*
|
|
1304
1256
|
* **Example** (Merging HashMaps)
|
|
1305
1257
|
*
|
|
1306
|
-
* ```ts
|
|
1307
|
-
* import { Effect, HashMap, TxHashMap } from "effect"
|
|
1258
|
+
* ```ts import.meta.vitest
|
|
1259
|
+
* import { Effect, HashMap, Option, TxHashMap } from "effect"
|
|
1308
1260
|
*
|
|
1309
1261
|
* const program = Effect.gen(function*() {
|
|
1310
1262
|
* // Create initial user preferences
|
|
@@ -1325,18 +1277,13 @@ export declare const snapshot: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Ha
|
|
|
1325
1277
|
* yield* TxHashMap.union(userPrefs, newSettings)
|
|
1326
1278
|
*
|
|
1327
1279
|
* // Check the merged result
|
|
1328
|
-
*
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1332
|
-
* console.log(language) // Option.some("en") - preserved
|
|
1333
|
-
*
|
|
1334
|
-
* const timezone = yield* TxHashMap.get(userPrefs, "timezone")
|
|
1335
|
-
* console.log(timezone) // Option.some("UTC") - newly added
|
|
1336
|
-
*
|
|
1337
|
-
* const size = yield* TxHashMap.size(userPrefs)
|
|
1338
|
-
* console.log(size) // 5 total settings
|
|
1280
|
+
* yield* TxHashMap.get(userPrefs, "theme") // => Option.some("dark")
|
|
1281
|
+
* yield* TxHashMap.get(userPrefs, "language") // => Option.some("en")
|
|
1282
|
+
* yield* TxHashMap.get(userPrefs, "timezone") // => Option.some("UTC")
|
|
1283
|
+
* return yield* TxHashMap.size(userPrefs)
|
|
1339
1284
|
* })
|
|
1285
|
+
*
|
|
1286
|
+
* await Effect.runPromise(program) // => 5
|
|
1340
1287
|
* ```
|
|
1341
1288
|
*
|
|
1342
1289
|
* @category combinators
|
|
@@ -1354,8 +1301,8 @@ export declare const union: {
|
|
|
1354
1301
|
*
|
|
1355
1302
|
* **Example** (Merging HashMaps)
|
|
1356
1303
|
*
|
|
1357
|
-
* ```ts
|
|
1358
|
-
* import { Effect, HashMap, TxHashMap } from "effect"
|
|
1304
|
+
* ```ts import.meta.vitest
|
|
1305
|
+
* import { Effect, HashMap, Option, TxHashMap } from "effect"
|
|
1359
1306
|
*
|
|
1360
1307
|
* const program = Effect.gen(function*() {
|
|
1361
1308
|
* // Create initial user preferences
|
|
@@ -1376,18 +1323,13 @@ export declare const union: {
|
|
|
1376
1323
|
* yield* TxHashMap.union(userPrefs, newSettings)
|
|
1377
1324
|
*
|
|
1378
1325
|
* // Check the merged result
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
*
|
|
1383
|
-
* console.log(language) // Option.some("en") - preserved
|
|
1384
|
-
*
|
|
1385
|
-
* const timezone = yield* TxHashMap.get(userPrefs, "timezone")
|
|
1386
|
-
* console.log(timezone) // Option.some("UTC") - newly added
|
|
1387
|
-
*
|
|
1388
|
-
* const size = yield* TxHashMap.size(userPrefs)
|
|
1389
|
-
* console.log(size) // 5 total settings
|
|
1326
|
+
* yield* TxHashMap.get(userPrefs, "theme") // => Option.some("dark")
|
|
1327
|
+
* yield* TxHashMap.get(userPrefs, "language") // => Option.some("en")
|
|
1328
|
+
* yield* TxHashMap.get(userPrefs, "timezone") // => Option.some("UTC")
|
|
1329
|
+
* return yield* TxHashMap.size(userPrefs)
|
|
1390
1330
|
* })
|
|
1331
|
+
*
|
|
1332
|
+
* await Effect.runPromise(program) // => 5
|
|
1391
1333
|
* ```
|
|
1392
1334
|
*
|
|
1393
1335
|
* @category combinators
|
|
@@ -1405,8 +1347,8 @@ export declare const union: {
|
|
|
1405
1347
|
*
|
|
1406
1348
|
* **Example** (Merging HashMaps)
|
|
1407
1349
|
*
|
|
1408
|
-
* ```ts
|
|
1409
|
-
* import { Effect, HashMap, TxHashMap } from "effect"
|
|
1350
|
+
* ```ts import.meta.vitest
|
|
1351
|
+
* import { Effect, HashMap, Option, TxHashMap } from "effect"
|
|
1410
1352
|
*
|
|
1411
1353
|
* const program = Effect.gen(function*() {
|
|
1412
1354
|
* // Create initial user preferences
|
|
@@ -1427,18 +1369,13 @@ export declare const union: {
|
|
|
1427
1369
|
* yield* TxHashMap.union(userPrefs, newSettings)
|
|
1428
1370
|
*
|
|
1429
1371
|
* // Check the merged result
|
|
1430
|
-
*
|
|
1431
|
-
*
|
|
1432
|
-
*
|
|
1433
|
-
*
|
|
1434
|
-
* console.log(language) // Option.some("en") - preserved
|
|
1435
|
-
*
|
|
1436
|
-
* const timezone = yield* TxHashMap.get(userPrefs, "timezone")
|
|
1437
|
-
* console.log(timezone) // Option.some("UTC") - newly added
|
|
1438
|
-
*
|
|
1439
|
-
* const size = yield* TxHashMap.size(userPrefs)
|
|
1440
|
-
* console.log(size) // 5 total settings
|
|
1372
|
+
* yield* TxHashMap.get(userPrefs, "theme") // => Option.some("dark")
|
|
1373
|
+
* yield* TxHashMap.get(userPrefs, "language") // => Option.some("en")
|
|
1374
|
+
* yield* TxHashMap.get(userPrefs, "timezone") // => Option.some("UTC")
|
|
1375
|
+
* return yield* TxHashMap.size(userPrefs)
|
|
1441
1376
|
* })
|
|
1377
|
+
*
|
|
1378
|
+
* await Effect.runPromise(program) // => 5
|
|
1442
1379
|
* ```
|
|
1443
1380
|
*
|
|
1444
1381
|
* @category combinators
|
|
@@ -1456,8 +1393,8 @@ export declare const union: {
|
|
|
1456
1393
|
*
|
|
1457
1394
|
* **Example** (Removing multiple keys)
|
|
1458
1395
|
*
|
|
1459
|
-
* ```ts
|
|
1460
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1396
|
+
* ```ts import.meta.vitest
|
|
1397
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1461
1398
|
*
|
|
1462
1399
|
* const program = Effect.gen(function*() {
|
|
1463
1400
|
* // Create a cache with temporary data
|
|
@@ -1469,23 +1406,24 @@ export declare const union: {
|
|
|
1469
1406
|
* ["temp_data_2", { value: "also_temporary" }]
|
|
1470
1407
|
* )
|
|
1471
1408
|
*
|
|
1472
|
-
*
|
|
1409
|
+
* yield* TxHashMap.size(cache) // => 5
|
|
1473
1410
|
*
|
|
1474
1411
|
* // Remove expired sessions and temporary data
|
|
1475
1412
|
* const keysToRemove = ["session_1", "session_2", "temp_data_1", "temp_data_2"]
|
|
1476
1413
|
* yield* TxHashMap.removeMany(cache, keysToRemove)
|
|
1477
1414
|
*
|
|
1478
|
-
*
|
|
1415
|
+
* yield* TxHashMap.size(cache) // => 1
|
|
1479
1416
|
*
|
|
1480
1417
|
* // Verify only the valid session remains
|
|
1481
|
-
*
|
|
1482
|
-
* console.log(remainingSession) // Option.some({ user: "charlie", expires: "2024-12-31" })
|
|
1418
|
+
* yield* TxHashMap.get(cache, "session_3") // => Option.some({ user: "charlie", expires: "2024-12-31" })
|
|
1483
1419
|
*
|
|
1484
1420
|
* // Can also remove from Set, Array, or any iterable
|
|
1485
1421
|
* const moreKeysToRemove = new Set(["session_3"])
|
|
1486
1422
|
* yield* TxHashMap.removeMany(cache, moreKeysToRemove)
|
|
1487
|
-
*
|
|
1423
|
+
* return yield* TxHashMap.isEmpty(cache)
|
|
1488
1424
|
* })
|
|
1425
|
+
*
|
|
1426
|
+
* await Effect.runPromise(program) // => true
|
|
1489
1427
|
* ```
|
|
1490
1428
|
*
|
|
1491
1429
|
* @category combinators
|
|
@@ -1502,8 +1440,8 @@ export declare const removeMany: {
|
|
|
1502
1440
|
*
|
|
1503
1441
|
* **Example** (Removing multiple keys)
|
|
1504
1442
|
*
|
|
1505
|
-
* ```ts
|
|
1506
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1443
|
+
* ```ts import.meta.vitest
|
|
1444
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1507
1445
|
*
|
|
1508
1446
|
* const program = Effect.gen(function*() {
|
|
1509
1447
|
* // Create a cache with temporary data
|
|
@@ -1515,23 +1453,24 @@ export declare const removeMany: {
|
|
|
1515
1453
|
* ["temp_data_2", { value: "also_temporary" }]
|
|
1516
1454
|
* )
|
|
1517
1455
|
*
|
|
1518
|
-
*
|
|
1456
|
+
* yield* TxHashMap.size(cache) // => 5
|
|
1519
1457
|
*
|
|
1520
1458
|
* // Remove expired sessions and temporary data
|
|
1521
1459
|
* const keysToRemove = ["session_1", "session_2", "temp_data_1", "temp_data_2"]
|
|
1522
1460
|
* yield* TxHashMap.removeMany(cache, keysToRemove)
|
|
1523
1461
|
*
|
|
1524
|
-
*
|
|
1462
|
+
* yield* TxHashMap.size(cache) // => 1
|
|
1525
1463
|
*
|
|
1526
1464
|
* // Verify only the valid session remains
|
|
1527
|
-
*
|
|
1528
|
-
* console.log(remainingSession) // Option.some({ user: "charlie", expires: "2024-12-31" })
|
|
1465
|
+
* yield* TxHashMap.get(cache, "session_3") // => Option.some({ user: "charlie", expires: "2024-12-31" })
|
|
1529
1466
|
*
|
|
1530
1467
|
* // Can also remove from Set, Array, or any iterable
|
|
1531
1468
|
* const moreKeysToRemove = new Set(["session_3"])
|
|
1532
1469
|
* yield* TxHashMap.removeMany(cache, moreKeysToRemove)
|
|
1533
|
-
*
|
|
1470
|
+
* return yield* TxHashMap.isEmpty(cache)
|
|
1534
1471
|
* })
|
|
1472
|
+
*
|
|
1473
|
+
* await Effect.runPromise(program) // => true
|
|
1535
1474
|
* ```
|
|
1536
1475
|
*
|
|
1537
1476
|
* @category combinators
|
|
@@ -1548,8 +1487,8 @@ export declare const removeMany: {
|
|
|
1548
1487
|
*
|
|
1549
1488
|
* **Example** (Removing multiple keys)
|
|
1550
1489
|
*
|
|
1551
|
-
* ```ts
|
|
1552
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1490
|
+
* ```ts import.meta.vitest
|
|
1491
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1553
1492
|
*
|
|
1554
1493
|
* const program = Effect.gen(function*() {
|
|
1555
1494
|
* // Create a cache with temporary data
|
|
@@ -1561,23 +1500,24 @@ export declare const removeMany: {
|
|
|
1561
1500
|
* ["temp_data_2", { value: "also_temporary" }]
|
|
1562
1501
|
* )
|
|
1563
1502
|
*
|
|
1564
|
-
*
|
|
1503
|
+
* yield* TxHashMap.size(cache) // => 5
|
|
1565
1504
|
*
|
|
1566
1505
|
* // Remove expired sessions and temporary data
|
|
1567
1506
|
* const keysToRemove = ["session_1", "session_2", "temp_data_1", "temp_data_2"]
|
|
1568
1507
|
* yield* TxHashMap.removeMany(cache, keysToRemove)
|
|
1569
1508
|
*
|
|
1570
|
-
*
|
|
1509
|
+
* yield* TxHashMap.size(cache) // => 1
|
|
1571
1510
|
*
|
|
1572
1511
|
* // Verify only the valid session remains
|
|
1573
|
-
*
|
|
1574
|
-
* console.log(remainingSession) // Option.some({ user: "charlie", expires: "2024-12-31" })
|
|
1512
|
+
* yield* TxHashMap.get(cache, "session_3") // => Option.some({ user: "charlie", expires: "2024-12-31" })
|
|
1575
1513
|
*
|
|
1576
1514
|
* // Can also remove from Set, Array, or any iterable
|
|
1577
1515
|
* const moreKeysToRemove = new Set(["session_3"])
|
|
1578
1516
|
* yield* TxHashMap.removeMany(cache, moreKeysToRemove)
|
|
1579
|
-
*
|
|
1517
|
+
* return yield* TxHashMap.isEmpty(cache)
|
|
1580
1518
|
* })
|
|
1519
|
+
*
|
|
1520
|
+
* await Effect.runPromise(program) // => true
|
|
1581
1521
|
* ```
|
|
1582
1522
|
*
|
|
1583
1523
|
* @category combinators
|
|
@@ -1595,8 +1535,8 @@ export declare const removeMany: {
|
|
|
1595
1535
|
*
|
|
1596
1536
|
* **Example** (Setting multiple entries)
|
|
1597
1537
|
*
|
|
1598
|
-
* ```ts
|
|
1599
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1538
|
+
* ```ts import.meta.vitest
|
|
1539
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1600
1540
|
*
|
|
1601
1541
|
* const program = Effect.gen(function*() {
|
|
1602
1542
|
* // Create an empty product catalog
|
|
@@ -1617,7 +1557,7 @@ export declare const removeMany: {
|
|
|
1617
1557
|
*
|
|
1618
1558
|
* yield* TxHashMap.setMany(catalog, initialProducts)
|
|
1619
1559
|
*
|
|
1620
|
-
*
|
|
1560
|
+
* yield* TxHashMap.size(catalog) // => 4
|
|
1621
1561
|
*
|
|
1622
1562
|
* // Update prices with a new batch
|
|
1623
1563
|
* const priceUpdates: Array<
|
|
@@ -1630,16 +1570,18 @@ export declare const removeMany: {
|
|
|
1630
1570
|
*
|
|
1631
1571
|
* yield* TxHashMap.setMany(catalog, priceUpdates)
|
|
1632
1572
|
*
|
|
1633
|
-
*
|
|
1573
|
+
* yield* TxHashMap.size(catalog) // => 5
|
|
1634
1574
|
*
|
|
1635
1575
|
* // Verify the updates
|
|
1636
|
-
*
|
|
1637
|
-
* console.log(laptop) // Option.some({ price: 899, stock: 5 })
|
|
1576
|
+
* yield* TxHashMap.get(catalog, "laptop") // => Option.some({ price: 899, stock: 5 })
|
|
1638
1577
|
*
|
|
1639
1578
|
* // Can also use Map, Set of tuples, or any iterable of entries
|
|
1640
1579
|
* const jsMap = new Map([["tablet", { price: 399, stock: 3 }]])
|
|
1641
1580
|
* yield* TxHashMap.setMany(catalog, jsMap)
|
|
1581
|
+
* return yield* TxHashMap.get(catalog, "tablet")
|
|
1642
1582
|
* })
|
|
1583
|
+
*
|
|
1584
|
+
* await Effect.runPromise(program) // => Option.some({ price: 399, stock: 3 })
|
|
1643
1585
|
* ```
|
|
1644
1586
|
*
|
|
1645
1587
|
* @category combinators
|
|
@@ -1656,8 +1598,8 @@ export declare const setMany: {
|
|
|
1656
1598
|
*
|
|
1657
1599
|
* **Example** (Setting multiple entries)
|
|
1658
1600
|
*
|
|
1659
|
-
* ```ts
|
|
1660
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1601
|
+
* ```ts import.meta.vitest
|
|
1602
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1661
1603
|
*
|
|
1662
1604
|
* const program = Effect.gen(function*() {
|
|
1663
1605
|
* // Create an empty product catalog
|
|
@@ -1678,7 +1620,7 @@ export declare const setMany: {
|
|
|
1678
1620
|
*
|
|
1679
1621
|
* yield* TxHashMap.setMany(catalog, initialProducts)
|
|
1680
1622
|
*
|
|
1681
|
-
*
|
|
1623
|
+
* yield* TxHashMap.size(catalog) // => 4
|
|
1682
1624
|
*
|
|
1683
1625
|
* // Update prices with a new batch
|
|
1684
1626
|
* const priceUpdates: Array<
|
|
@@ -1691,16 +1633,18 @@ export declare const setMany: {
|
|
|
1691
1633
|
*
|
|
1692
1634
|
* yield* TxHashMap.setMany(catalog, priceUpdates)
|
|
1693
1635
|
*
|
|
1694
|
-
*
|
|
1636
|
+
* yield* TxHashMap.size(catalog) // => 5
|
|
1695
1637
|
*
|
|
1696
1638
|
* // Verify the updates
|
|
1697
|
-
*
|
|
1698
|
-
* console.log(laptop) // Option.some({ price: 899, stock: 5 })
|
|
1639
|
+
* yield* TxHashMap.get(catalog, "laptop") // => Option.some({ price: 899, stock: 5 })
|
|
1699
1640
|
*
|
|
1700
1641
|
* // Can also use Map, Set of tuples, or any iterable of entries
|
|
1701
1642
|
* const jsMap = new Map([["tablet", { price: 399, stock: 3 }]])
|
|
1702
1643
|
* yield* TxHashMap.setMany(catalog, jsMap)
|
|
1644
|
+
* return yield* TxHashMap.get(catalog, "tablet")
|
|
1703
1645
|
* })
|
|
1646
|
+
*
|
|
1647
|
+
* await Effect.runPromise(program) // => Option.some({ price: 399, stock: 3 })
|
|
1704
1648
|
* ```
|
|
1705
1649
|
*
|
|
1706
1650
|
* @category combinators
|
|
@@ -1717,8 +1661,8 @@ export declare const setMany: {
|
|
|
1717
1661
|
*
|
|
1718
1662
|
* **Example** (Setting multiple entries)
|
|
1719
1663
|
*
|
|
1720
|
-
* ```ts
|
|
1721
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1664
|
+
* ```ts import.meta.vitest
|
|
1665
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
1722
1666
|
*
|
|
1723
1667
|
* const program = Effect.gen(function*() {
|
|
1724
1668
|
* // Create an empty product catalog
|
|
@@ -1739,7 +1683,7 @@ export declare const setMany: {
|
|
|
1739
1683
|
*
|
|
1740
1684
|
* yield* TxHashMap.setMany(catalog, initialProducts)
|
|
1741
1685
|
*
|
|
1742
|
-
*
|
|
1686
|
+
* yield* TxHashMap.size(catalog) // => 4
|
|
1743
1687
|
*
|
|
1744
1688
|
* // Update prices with a new batch
|
|
1745
1689
|
* const priceUpdates: Array<
|
|
@@ -1752,16 +1696,18 @@ export declare const setMany: {
|
|
|
1752
1696
|
*
|
|
1753
1697
|
* yield* TxHashMap.setMany(catalog, priceUpdates)
|
|
1754
1698
|
*
|
|
1755
|
-
*
|
|
1699
|
+
* yield* TxHashMap.size(catalog) // => 5
|
|
1756
1700
|
*
|
|
1757
1701
|
* // Verify the updates
|
|
1758
|
-
*
|
|
1759
|
-
* console.log(laptop) // Option.some({ price: 899, stock: 5 })
|
|
1702
|
+
* yield* TxHashMap.get(catalog, "laptop") // => Option.some({ price: 899, stock: 5 })
|
|
1760
1703
|
*
|
|
1761
1704
|
* // Can also use Map, Set of tuples, or any iterable of entries
|
|
1762
1705
|
* const jsMap = new Map([["tablet", { price: 399, stock: 3 }]])
|
|
1763
1706
|
* yield* TxHashMap.setMany(catalog, jsMap)
|
|
1707
|
+
* return yield* TxHashMap.get(catalog, "tablet")
|
|
1764
1708
|
* })
|
|
1709
|
+
*
|
|
1710
|
+
* await Effect.runPromise(program) // => Option.some({ price: 399, stock: 3 })
|
|
1765
1711
|
* ```
|
|
1766
1712
|
*
|
|
1767
1713
|
* @category combinators
|
|
@@ -1774,16 +1720,16 @@ export declare const setMany: {
|
|
|
1774
1720
|
*
|
|
1775
1721
|
* **Example** (Checking TxHashMap values)
|
|
1776
1722
|
*
|
|
1777
|
-
* ```ts
|
|
1778
|
-
* import { Effect, TxHashMap } from "effect"
|
|
1723
|
+
* ```ts import.meta.vitest
|
|
1724
|
+
* import { Effect, Exit, TxHashMap } from "effect"
|
|
1779
1725
|
*
|
|
1780
1726
|
* const program = Effect.gen(function*() {
|
|
1781
1727
|
* const txMap = yield* TxHashMap.make(["key", "value"])
|
|
1782
1728
|
*
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1785
|
-
*
|
|
1786
|
-
*
|
|
1729
|
+
* TxHashMap.isTxHashMap(txMap) // => true
|
|
1730
|
+
* TxHashMap.isTxHashMap({}) // => false
|
|
1731
|
+
* TxHashMap.isTxHashMap(null) // => false
|
|
1732
|
+
* TxHashMap.isTxHashMap("not a map") // => false
|
|
1787
1733
|
*
|
|
1788
1734
|
* // Useful for type guards in runtime checks
|
|
1789
1735
|
* const validateInput = (value: unknown) => {
|
|
@@ -1793,7 +1739,12 @@ export declare const setMany: {
|
|
|
1793
1739
|
* }
|
|
1794
1740
|
* return Effect.fail("Invalid input")
|
|
1795
1741
|
* }
|
|
1742
|
+
*
|
|
1743
|
+
* yield* Effect.exit(validateInput(null)) // => Exit.fail("Invalid input")
|
|
1744
|
+
* return yield* Effect.exit(validateInput(txMap))
|
|
1796
1745
|
* })
|
|
1746
|
+
*
|
|
1747
|
+
* await Effect.runPromise(program) // => Exit.succeed("Valid TxHashMap")
|
|
1797
1748
|
* ```
|
|
1798
1749
|
*
|
|
1799
1750
|
* @category guards
|
|
@@ -1811,8 +1762,8 @@ export declare const isTxHashMap: <K, V>(value: unknown) => value is TxHashMap<K
|
|
|
1811
1762
|
*
|
|
1812
1763
|
* **Example** (Looking up values with precomputed hashes)
|
|
1813
1764
|
*
|
|
1814
|
-
* ```ts
|
|
1815
|
-
* import { Effect, Hash, TxHashMap } from "effect"
|
|
1765
|
+
* ```ts import.meta.vitest
|
|
1766
|
+
* import { Effect, Hash, Option, TxHashMap } from "effect"
|
|
1816
1767
|
*
|
|
1817
1768
|
* const program = Effect.gen(function*() {
|
|
1818
1769
|
* // Create a cache with user sessions
|
|
@@ -1827,16 +1778,17 @@ export declare const isTxHashMap: <K, V>(value: unknown) => value is TxHashMap<K
|
|
|
1827
1778
|
*
|
|
1828
1779
|
* // Use hash-optimized lookup for performance in hot paths
|
|
1829
1780
|
* const session = yield* TxHashMap.getHash(cache, sessionId, precomputedHash)
|
|
1830
|
-
*
|
|
1781
|
+
* session // => Option.some({ userId: "user1", lastActive: 1_700_000_000_000 })
|
|
1831
1782
|
*
|
|
1832
1783
|
* // This avoids recomputing the hash when you already have it
|
|
1833
|
-
*
|
|
1784
|
+
* return yield* TxHashMap.getHash(
|
|
1834
1785
|
* cache,
|
|
1835
1786
|
* "invalid",
|
|
1836
1787
|
* Hash.string("invalid")
|
|
1837
1788
|
* )
|
|
1838
|
-
* console.log(invalidSession) // Option.none()
|
|
1839
1789
|
* })
|
|
1790
|
+
*
|
|
1791
|
+
* await Effect.runPromise(program) // => Option.none()
|
|
1840
1792
|
* ```
|
|
1841
1793
|
*
|
|
1842
1794
|
* @category combinators
|
|
@@ -1854,8 +1806,8 @@ export declare const getHash: {
|
|
|
1854
1806
|
*
|
|
1855
1807
|
* **Example** (Looking up values with precomputed hashes)
|
|
1856
1808
|
*
|
|
1857
|
-
* ```ts
|
|
1858
|
-
* import { Effect, Hash, TxHashMap } from "effect"
|
|
1809
|
+
* ```ts import.meta.vitest
|
|
1810
|
+
* import { Effect, Hash, Option, TxHashMap } from "effect"
|
|
1859
1811
|
*
|
|
1860
1812
|
* const program = Effect.gen(function*() {
|
|
1861
1813
|
* // Create a cache with user sessions
|
|
@@ -1870,16 +1822,17 @@ export declare const getHash: {
|
|
|
1870
1822
|
*
|
|
1871
1823
|
* // Use hash-optimized lookup for performance in hot paths
|
|
1872
1824
|
* const session = yield* TxHashMap.getHash(cache, sessionId, precomputedHash)
|
|
1873
|
-
*
|
|
1825
|
+
* session // => Option.some({ userId: "user1", lastActive: 1_700_000_000_000 })
|
|
1874
1826
|
*
|
|
1875
1827
|
* // This avoids recomputing the hash when you already have it
|
|
1876
|
-
*
|
|
1828
|
+
* return yield* TxHashMap.getHash(
|
|
1877
1829
|
* cache,
|
|
1878
1830
|
* "invalid",
|
|
1879
1831
|
* Hash.string("invalid")
|
|
1880
1832
|
* )
|
|
1881
|
-
* console.log(invalidSession) // Option.none()
|
|
1882
1833
|
* })
|
|
1834
|
+
*
|
|
1835
|
+
* await Effect.runPromise(program) // => Option.none()
|
|
1883
1836
|
* ```
|
|
1884
1837
|
*
|
|
1885
1838
|
* @category combinators
|
|
@@ -1897,8 +1850,8 @@ export declare const getHash: {
|
|
|
1897
1850
|
*
|
|
1898
1851
|
* **Example** (Looking up values with precomputed hashes)
|
|
1899
1852
|
*
|
|
1900
|
-
* ```ts
|
|
1901
|
-
* import { Effect, Hash, TxHashMap } from "effect"
|
|
1853
|
+
* ```ts import.meta.vitest
|
|
1854
|
+
* import { Effect, Hash, Option, TxHashMap } from "effect"
|
|
1902
1855
|
*
|
|
1903
1856
|
* const program = Effect.gen(function*() {
|
|
1904
1857
|
* // Create a cache with user sessions
|
|
@@ -1913,16 +1866,17 @@ export declare const getHash: {
|
|
|
1913
1866
|
*
|
|
1914
1867
|
* // Use hash-optimized lookup for performance in hot paths
|
|
1915
1868
|
* const session = yield* TxHashMap.getHash(cache, sessionId, precomputedHash)
|
|
1916
|
-
*
|
|
1869
|
+
* session // => Option.some({ userId: "user1", lastActive: 1_700_000_000_000 })
|
|
1917
1870
|
*
|
|
1918
1871
|
* // This avoids recomputing the hash when you already have it
|
|
1919
|
-
*
|
|
1872
|
+
* return yield* TxHashMap.getHash(
|
|
1920
1873
|
* cache,
|
|
1921
1874
|
* "invalid",
|
|
1922
1875
|
* Hash.string("invalid")
|
|
1923
1876
|
* )
|
|
1924
|
-
* console.log(invalidSession) // Option.none()
|
|
1925
1877
|
* })
|
|
1878
|
+
*
|
|
1879
|
+
* await Effect.runPromise(program) // => Option.none()
|
|
1926
1880
|
* ```
|
|
1927
1881
|
*
|
|
1928
1882
|
* @category combinators
|
|
@@ -1941,7 +1895,7 @@ export declare const getHash: {
|
|
|
1941
1895
|
*
|
|
1942
1896
|
* **Example** (Checking keys with precomputed hashes)
|
|
1943
1897
|
*
|
|
1944
|
-
* ```ts
|
|
1898
|
+
* ```ts import.meta.vitest
|
|
1945
1899
|
* import { Effect, Hash, TxHashMap } from "effect"
|
|
1946
1900
|
*
|
|
1947
1901
|
* const program = Effect.gen(function*() {
|
|
@@ -1956,29 +1910,30 @@ export declare const getHash: {
|
|
|
1956
1910
|
* const roleHash = Hash.string(role)
|
|
1957
1911
|
*
|
|
1958
1912
|
* // Use hash-optimized existence check
|
|
1959
|
-
*
|
|
1960
|
-
* console.log(hasAdminRole) // true
|
|
1913
|
+
* yield* TxHashMap.hasHash(permissions, role, roleHash) // => true
|
|
1961
1914
|
*
|
|
1962
1915
|
* // Check non-existent role
|
|
1963
|
-
*
|
|
1916
|
+
* yield* TxHashMap.hasHash(
|
|
1964
1917
|
* permissions,
|
|
1965
1918
|
* "guest",
|
|
1966
1919
|
* Hash.string("guest")
|
|
1967
|
-
* )
|
|
1968
|
-
* console.log(hasGuestRole) // false
|
|
1920
|
+
* ) // => false
|
|
1969
1921
|
*
|
|
1970
1922
|
* // Useful in hot paths where hash is computed once and reused
|
|
1971
1923
|
* const roles = ["admin", "user", "moderator"]
|
|
1972
1924
|
* const roleHashes = roles.map((role) => [role, Hash.string(role)] as const)
|
|
1973
|
-
*
|
|
1925
|
+
* const results: Array<string> = []
|
|
1974
1926
|
* for (const [role, hash] of roleHashes) {
|
|
1975
1927
|
* const exists = yield* TxHashMap.hasHash(permissions, role, hash)
|
|
1976
|
-
*
|
|
1928
|
+
* results.push(`Role ${role}: ${exists}`)
|
|
1977
1929
|
* }
|
|
1930
|
+
* return results
|
|
1978
1931
|
* })
|
|
1932
|
+
*
|
|
1933
|
+
* await Effect.runPromise(program) // => ["Role admin: true", "Role user: true", "Role moderator: false"]
|
|
1979
1934
|
* ```
|
|
1980
1935
|
*
|
|
1981
|
-
* @category
|
|
1936
|
+
* @category predicates
|
|
1982
1937
|
* @since 4.0.0
|
|
1983
1938
|
*/
|
|
1984
1939
|
export declare const hasHash: {
|
|
@@ -1993,7 +1948,7 @@ export declare const hasHash: {
|
|
|
1993
1948
|
*
|
|
1994
1949
|
* **Example** (Checking keys with precomputed hashes)
|
|
1995
1950
|
*
|
|
1996
|
-
* ```ts
|
|
1951
|
+
* ```ts import.meta.vitest
|
|
1997
1952
|
* import { Effect, Hash, TxHashMap } from "effect"
|
|
1998
1953
|
*
|
|
1999
1954
|
* const program = Effect.gen(function*() {
|
|
@@ -2008,29 +1963,30 @@ export declare const hasHash: {
|
|
|
2008
1963
|
* const roleHash = Hash.string(role)
|
|
2009
1964
|
*
|
|
2010
1965
|
* // Use hash-optimized existence check
|
|
2011
|
-
*
|
|
2012
|
-
* console.log(hasAdminRole) // true
|
|
1966
|
+
* yield* TxHashMap.hasHash(permissions, role, roleHash) // => true
|
|
2013
1967
|
*
|
|
2014
1968
|
* // Check non-existent role
|
|
2015
|
-
*
|
|
1969
|
+
* yield* TxHashMap.hasHash(
|
|
2016
1970
|
* permissions,
|
|
2017
1971
|
* "guest",
|
|
2018
1972
|
* Hash.string("guest")
|
|
2019
|
-
* )
|
|
2020
|
-
* console.log(hasGuestRole) // false
|
|
1973
|
+
* ) // => false
|
|
2021
1974
|
*
|
|
2022
1975
|
* // Useful in hot paths where hash is computed once and reused
|
|
2023
1976
|
* const roles = ["admin", "user", "moderator"]
|
|
2024
1977
|
* const roleHashes = roles.map((role) => [role, Hash.string(role)] as const)
|
|
2025
|
-
*
|
|
1978
|
+
* const results: Array<string> = []
|
|
2026
1979
|
* for (const [role, hash] of roleHashes) {
|
|
2027
1980
|
* const exists = yield* TxHashMap.hasHash(permissions, role, hash)
|
|
2028
|
-
*
|
|
1981
|
+
* results.push(`Role ${role}: ${exists}`)
|
|
2029
1982
|
* }
|
|
1983
|
+
* return results
|
|
2030
1984
|
* })
|
|
1985
|
+
*
|
|
1986
|
+
* await Effect.runPromise(program) // => ["Role admin: true", "Role user: true", "Role moderator: false"]
|
|
2031
1987
|
* ```
|
|
2032
1988
|
*
|
|
2033
|
-
* @category
|
|
1989
|
+
* @category predicates
|
|
2034
1990
|
* @since 4.0.0
|
|
2035
1991
|
*/
|
|
2036
1992
|
<K1 extends K, K>(key: K1, hash: number): <V>(self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -2045,7 +2001,7 @@ export declare const hasHash: {
|
|
|
2045
2001
|
*
|
|
2046
2002
|
* **Example** (Checking keys with precomputed hashes)
|
|
2047
2003
|
*
|
|
2048
|
-
* ```ts
|
|
2004
|
+
* ```ts import.meta.vitest
|
|
2049
2005
|
* import { Effect, Hash, TxHashMap } from "effect"
|
|
2050
2006
|
*
|
|
2051
2007
|
* const program = Effect.gen(function*() {
|
|
@@ -2060,29 +2016,30 @@ export declare const hasHash: {
|
|
|
2060
2016
|
* const roleHash = Hash.string(role)
|
|
2061
2017
|
*
|
|
2062
2018
|
* // Use hash-optimized existence check
|
|
2063
|
-
*
|
|
2064
|
-
* console.log(hasAdminRole) // true
|
|
2019
|
+
* yield* TxHashMap.hasHash(permissions, role, roleHash) // => true
|
|
2065
2020
|
*
|
|
2066
2021
|
* // Check non-existent role
|
|
2067
|
-
*
|
|
2022
|
+
* yield* TxHashMap.hasHash(
|
|
2068
2023
|
* permissions,
|
|
2069
2024
|
* "guest",
|
|
2070
2025
|
* Hash.string("guest")
|
|
2071
|
-
* )
|
|
2072
|
-
* console.log(hasGuestRole) // false
|
|
2026
|
+
* ) // => false
|
|
2073
2027
|
*
|
|
2074
2028
|
* // Useful in hot paths where hash is computed once and reused
|
|
2075
2029
|
* const roles = ["admin", "user", "moderator"]
|
|
2076
2030
|
* const roleHashes = roles.map((role) => [role, Hash.string(role)] as const)
|
|
2077
|
-
*
|
|
2031
|
+
* const results: Array<string> = []
|
|
2078
2032
|
* for (const [role, hash] of roleHashes) {
|
|
2079
2033
|
* const exists = yield* TxHashMap.hasHash(permissions, role, hash)
|
|
2080
|
-
*
|
|
2034
|
+
* results.push(`Role ${role}: ${exists}`)
|
|
2081
2035
|
* }
|
|
2036
|
+
* return results
|
|
2082
2037
|
* })
|
|
2038
|
+
*
|
|
2039
|
+
* await Effect.runPromise(program) // => ["Role admin: true", "Role user: true", "Role moderator: false"]
|
|
2083
2040
|
* ```
|
|
2084
2041
|
*
|
|
2085
|
-
* @category
|
|
2042
|
+
* @category predicates
|
|
2086
2043
|
* @since 4.0.0
|
|
2087
2044
|
*/
|
|
2088
2045
|
<K1 extends K, K, V>(self: TxHashMap<K, V>, key: K1, hash: number): Effect.Effect<boolean>;
|
|
@@ -2097,8 +2054,8 @@ export declare const hasHash: {
|
|
|
2097
2054
|
*
|
|
2098
2055
|
* **Example** (Mapping values)
|
|
2099
2056
|
*
|
|
2100
|
-
* ```ts
|
|
2101
|
-
* import { Effect, TxHashMap } from "effect"
|
|
2057
|
+
* ```ts import.meta.vitest
|
|
2058
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
2102
2059
|
*
|
|
2103
2060
|
* const program = Effect.gen(function*() {
|
|
2104
2061
|
* // Create a user profile map
|
|
@@ -2115,21 +2072,20 @@ export declare const hasHash: {
|
|
|
2115
2072
|
* )
|
|
2116
2073
|
*
|
|
2117
2074
|
* // Check the transformed values
|
|
2118
|
-
*
|
|
2119
|
-
* console.log(aliceGreeting) // Option.some("Hello, Alice! (User: alice)")
|
|
2075
|
+
* yield* TxHashMap.get(greetings, "alice") // => Option.some("Hello, Alice! (User: alice)")
|
|
2120
2076
|
*
|
|
2121
2077
|
* // Data-last usage with pipe
|
|
2122
2078
|
* const ages = yield* profiles.pipe(
|
|
2123
2079
|
* TxHashMap.map((profile) => profile.age)
|
|
2124
2080
|
* )
|
|
2125
2081
|
*
|
|
2126
|
-
*
|
|
2127
|
-
* console.log(aliceAge) // Option.some(30)
|
|
2082
|
+
* yield* TxHashMap.get(ages, "alice") // => Option.some(30)
|
|
2128
2083
|
*
|
|
2129
2084
|
* // Original map is unchanged
|
|
2130
|
-
*
|
|
2131
|
-
* console.log(originalAlice) // Option.some({ name: "Alice", age: 30, active: true })
|
|
2085
|
+
* return yield* TxHashMap.get(profiles, "alice")
|
|
2132
2086
|
* })
|
|
2087
|
+
*
|
|
2088
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Alice", age: 30, active: true })
|
|
2133
2089
|
* ```
|
|
2134
2090
|
*
|
|
2135
2091
|
* @category combinators
|
|
@@ -2146,8 +2102,8 @@ export declare const map: {
|
|
|
2146
2102
|
*
|
|
2147
2103
|
* **Example** (Mapping values)
|
|
2148
2104
|
*
|
|
2149
|
-
* ```ts
|
|
2150
|
-
* import { Effect, TxHashMap } from "effect"
|
|
2105
|
+
* ```ts import.meta.vitest
|
|
2106
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
2151
2107
|
*
|
|
2152
2108
|
* const program = Effect.gen(function*() {
|
|
2153
2109
|
* // Create a user profile map
|
|
@@ -2164,21 +2120,20 @@ export declare const map: {
|
|
|
2164
2120
|
* )
|
|
2165
2121
|
*
|
|
2166
2122
|
* // Check the transformed values
|
|
2167
|
-
*
|
|
2168
|
-
* console.log(aliceGreeting) // Option.some("Hello, Alice! (User: alice)")
|
|
2123
|
+
* yield* TxHashMap.get(greetings, "alice") // => Option.some("Hello, Alice! (User: alice)")
|
|
2169
2124
|
*
|
|
2170
2125
|
* // Data-last usage with pipe
|
|
2171
2126
|
* const ages = yield* profiles.pipe(
|
|
2172
2127
|
* TxHashMap.map((profile) => profile.age)
|
|
2173
2128
|
* )
|
|
2174
2129
|
*
|
|
2175
|
-
*
|
|
2176
|
-
* console.log(aliceAge) // Option.some(30)
|
|
2130
|
+
* yield* TxHashMap.get(ages, "alice") // => Option.some(30)
|
|
2177
2131
|
*
|
|
2178
2132
|
* // Original map is unchanged
|
|
2179
|
-
*
|
|
2180
|
-
* console.log(originalAlice) // Option.some({ name: "Alice", age: 30, active: true })
|
|
2133
|
+
* return yield* TxHashMap.get(profiles, "alice")
|
|
2181
2134
|
* })
|
|
2135
|
+
*
|
|
2136
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Alice", age: 30, active: true })
|
|
2182
2137
|
* ```
|
|
2183
2138
|
*
|
|
2184
2139
|
* @category combinators
|
|
@@ -2195,8 +2150,8 @@ export declare const map: {
|
|
|
2195
2150
|
*
|
|
2196
2151
|
* **Example** (Mapping values)
|
|
2197
2152
|
*
|
|
2198
|
-
* ```ts
|
|
2199
|
-
* import { Effect, TxHashMap } from "effect"
|
|
2153
|
+
* ```ts import.meta.vitest
|
|
2154
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
2200
2155
|
*
|
|
2201
2156
|
* const program = Effect.gen(function*() {
|
|
2202
2157
|
* // Create a user profile map
|
|
@@ -2213,21 +2168,20 @@ export declare const map: {
|
|
|
2213
2168
|
* )
|
|
2214
2169
|
*
|
|
2215
2170
|
* // Check the transformed values
|
|
2216
|
-
*
|
|
2217
|
-
* console.log(aliceGreeting) // Option.some("Hello, Alice! (User: alice)")
|
|
2171
|
+
* yield* TxHashMap.get(greetings, "alice") // => Option.some("Hello, Alice! (User: alice)")
|
|
2218
2172
|
*
|
|
2219
2173
|
* // Data-last usage with pipe
|
|
2220
2174
|
* const ages = yield* profiles.pipe(
|
|
2221
2175
|
* TxHashMap.map((profile) => profile.age)
|
|
2222
2176
|
* )
|
|
2223
2177
|
*
|
|
2224
|
-
*
|
|
2225
|
-
* console.log(aliceAge) // Option.some(30)
|
|
2178
|
+
* yield* TxHashMap.get(ages, "alice") // => Option.some(30)
|
|
2226
2179
|
*
|
|
2227
2180
|
* // Original map is unchanged
|
|
2228
|
-
*
|
|
2229
|
-
* console.log(originalAlice) // Option.some({ name: "Alice", age: 30, active: true })
|
|
2181
|
+
* return yield* TxHashMap.get(profiles, "alice")
|
|
2230
2182
|
* })
|
|
2183
|
+
*
|
|
2184
|
+
* await Effect.runPromise(program) // => Option.some({ name: "Alice", age: 30, active: true })
|
|
2231
2185
|
* ```
|
|
2232
2186
|
*
|
|
2233
2187
|
* @category combinators
|
|
@@ -2245,7 +2199,7 @@ export declare const map: {
|
|
|
2245
2199
|
*
|
|
2246
2200
|
* **Example** (Filtering entries)
|
|
2247
2201
|
*
|
|
2248
|
-
* ```ts
|
|
2202
|
+
* ```ts import.meta.vitest
|
|
2249
2203
|
* import { Effect, TxHashMap } from "effect"
|
|
2250
2204
|
*
|
|
2251
2205
|
* const program = Effect.gen(function*() {
|
|
@@ -2263,24 +2217,24 @@ export declare const map: {
|
|
|
2263
2217
|
* (product) => product.category === "electronics" && product.stock > 0
|
|
2264
2218
|
* )
|
|
2265
2219
|
*
|
|
2266
|
-
*
|
|
2267
|
-
* console.log(size) // 2 (laptop and mouse)
|
|
2220
|
+
* yield* TxHashMap.size(electronicsInStock) // => 2
|
|
2268
2221
|
*
|
|
2269
2222
|
* // Data-last usage with pipe
|
|
2270
2223
|
* const expensiveItems = yield* inventory.pipe(
|
|
2271
2224
|
* TxHashMap.filter((product) => product.price > 500)
|
|
2272
2225
|
* )
|
|
2273
2226
|
*
|
|
2274
|
-
*
|
|
2275
|
-
* console.log(expensiveSize) // 2 (laptop and phone)
|
|
2227
|
+
* yield* TxHashMap.size(expensiveItems) // => 2
|
|
2276
2228
|
*
|
|
2277
2229
|
* // Type guard usage
|
|
2278
|
-
*
|
|
2230
|
+
* return yield* TxHashMap.filter(
|
|
2279
2231
|
* inventory,
|
|
2280
2232
|
* (product): product is typeof product & { price: number } =>
|
|
2281
2233
|
* product.price > 50
|
|
2282
2234
|
* )
|
|
2283
2235
|
* })
|
|
2236
|
+
*
|
|
2237
|
+
* await Effect.runPromise(program)
|
|
2284
2238
|
* ```
|
|
2285
2239
|
*
|
|
2286
2240
|
* @category combinators
|
|
@@ -2297,7 +2251,7 @@ export declare const filter: {
|
|
|
2297
2251
|
*
|
|
2298
2252
|
* **Example** (Filtering entries)
|
|
2299
2253
|
*
|
|
2300
|
-
* ```ts
|
|
2254
|
+
* ```ts import.meta.vitest
|
|
2301
2255
|
* import { Effect, TxHashMap } from "effect"
|
|
2302
2256
|
*
|
|
2303
2257
|
* const program = Effect.gen(function*() {
|
|
@@ -2315,24 +2269,24 @@ export declare const filter: {
|
|
|
2315
2269
|
* (product) => product.category === "electronics" && product.stock > 0
|
|
2316
2270
|
* )
|
|
2317
2271
|
*
|
|
2318
|
-
*
|
|
2319
|
-
* console.log(size) // 2 (laptop and mouse)
|
|
2272
|
+
* yield* TxHashMap.size(electronicsInStock) // => 2
|
|
2320
2273
|
*
|
|
2321
2274
|
* // Data-last usage with pipe
|
|
2322
2275
|
* const expensiveItems = yield* inventory.pipe(
|
|
2323
2276
|
* TxHashMap.filter((product) => product.price > 500)
|
|
2324
2277
|
* )
|
|
2325
2278
|
*
|
|
2326
|
-
*
|
|
2327
|
-
* console.log(expensiveSize) // 2 (laptop and phone)
|
|
2279
|
+
* yield* TxHashMap.size(expensiveItems) // => 2
|
|
2328
2280
|
*
|
|
2329
2281
|
* // Type guard usage
|
|
2330
|
-
*
|
|
2282
|
+
* return yield* TxHashMap.filter(
|
|
2331
2283
|
* inventory,
|
|
2332
2284
|
* (product): product is typeof product & { price: number } =>
|
|
2333
2285
|
* product.price > 50
|
|
2334
2286
|
* )
|
|
2335
2287
|
* })
|
|
2288
|
+
*
|
|
2289
|
+
* await Effect.runPromise(program)
|
|
2336
2290
|
* ```
|
|
2337
2291
|
*
|
|
2338
2292
|
* @category combinators
|
|
@@ -2349,7 +2303,7 @@ export declare const filter: {
|
|
|
2349
2303
|
*
|
|
2350
2304
|
* **Example** (Filtering entries)
|
|
2351
2305
|
*
|
|
2352
|
-
* ```ts
|
|
2306
|
+
* ```ts import.meta.vitest
|
|
2353
2307
|
* import { Effect, TxHashMap } from "effect"
|
|
2354
2308
|
*
|
|
2355
2309
|
* const program = Effect.gen(function*() {
|
|
@@ -2367,24 +2321,24 @@ export declare const filter: {
|
|
|
2367
2321
|
* (product) => product.category === "electronics" && product.stock > 0
|
|
2368
2322
|
* )
|
|
2369
2323
|
*
|
|
2370
|
-
*
|
|
2371
|
-
* console.log(size) // 2 (laptop and mouse)
|
|
2324
|
+
* yield* TxHashMap.size(electronicsInStock) // => 2
|
|
2372
2325
|
*
|
|
2373
2326
|
* // Data-last usage with pipe
|
|
2374
2327
|
* const expensiveItems = yield* inventory.pipe(
|
|
2375
2328
|
* TxHashMap.filter((product) => product.price > 500)
|
|
2376
2329
|
* )
|
|
2377
2330
|
*
|
|
2378
|
-
*
|
|
2379
|
-
* console.log(expensiveSize) // 2 (laptop and phone)
|
|
2331
|
+
* yield* TxHashMap.size(expensiveItems) // => 2
|
|
2380
2332
|
*
|
|
2381
2333
|
* // Type guard usage
|
|
2382
|
-
*
|
|
2334
|
+
* return yield* TxHashMap.filter(
|
|
2383
2335
|
* inventory,
|
|
2384
2336
|
* (product): product is typeof product & { price: number } =>
|
|
2385
2337
|
* product.price > 50
|
|
2386
2338
|
* )
|
|
2387
2339
|
* })
|
|
2340
|
+
*
|
|
2341
|
+
* await Effect.runPromise(program)
|
|
2388
2342
|
* ```
|
|
2389
2343
|
*
|
|
2390
2344
|
* @category combinators
|
|
@@ -2401,7 +2355,7 @@ export declare const filter: {
|
|
|
2401
2355
|
*
|
|
2402
2356
|
* **Example** (Filtering entries)
|
|
2403
2357
|
*
|
|
2404
|
-
* ```ts
|
|
2358
|
+
* ```ts import.meta.vitest
|
|
2405
2359
|
* import { Effect, TxHashMap } from "effect"
|
|
2406
2360
|
*
|
|
2407
2361
|
* const program = Effect.gen(function*() {
|
|
@@ -2419,24 +2373,24 @@ export declare const filter: {
|
|
|
2419
2373
|
* (product) => product.category === "electronics" && product.stock > 0
|
|
2420
2374
|
* )
|
|
2421
2375
|
*
|
|
2422
|
-
*
|
|
2423
|
-
* console.log(size) // 2 (laptop and mouse)
|
|
2376
|
+
* yield* TxHashMap.size(electronicsInStock) // => 2
|
|
2424
2377
|
*
|
|
2425
2378
|
* // Data-last usage with pipe
|
|
2426
2379
|
* const expensiveItems = yield* inventory.pipe(
|
|
2427
2380
|
* TxHashMap.filter((product) => product.price > 500)
|
|
2428
2381
|
* )
|
|
2429
2382
|
*
|
|
2430
|
-
*
|
|
2431
|
-
* console.log(expensiveSize) // 2 (laptop and phone)
|
|
2383
|
+
* yield* TxHashMap.size(expensiveItems) // => 2
|
|
2432
2384
|
*
|
|
2433
2385
|
* // Type guard usage
|
|
2434
|
-
*
|
|
2386
|
+
* return yield* TxHashMap.filter(
|
|
2435
2387
|
* inventory,
|
|
2436
2388
|
* (product): product is typeof product & { price: number } =>
|
|
2437
2389
|
* product.price > 50
|
|
2438
2390
|
* )
|
|
2439
2391
|
* })
|
|
2392
|
+
*
|
|
2393
|
+
* await Effect.runPromise(program)
|
|
2440
2394
|
* ```
|
|
2441
2395
|
*
|
|
2442
2396
|
* @category combinators
|
|
@@ -2453,7 +2407,7 @@ export declare const filter: {
|
|
|
2453
2407
|
*
|
|
2454
2408
|
* **Example** (Filtering entries)
|
|
2455
2409
|
*
|
|
2456
|
-
* ```ts
|
|
2410
|
+
* ```ts import.meta.vitest
|
|
2457
2411
|
* import { Effect, TxHashMap } from "effect"
|
|
2458
2412
|
*
|
|
2459
2413
|
* const program = Effect.gen(function*() {
|
|
@@ -2471,24 +2425,24 @@ export declare const filter: {
|
|
|
2471
2425
|
* (product) => product.category === "electronics" && product.stock > 0
|
|
2472
2426
|
* )
|
|
2473
2427
|
*
|
|
2474
|
-
*
|
|
2475
|
-
* console.log(size) // 2 (laptop and mouse)
|
|
2428
|
+
* yield* TxHashMap.size(electronicsInStock) // => 2
|
|
2476
2429
|
*
|
|
2477
2430
|
* // Data-last usage with pipe
|
|
2478
2431
|
* const expensiveItems = yield* inventory.pipe(
|
|
2479
2432
|
* TxHashMap.filter((product) => product.price > 500)
|
|
2480
2433
|
* )
|
|
2481
2434
|
*
|
|
2482
|
-
*
|
|
2483
|
-
* console.log(expensiveSize) // 2 (laptop and phone)
|
|
2435
|
+
* yield* TxHashMap.size(expensiveItems) // => 2
|
|
2484
2436
|
*
|
|
2485
2437
|
* // Type guard usage
|
|
2486
|
-
*
|
|
2438
|
+
* return yield* TxHashMap.filter(
|
|
2487
2439
|
* inventory,
|
|
2488
2440
|
* (product): product is typeof product & { price: number } =>
|
|
2489
2441
|
* product.price > 50
|
|
2490
2442
|
* )
|
|
2491
2443
|
* })
|
|
2444
|
+
*
|
|
2445
|
+
* await Effect.runPromise(program)
|
|
2492
2446
|
* ```
|
|
2493
2447
|
*
|
|
2494
2448
|
* @category combinators
|
|
@@ -2502,7 +2456,7 @@ export declare const filter: {
|
|
|
2502
2456
|
*
|
|
2503
2457
|
* **Example** (Reducing entries)
|
|
2504
2458
|
*
|
|
2505
|
-
* ```ts
|
|
2459
|
+
* ```ts import.meta.vitest
|
|
2506
2460
|
* import { Effect, TxHashMap } from "effect"
|
|
2507
2461
|
*
|
|
2508
2462
|
* const program = Effect.gen(function*() {
|
|
@@ -2518,12 +2472,9 @@ export declare const filter: {
|
|
|
2518
2472
|
* const totalSales = yield* TxHashMap.reduce(
|
|
2519
2473
|
* sales,
|
|
2520
2474
|
* 0,
|
|
2521
|
-
* (total, amount
|
|
2522
|
-
* console.log(`Adding ${quarter}: ${amount}`)
|
|
2523
|
-
* return total + amount
|
|
2524
|
-
* }
|
|
2475
|
+
* (total, amount) => total + amount
|
|
2525
2476
|
* )
|
|
2526
|
-
*
|
|
2477
|
+
* totalSales // => 80000
|
|
2527
2478
|
*
|
|
2528
2479
|
* // Data-last usage with pipe
|
|
2529
2480
|
* const quarterlyReport = yield* sales.pipe(
|
|
@@ -2536,16 +2487,10 @@ export declare const filter: {
|
|
|
2536
2487
|
* })
|
|
2537
2488
|
* )
|
|
2538
2489
|
* )
|
|
2539
|
-
*
|
|
2540
|
-
*
|
|
2541
|
-
* // Build a summary string
|
|
2542
|
-
* const summary = yield* TxHashMap.reduce(
|
|
2543
|
-
* sales,
|
|
2544
|
-
* "",
|
|
2545
|
-
* (acc, amount, quarter) => acc + `${quarter}: $${amount.toLocaleString()}\n`
|
|
2546
|
-
* )
|
|
2547
|
-
* console.log(summary)
|
|
2490
|
+
* return quarterlyReport
|
|
2548
2491
|
* })
|
|
2492
|
+
*
|
|
2493
|
+
* await Effect.runPromise(program) // => { quarters: 4, total: 80000, max: 25000 }
|
|
2549
2494
|
* ```
|
|
2550
2495
|
*
|
|
2551
2496
|
* @category combinators
|
|
@@ -2558,7 +2503,7 @@ export declare const reduce: {
|
|
|
2558
2503
|
*
|
|
2559
2504
|
* **Example** (Reducing entries)
|
|
2560
2505
|
*
|
|
2561
|
-
* ```ts
|
|
2506
|
+
* ```ts import.meta.vitest
|
|
2562
2507
|
* import { Effect, TxHashMap } from "effect"
|
|
2563
2508
|
*
|
|
2564
2509
|
* const program = Effect.gen(function*() {
|
|
@@ -2574,12 +2519,9 @@ export declare const reduce: {
|
|
|
2574
2519
|
* const totalSales = yield* TxHashMap.reduce(
|
|
2575
2520
|
* sales,
|
|
2576
2521
|
* 0,
|
|
2577
|
-
* (total, amount
|
|
2578
|
-
* console.log(`Adding ${quarter}: ${amount}`)
|
|
2579
|
-
* return total + amount
|
|
2580
|
-
* }
|
|
2522
|
+
* (total, amount) => total + amount
|
|
2581
2523
|
* )
|
|
2582
|
-
*
|
|
2524
|
+
* totalSales // => 80000
|
|
2583
2525
|
*
|
|
2584
2526
|
* // Data-last usage with pipe
|
|
2585
2527
|
* const quarterlyReport = yield* sales.pipe(
|
|
@@ -2592,16 +2534,10 @@ export declare const reduce: {
|
|
|
2592
2534
|
* })
|
|
2593
2535
|
* )
|
|
2594
2536
|
* )
|
|
2595
|
-
*
|
|
2596
|
-
*
|
|
2597
|
-
* // Build a summary string
|
|
2598
|
-
* const summary = yield* TxHashMap.reduce(
|
|
2599
|
-
* sales,
|
|
2600
|
-
* "",
|
|
2601
|
-
* (acc, amount, quarter) => acc + `${quarter}: $${amount.toLocaleString()}\n`
|
|
2602
|
-
* )
|
|
2603
|
-
* console.log(summary)
|
|
2537
|
+
* return quarterlyReport
|
|
2604
2538
|
* })
|
|
2539
|
+
*
|
|
2540
|
+
* await Effect.runPromise(program) // => { quarters: 4, total: 80000, max: 25000 }
|
|
2605
2541
|
* ```
|
|
2606
2542
|
*
|
|
2607
2543
|
* @category combinators
|
|
@@ -2614,7 +2550,7 @@ export declare const reduce: {
|
|
|
2614
2550
|
*
|
|
2615
2551
|
* **Example** (Reducing entries)
|
|
2616
2552
|
*
|
|
2617
|
-
* ```ts
|
|
2553
|
+
* ```ts import.meta.vitest
|
|
2618
2554
|
* import { Effect, TxHashMap } from "effect"
|
|
2619
2555
|
*
|
|
2620
2556
|
* const program = Effect.gen(function*() {
|
|
@@ -2630,12 +2566,9 @@ export declare const reduce: {
|
|
|
2630
2566
|
* const totalSales = yield* TxHashMap.reduce(
|
|
2631
2567
|
* sales,
|
|
2632
2568
|
* 0,
|
|
2633
|
-
* (total, amount
|
|
2634
|
-
* console.log(`Adding ${quarter}: ${amount}`)
|
|
2635
|
-
* return total + amount
|
|
2636
|
-
* }
|
|
2569
|
+
* (total, amount) => total + amount
|
|
2637
2570
|
* )
|
|
2638
|
-
*
|
|
2571
|
+
* totalSales // => 80000
|
|
2639
2572
|
*
|
|
2640
2573
|
* // Data-last usage with pipe
|
|
2641
2574
|
* const quarterlyReport = yield* sales.pipe(
|
|
@@ -2648,16 +2581,10 @@ export declare const reduce: {
|
|
|
2648
2581
|
* })
|
|
2649
2582
|
* )
|
|
2650
2583
|
* )
|
|
2651
|
-
*
|
|
2652
|
-
*
|
|
2653
|
-
* // Build a summary string
|
|
2654
|
-
* const summary = yield* TxHashMap.reduce(
|
|
2655
|
-
* sales,
|
|
2656
|
-
* "",
|
|
2657
|
-
* (acc, amount, quarter) => acc + `${quarter}: $${amount.toLocaleString()}\n`
|
|
2658
|
-
* )
|
|
2659
|
-
* console.log(summary)
|
|
2584
|
+
* return quarterlyReport
|
|
2660
2585
|
* })
|
|
2586
|
+
*
|
|
2587
|
+
* await Effect.runPromise(program) // => { quarters: 4, total: 80000, max: 25000 }
|
|
2661
2588
|
* ```
|
|
2662
2589
|
*
|
|
2663
2590
|
* @category combinators
|
|
@@ -2676,7 +2603,7 @@ export declare const reduce: {
|
|
|
2676
2603
|
*
|
|
2677
2604
|
* **Example** (Filtering and mapping entries)
|
|
2678
2605
|
*
|
|
2679
|
-
* ```ts
|
|
2606
|
+
* ```ts import.meta.vitest
|
|
2680
2607
|
* import { Effect, Option, Result, TxHashMap } from "effect"
|
|
2681
2608
|
*
|
|
2682
2609
|
* const program = Effect.gen(function*() {
|
|
@@ -2704,10 +2631,8 @@ export declare const reduce: {
|
|
|
2704
2631
|
* )
|
|
2705
2632
|
*
|
|
2706
2633
|
* const aliceData = yield* TxHashMap.get(activeAdminAges, "alice")
|
|
2707
|
-
*
|
|
2708
|
-
*
|
|
2709
|
-
* const charlieData = yield* TxHashMap.get(activeAdminAges, "charlie")
|
|
2710
|
-
* console.log(charlieData) // Option.none() (not active)
|
|
2634
|
+
* aliceData // => Option.some({ username: "alice", age: 30, seniority: "senior" })
|
|
2635
|
+
* yield* TxHashMap.get(activeAdminAges, "charlie") // => Option.none()
|
|
2711
2636
|
*
|
|
2712
2637
|
* // Data-last usage with pipe
|
|
2713
2638
|
* const validAges = yield* userData.pipe(
|
|
@@ -2717,9 +2642,10 @@ export declare const reduce: {
|
|
|
2717
2642
|
* })
|
|
2718
2643
|
* )
|
|
2719
2644
|
*
|
|
2720
|
-
*
|
|
2721
|
-
* console.log(size) // 3 (alice, charlie, diana have valid ages)
|
|
2645
|
+
* return yield* TxHashMap.size(validAges)
|
|
2722
2646
|
* })
|
|
2647
|
+
*
|
|
2648
|
+
* await Effect.runPromise(program) // => 3
|
|
2723
2649
|
* ```
|
|
2724
2650
|
*
|
|
2725
2651
|
* @category combinators
|
|
@@ -2737,7 +2663,7 @@ export declare const filterMap: {
|
|
|
2737
2663
|
*
|
|
2738
2664
|
* **Example** (Filtering and mapping entries)
|
|
2739
2665
|
*
|
|
2740
|
-
* ```ts
|
|
2666
|
+
* ```ts import.meta.vitest
|
|
2741
2667
|
* import { Effect, Option, Result, TxHashMap } from "effect"
|
|
2742
2668
|
*
|
|
2743
2669
|
* const program = Effect.gen(function*() {
|
|
@@ -2765,10 +2691,8 @@ export declare const filterMap: {
|
|
|
2765
2691
|
* )
|
|
2766
2692
|
*
|
|
2767
2693
|
* const aliceData = yield* TxHashMap.get(activeAdminAges, "alice")
|
|
2768
|
-
*
|
|
2769
|
-
*
|
|
2770
|
-
* const charlieData = yield* TxHashMap.get(activeAdminAges, "charlie")
|
|
2771
|
-
* console.log(charlieData) // Option.none() (not active)
|
|
2694
|
+
* aliceData // => Option.some({ username: "alice", age: 30, seniority: "senior" })
|
|
2695
|
+
* yield* TxHashMap.get(activeAdminAges, "charlie") // => Option.none()
|
|
2772
2696
|
*
|
|
2773
2697
|
* // Data-last usage with pipe
|
|
2774
2698
|
* const validAges = yield* userData.pipe(
|
|
@@ -2778,9 +2702,10 @@ export declare const filterMap: {
|
|
|
2778
2702
|
* })
|
|
2779
2703
|
* )
|
|
2780
2704
|
*
|
|
2781
|
-
*
|
|
2782
|
-
* console.log(size) // 3 (alice, charlie, diana have valid ages)
|
|
2705
|
+
* return yield* TxHashMap.size(validAges)
|
|
2783
2706
|
* })
|
|
2707
|
+
*
|
|
2708
|
+
* await Effect.runPromise(program) // => 3
|
|
2784
2709
|
* ```
|
|
2785
2710
|
*
|
|
2786
2711
|
* @category combinators
|
|
@@ -2798,7 +2723,7 @@ export declare const filterMap: {
|
|
|
2798
2723
|
*
|
|
2799
2724
|
* **Example** (Filtering and mapping entries)
|
|
2800
2725
|
*
|
|
2801
|
-
* ```ts
|
|
2726
|
+
* ```ts import.meta.vitest
|
|
2802
2727
|
* import { Effect, Option, Result, TxHashMap } from "effect"
|
|
2803
2728
|
*
|
|
2804
2729
|
* const program = Effect.gen(function*() {
|
|
@@ -2826,10 +2751,8 @@ export declare const filterMap: {
|
|
|
2826
2751
|
* )
|
|
2827
2752
|
*
|
|
2828
2753
|
* const aliceData = yield* TxHashMap.get(activeAdminAges, "alice")
|
|
2829
|
-
*
|
|
2830
|
-
*
|
|
2831
|
-
* const charlieData = yield* TxHashMap.get(activeAdminAges, "charlie")
|
|
2832
|
-
* console.log(charlieData) // Option.none() (not active)
|
|
2754
|
+
* aliceData // => Option.some({ username: "alice", age: 30, seniority: "senior" })
|
|
2755
|
+
* yield* TxHashMap.get(activeAdminAges, "charlie") // => Option.none()
|
|
2833
2756
|
*
|
|
2834
2757
|
* // Data-last usage with pipe
|
|
2835
2758
|
* const validAges = yield* userData.pipe(
|
|
@@ -2839,9 +2762,10 @@ export declare const filterMap: {
|
|
|
2839
2762
|
* })
|
|
2840
2763
|
* )
|
|
2841
2764
|
*
|
|
2842
|
-
*
|
|
2843
|
-
* console.log(size) // 3 (alice, charlie, diana have valid ages)
|
|
2765
|
+
* return yield* TxHashMap.size(validAges)
|
|
2844
2766
|
* })
|
|
2767
|
+
*
|
|
2768
|
+
* await Effect.runPromise(program) // => 3
|
|
2845
2769
|
* ```
|
|
2846
2770
|
*
|
|
2847
2771
|
* @category combinators
|
|
@@ -2854,7 +2778,7 @@ export declare const filterMap: {
|
|
|
2854
2778
|
*
|
|
2855
2779
|
* **Example** (Checking entries with a predicate)
|
|
2856
2780
|
*
|
|
2857
|
-
* ```ts
|
|
2781
|
+
* ```ts import.meta.vitest
|
|
2858
2782
|
* import { Effect, TxHashMap } from "effect"
|
|
2859
2783
|
*
|
|
2860
2784
|
* const program = Effect.gen(function*() {
|
|
@@ -2867,28 +2791,27 @@ export declare const filterMap: {
|
|
|
2867
2791
|
* )
|
|
2868
2792
|
*
|
|
2869
2793
|
* // Check if any users are online
|
|
2870
|
-
*
|
|
2794
|
+
* yield* TxHashMap.hasBy(
|
|
2871
2795
|
* userStatuses,
|
|
2872
2796
|
* (user) => user.status === "online"
|
|
2873
|
-
* )
|
|
2874
|
-
* console.log(hasOnlineUsers) // true
|
|
2797
|
+
* ) // => true
|
|
2875
2798
|
*
|
|
2876
2799
|
* // Check if any users have specific username pattern
|
|
2877
|
-
*
|
|
2800
|
+
* yield* TxHashMap.hasBy(
|
|
2878
2801
|
* userStatuses,
|
|
2879
2802
|
* (user, username) => username.startsWith("admin")
|
|
2880
|
-
* )
|
|
2881
|
-
* console.log(hasAdminUser) // false
|
|
2803
|
+
* ) // => false
|
|
2882
2804
|
*
|
|
2883
2805
|
* // Data-last usage with pipe
|
|
2884
|
-
*
|
|
2806
|
+
* return yield* userStatuses.pipe(
|
|
2885
2807
|
* TxHashMap.hasBy((user) => currentTime - user.lastSeen < 1_800_000) // 30 minutes
|
|
2886
2808
|
* )
|
|
2887
|
-
* console.log(hasRecentActivity) // true
|
|
2888
2809
|
* })
|
|
2810
|
+
*
|
|
2811
|
+
* await Effect.runPromise(program) // => true
|
|
2889
2812
|
* ```
|
|
2890
2813
|
*
|
|
2891
|
-
* @category
|
|
2814
|
+
* @category predicates
|
|
2892
2815
|
* @since 4.0.0
|
|
2893
2816
|
*/
|
|
2894
2817
|
export declare const hasBy: {
|
|
@@ -2897,7 +2820,7 @@ export declare const hasBy: {
|
|
|
2897
2820
|
*
|
|
2898
2821
|
* **Example** (Checking entries with a predicate)
|
|
2899
2822
|
*
|
|
2900
|
-
* ```ts
|
|
2823
|
+
* ```ts import.meta.vitest
|
|
2901
2824
|
* import { Effect, TxHashMap } from "effect"
|
|
2902
2825
|
*
|
|
2903
2826
|
* const program = Effect.gen(function*() {
|
|
@@ -2910,28 +2833,27 @@ export declare const hasBy: {
|
|
|
2910
2833
|
* )
|
|
2911
2834
|
*
|
|
2912
2835
|
* // Check if any users are online
|
|
2913
|
-
*
|
|
2836
|
+
* yield* TxHashMap.hasBy(
|
|
2914
2837
|
* userStatuses,
|
|
2915
2838
|
* (user) => user.status === "online"
|
|
2916
|
-
* )
|
|
2917
|
-
* console.log(hasOnlineUsers) // true
|
|
2839
|
+
* ) // => true
|
|
2918
2840
|
*
|
|
2919
2841
|
* // Check if any users have specific username pattern
|
|
2920
|
-
*
|
|
2842
|
+
* yield* TxHashMap.hasBy(
|
|
2921
2843
|
* userStatuses,
|
|
2922
2844
|
* (user, username) => username.startsWith("admin")
|
|
2923
|
-
* )
|
|
2924
|
-
* console.log(hasAdminUser) // false
|
|
2845
|
+
* ) // => false
|
|
2925
2846
|
*
|
|
2926
2847
|
* // Data-last usage with pipe
|
|
2927
|
-
*
|
|
2848
|
+
* return yield* userStatuses.pipe(
|
|
2928
2849
|
* TxHashMap.hasBy((user) => currentTime - user.lastSeen < 1_800_000) // 30 minutes
|
|
2929
2850
|
* )
|
|
2930
|
-
* console.log(hasRecentActivity) // true
|
|
2931
2851
|
* })
|
|
2852
|
+
*
|
|
2853
|
+
* await Effect.runPromise(program) // => true
|
|
2932
2854
|
* ```
|
|
2933
2855
|
*
|
|
2934
|
-
* @category
|
|
2856
|
+
* @category predicates
|
|
2935
2857
|
* @since 4.0.0
|
|
2936
2858
|
*/
|
|
2937
2859
|
<K, V>(predicate: (value: V, key: K) => boolean): (self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -2940,7 +2862,7 @@ export declare const hasBy: {
|
|
|
2940
2862
|
*
|
|
2941
2863
|
* **Example** (Checking entries with a predicate)
|
|
2942
2864
|
*
|
|
2943
|
-
* ```ts
|
|
2865
|
+
* ```ts import.meta.vitest
|
|
2944
2866
|
* import { Effect, TxHashMap } from "effect"
|
|
2945
2867
|
*
|
|
2946
2868
|
* const program = Effect.gen(function*() {
|
|
@@ -2953,28 +2875,27 @@ export declare const hasBy: {
|
|
|
2953
2875
|
* )
|
|
2954
2876
|
*
|
|
2955
2877
|
* // Check if any users are online
|
|
2956
|
-
*
|
|
2878
|
+
* yield* TxHashMap.hasBy(
|
|
2957
2879
|
* userStatuses,
|
|
2958
2880
|
* (user) => user.status === "online"
|
|
2959
|
-
* )
|
|
2960
|
-
* console.log(hasOnlineUsers) // true
|
|
2881
|
+
* ) // => true
|
|
2961
2882
|
*
|
|
2962
2883
|
* // Check if any users have specific username pattern
|
|
2963
|
-
*
|
|
2884
|
+
* yield* TxHashMap.hasBy(
|
|
2964
2885
|
* userStatuses,
|
|
2965
2886
|
* (user, username) => username.startsWith("admin")
|
|
2966
|
-
* )
|
|
2967
|
-
* console.log(hasAdminUser) // false
|
|
2887
|
+
* ) // => false
|
|
2968
2888
|
*
|
|
2969
2889
|
* // Data-last usage with pipe
|
|
2970
|
-
*
|
|
2890
|
+
* return yield* userStatuses.pipe(
|
|
2971
2891
|
* TxHashMap.hasBy((user) => currentTime - user.lastSeen < 1_800_000) // 30 minutes
|
|
2972
2892
|
* )
|
|
2973
|
-
* console.log(hasRecentActivity) // true
|
|
2974
2893
|
* })
|
|
2894
|
+
*
|
|
2895
|
+
* await Effect.runPromise(program) // => true
|
|
2975
2896
|
* ```
|
|
2976
2897
|
*
|
|
2977
|
-
* @category
|
|
2898
|
+
* @category predicates
|
|
2978
2899
|
* @since 4.0.0
|
|
2979
2900
|
*/
|
|
2980
2901
|
<K, V>(self: TxHashMap<K, V>, predicate: (value: V, key: K) => boolean): Effect.Effect<boolean>;
|
|
@@ -2985,8 +2906,8 @@ export declare const hasBy: {
|
|
|
2985
2906
|
*
|
|
2986
2907
|
* **Example** (Finding the first matching entry)
|
|
2987
2908
|
*
|
|
2988
|
-
* ```ts
|
|
2989
|
-
* import { Effect, TxHashMap } from "effect"
|
|
2909
|
+
* ```ts import.meta.vitest
|
|
2910
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
2990
2911
|
*
|
|
2991
2912
|
* const program = Effect.gen(function*() {
|
|
2992
2913
|
* // Create a task priority map
|
|
@@ -3002,21 +2923,15 @@ export declare const hasBy: {
|
|
|
3002
2923
|
* (task) => task.priority >= 2 && !task.completed
|
|
3003
2924
|
* )
|
|
3004
2925
|
*
|
|
3005
|
-
*
|
|
3006
|
-
* const [taskId, task] = highPriorityTask.value
|
|
3007
|
-
* console.log(`Found task: ${taskId}, priority: ${task.priority}`)
|
|
3008
|
-
* // "Found task: task3, priority: 2"
|
|
3009
|
-
* }
|
|
2926
|
+
* highPriorityTask // => Option.some(["task3", { priority: 2, assignee: "alice", completed: false }])
|
|
3010
2927
|
*
|
|
3011
2928
|
* // Find first task assigned to specific user
|
|
3012
|
-
*
|
|
2929
|
+
* return yield* tasks.pipe(
|
|
3013
2930
|
* TxHashMap.findFirst((task) => task.assignee === "alice")
|
|
3014
2931
|
* )
|
|
3015
|
-
*
|
|
3016
|
-
* if (aliceTask._tag === "Some") {
|
|
3017
|
-
* console.log(`Alice's task: ${aliceTask.value[0]}`)
|
|
3018
|
-
* }
|
|
3019
2932
|
* })
|
|
2933
|
+
*
|
|
2934
|
+
* await Effect.runPromise(program) // => Option.some(["task1", { priority: 1, assignee: "alice", completed: false }])
|
|
3020
2935
|
* ```
|
|
3021
2936
|
*
|
|
3022
2937
|
* @category combinators
|
|
@@ -3029,8 +2944,8 @@ export declare const findFirst: {
|
|
|
3029
2944
|
*
|
|
3030
2945
|
* **Example** (Finding the first matching entry)
|
|
3031
2946
|
*
|
|
3032
|
-
* ```ts
|
|
3033
|
-
* import { Effect, TxHashMap } from "effect"
|
|
2947
|
+
* ```ts import.meta.vitest
|
|
2948
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
3034
2949
|
*
|
|
3035
2950
|
* const program = Effect.gen(function*() {
|
|
3036
2951
|
* // Create a task priority map
|
|
@@ -3046,21 +2961,15 @@ export declare const findFirst: {
|
|
|
3046
2961
|
* (task) => task.priority >= 2 && !task.completed
|
|
3047
2962
|
* )
|
|
3048
2963
|
*
|
|
3049
|
-
*
|
|
3050
|
-
* const [taskId, task] = highPriorityTask.value
|
|
3051
|
-
* console.log(`Found task: ${taskId}, priority: ${task.priority}`)
|
|
3052
|
-
* // "Found task: task3, priority: 2"
|
|
3053
|
-
* }
|
|
2964
|
+
* highPriorityTask // => Option.some(["task3", { priority: 2, assignee: "alice", completed: false }])
|
|
3054
2965
|
*
|
|
3055
2966
|
* // Find first task assigned to specific user
|
|
3056
|
-
*
|
|
2967
|
+
* return yield* tasks.pipe(
|
|
3057
2968
|
* TxHashMap.findFirst((task) => task.assignee === "alice")
|
|
3058
2969
|
* )
|
|
3059
|
-
*
|
|
3060
|
-
* if (aliceTask._tag === "Some") {
|
|
3061
|
-
* console.log(`Alice's task: ${aliceTask.value[0]}`)
|
|
3062
|
-
* }
|
|
3063
2970
|
* })
|
|
2971
|
+
*
|
|
2972
|
+
* await Effect.runPromise(program) // => Option.some(["task1", { priority: 1, assignee: "alice", completed: false }])
|
|
3064
2973
|
* ```
|
|
3065
2974
|
*
|
|
3066
2975
|
* @category combinators
|
|
@@ -3073,8 +2982,8 @@ export declare const findFirst: {
|
|
|
3073
2982
|
*
|
|
3074
2983
|
* **Example** (Finding the first matching entry)
|
|
3075
2984
|
*
|
|
3076
|
-
* ```ts
|
|
3077
|
-
* import { Effect, TxHashMap } from "effect"
|
|
2985
|
+
* ```ts import.meta.vitest
|
|
2986
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
3078
2987
|
*
|
|
3079
2988
|
* const program = Effect.gen(function*() {
|
|
3080
2989
|
* // Create a task priority map
|
|
@@ -3090,21 +2999,15 @@ export declare const findFirst: {
|
|
|
3090
2999
|
* (task) => task.priority >= 2 && !task.completed
|
|
3091
3000
|
* )
|
|
3092
3001
|
*
|
|
3093
|
-
*
|
|
3094
|
-
* const [taskId, task] = highPriorityTask.value
|
|
3095
|
-
* console.log(`Found task: ${taskId}, priority: ${task.priority}`)
|
|
3096
|
-
* // "Found task: task3, priority: 2"
|
|
3097
|
-
* }
|
|
3002
|
+
* highPriorityTask // => Option.some(["task3", { priority: 2, assignee: "alice", completed: false }])
|
|
3098
3003
|
*
|
|
3099
3004
|
* // Find first task assigned to specific user
|
|
3100
|
-
*
|
|
3005
|
+
* return yield* tasks.pipe(
|
|
3101
3006
|
* TxHashMap.findFirst((task) => task.assignee === "alice")
|
|
3102
3007
|
* )
|
|
3103
|
-
*
|
|
3104
|
-
* if (aliceTask._tag === "Some") {
|
|
3105
|
-
* console.log(`Alice's task: ${aliceTask.value[0]}`)
|
|
3106
|
-
* }
|
|
3107
3008
|
* })
|
|
3009
|
+
*
|
|
3010
|
+
* await Effect.runPromise(program) // => Option.some(["task1", { priority: 1, assignee: "alice", completed: false }])
|
|
3108
3011
|
* ```
|
|
3109
3012
|
*
|
|
3110
3013
|
* @category combinators
|
|
@@ -3117,7 +3020,7 @@ export declare const findFirst: {
|
|
|
3117
3020
|
*
|
|
3118
3021
|
* **Example** (Checking whether some entries match)
|
|
3119
3022
|
*
|
|
3120
|
-
* ```ts
|
|
3023
|
+
* ```ts import.meta.vitest
|
|
3121
3024
|
* import { Effect, TxHashMap } from "effect"
|
|
3122
3025
|
*
|
|
3123
3026
|
* const program = Effect.gen(function*() {
|
|
@@ -3129,28 +3032,27 @@ export declare const findFirst: {
|
|
|
3129
3032
|
* )
|
|
3130
3033
|
*
|
|
3131
3034
|
* // Check if any products are expensive
|
|
3132
|
-
*
|
|
3035
|
+
* yield* TxHashMap.some(
|
|
3133
3036
|
* inventory,
|
|
3134
3037
|
* (product) => product.price > 500
|
|
3135
|
-
* )
|
|
3136
|
-
* console.log(hasExpensiveProducts) // true
|
|
3038
|
+
* ) // => true
|
|
3137
3039
|
*
|
|
3138
3040
|
* // Check if any products are out of stock
|
|
3139
|
-
*
|
|
3041
|
+
* yield* TxHashMap.some(
|
|
3140
3042
|
* inventory,
|
|
3141
3043
|
* (product) => product.stock === 0
|
|
3142
|
-
* )
|
|
3143
|
-
* console.log(hasOutOfStock) // true
|
|
3044
|
+
* ) // => true
|
|
3144
3045
|
*
|
|
3145
3046
|
* // Data-last usage with pipe
|
|
3146
|
-
*
|
|
3047
|
+
* return yield* inventory.pipe(
|
|
3147
3048
|
* TxHashMap.some((product) => product.price < 50)
|
|
3148
3049
|
* )
|
|
3149
|
-
* console.log(hasAffordableItems) // true (mouse is $29)
|
|
3150
3050
|
* })
|
|
3051
|
+
*
|
|
3052
|
+
* await Effect.runPromise(program) // => true
|
|
3151
3053
|
* ```
|
|
3152
3054
|
*
|
|
3153
|
-
* @category
|
|
3055
|
+
* @category predicates
|
|
3154
3056
|
* @since 4.0.0
|
|
3155
3057
|
*/
|
|
3156
3058
|
export declare const some: {
|
|
@@ -3159,7 +3061,7 @@ export declare const some: {
|
|
|
3159
3061
|
*
|
|
3160
3062
|
* **Example** (Checking whether some entries match)
|
|
3161
3063
|
*
|
|
3162
|
-
* ```ts
|
|
3064
|
+
* ```ts import.meta.vitest
|
|
3163
3065
|
* import { Effect, TxHashMap } from "effect"
|
|
3164
3066
|
*
|
|
3165
3067
|
* const program = Effect.gen(function*() {
|
|
@@ -3171,28 +3073,27 @@ export declare const some: {
|
|
|
3171
3073
|
* )
|
|
3172
3074
|
*
|
|
3173
3075
|
* // Check if any products are expensive
|
|
3174
|
-
*
|
|
3076
|
+
* yield* TxHashMap.some(
|
|
3175
3077
|
* inventory,
|
|
3176
3078
|
* (product) => product.price > 500
|
|
3177
|
-
* )
|
|
3178
|
-
* console.log(hasExpensiveProducts) // true
|
|
3079
|
+
* ) // => true
|
|
3179
3080
|
*
|
|
3180
3081
|
* // Check if any products are out of stock
|
|
3181
|
-
*
|
|
3082
|
+
* yield* TxHashMap.some(
|
|
3182
3083
|
* inventory,
|
|
3183
3084
|
* (product) => product.stock === 0
|
|
3184
|
-
* )
|
|
3185
|
-
* console.log(hasOutOfStock) // true
|
|
3085
|
+
* ) // => true
|
|
3186
3086
|
*
|
|
3187
3087
|
* // Data-last usage with pipe
|
|
3188
|
-
*
|
|
3088
|
+
* return yield* inventory.pipe(
|
|
3189
3089
|
* TxHashMap.some((product) => product.price < 50)
|
|
3190
3090
|
* )
|
|
3191
|
-
* console.log(hasAffordableItems) // true (mouse is $29)
|
|
3192
3091
|
* })
|
|
3092
|
+
*
|
|
3093
|
+
* await Effect.runPromise(program) // => true
|
|
3193
3094
|
* ```
|
|
3194
3095
|
*
|
|
3195
|
-
* @category
|
|
3096
|
+
* @category predicates
|
|
3196
3097
|
* @since 4.0.0
|
|
3197
3098
|
*/
|
|
3198
3099
|
<K, V>(predicate: (value: V, key: K) => boolean): (self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -3201,7 +3102,7 @@ export declare const some: {
|
|
|
3201
3102
|
*
|
|
3202
3103
|
* **Example** (Checking whether some entries match)
|
|
3203
3104
|
*
|
|
3204
|
-
* ```ts
|
|
3105
|
+
* ```ts import.meta.vitest
|
|
3205
3106
|
* import { Effect, TxHashMap } from "effect"
|
|
3206
3107
|
*
|
|
3207
3108
|
* const program = Effect.gen(function*() {
|
|
@@ -3213,28 +3114,27 @@ export declare const some: {
|
|
|
3213
3114
|
* )
|
|
3214
3115
|
*
|
|
3215
3116
|
* // Check if any products are expensive
|
|
3216
|
-
*
|
|
3117
|
+
* yield* TxHashMap.some(
|
|
3217
3118
|
* inventory,
|
|
3218
3119
|
* (product) => product.price > 500
|
|
3219
|
-
* )
|
|
3220
|
-
* console.log(hasExpensiveProducts) // true
|
|
3120
|
+
* ) // => true
|
|
3221
3121
|
*
|
|
3222
3122
|
* // Check if any products are out of stock
|
|
3223
|
-
*
|
|
3123
|
+
* yield* TxHashMap.some(
|
|
3224
3124
|
* inventory,
|
|
3225
3125
|
* (product) => product.stock === 0
|
|
3226
|
-
* )
|
|
3227
|
-
* console.log(hasOutOfStock) // true
|
|
3126
|
+
* ) // => true
|
|
3228
3127
|
*
|
|
3229
3128
|
* // Data-last usage with pipe
|
|
3230
|
-
*
|
|
3129
|
+
* return yield* inventory.pipe(
|
|
3231
3130
|
* TxHashMap.some((product) => product.price < 50)
|
|
3232
3131
|
* )
|
|
3233
|
-
* console.log(hasAffordableItems) // true (mouse is $29)
|
|
3234
3132
|
* })
|
|
3133
|
+
*
|
|
3134
|
+
* await Effect.runPromise(program) // => true
|
|
3235
3135
|
* ```
|
|
3236
3136
|
*
|
|
3237
|
-
* @category
|
|
3137
|
+
* @category predicates
|
|
3238
3138
|
* @since 4.0.0
|
|
3239
3139
|
*/
|
|
3240
3140
|
<K, V>(self: TxHashMap<K, V>, predicate: (value: V, key: K) => boolean): Effect.Effect<boolean>;
|
|
@@ -3244,7 +3144,7 @@ export declare const some: {
|
|
|
3244
3144
|
*
|
|
3245
3145
|
* **Example** (Checking whether every entry matches)
|
|
3246
3146
|
*
|
|
3247
|
-
* ```ts
|
|
3147
|
+
* ```ts import.meta.vitest
|
|
3248
3148
|
* import { Effect, TxHashMap } from "effect"
|
|
3249
3149
|
*
|
|
3250
3150
|
* const program = Effect.gen(function*() {
|
|
@@ -3256,28 +3156,27 @@ export declare const some: {
|
|
|
3256
3156
|
* )
|
|
3257
3157
|
*
|
|
3258
3158
|
* // Check if all users can read
|
|
3259
|
-
*
|
|
3159
|
+
* yield* TxHashMap.every(
|
|
3260
3160
|
* permissions,
|
|
3261
3161
|
* (perms) => perms.canRead
|
|
3262
|
-
* )
|
|
3263
|
-
* console.log(allCanRead) // true
|
|
3162
|
+
* ) // => true
|
|
3264
3163
|
*
|
|
3265
3164
|
* // Check if all users can write
|
|
3266
|
-
*
|
|
3165
|
+
* yield* TxHashMap.every(
|
|
3267
3166
|
* permissions,
|
|
3268
3167
|
* (perms) => perms.canWrite
|
|
3269
|
-
* )
|
|
3270
|
-
* console.log(allCanWrite) // false
|
|
3168
|
+
* ) // => false
|
|
3271
3169
|
*
|
|
3272
3170
|
* // Data-last usage with pipe
|
|
3273
|
-
*
|
|
3171
|
+
* return yield* permissions.pipe(
|
|
3274
3172
|
* TxHashMap.every((perms, username) => perms.canRead && username.length > 2)
|
|
3275
3173
|
* )
|
|
3276
|
-
* console.log(allHaveBasicAccess) // true
|
|
3277
3174
|
* })
|
|
3175
|
+
*
|
|
3176
|
+
* await Effect.runPromise(program) // => true
|
|
3278
3177
|
* ```
|
|
3279
3178
|
*
|
|
3280
|
-
* @category
|
|
3179
|
+
* @category predicates
|
|
3281
3180
|
* @since 4.0.0
|
|
3282
3181
|
*/
|
|
3283
3182
|
export declare const every: {
|
|
@@ -3286,7 +3185,7 @@ export declare const every: {
|
|
|
3286
3185
|
*
|
|
3287
3186
|
* **Example** (Checking whether every entry matches)
|
|
3288
3187
|
*
|
|
3289
|
-
* ```ts
|
|
3188
|
+
* ```ts import.meta.vitest
|
|
3290
3189
|
* import { Effect, TxHashMap } from "effect"
|
|
3291
3190
|
*
|
|
3292
3191
|
* const program = Effect.gen(function*() {
|
|
@@ -3298,28 +3197,27 @@ export declare const every: {
|
|
|
3298
3197
|
* )
|
|
3299
3198
|
*
|
|
3300
3199
|
* // Check if all users can read
|
|
3301
|
-
*
|
|
3200
|
+
* yield* TxHashMap.every(
|
|
3302
3201
|
* permissions,
|
|
3303
3202
|
* (perms) => perms.canRead
|
|
3304
|
-
* )
|
|
3305
|
-
* console.log(allCanRead) // true
|
|
3203
|
+
* ) // => true
|
|
3306
3204
|
*
|
|
3307
3205
|
* // Check if all users can write
|
|
3308
|
-
*
|
|
3206
|
+
* yield* TxHashMap.every(
|
|
3309
3207
|
* permissions,
|
|
3310
3208
|
* (perms) => perms.canWrite
|
|
3311
|
-
* )
|
|
3312
|
-
* console.log(allCanWrite) // false
|
|
3209
|
+
* ) // => false
|
|
3313
3210
|
*
|
|
3314
3211
|
* // Data-last usage with pipe
|
|
3315
|
-
*
|
|
3212
|
+
* return yield* permissions.pipe(
|
|
3316
3213
|
* TxHashMap.every((perms, username) => perms.canRead && username.length > 2)
|
|
3317
3214
|
* )
|
|
3318
|
-
* console.log(allHaveBasicAccess) // true
|
|
3319
3215
|
* })
|
|
3216
|
+
*
|
|
3217
|
+
* await Effect.runPromise(program) // => true
|
|
3320
3218
|
* ```
|
|
3321
3219
|
*
|
|
3322
|
-
* @category
|
|
3220
|
+
* @category predicates
|
|
3323
3221
|
* @since 4.0.0
|
|
3324
3222
|
*/
|
|
3325
3223
|
<K, V>(predicate: (value: V, key: K) => boolean): (self: TxHashMap<K, V>) => Effect.Effect<boolean>;
|
|
@@ -3328,7 +3226,7 @@ export declare const every: {
|
|
|
3328
3226
|
*
|
|
3329
3227
|
* **Example** (Checking whether every entry matches)
|
|
3330
3228
|
*
|
|
3331
|
-
* ```ts
|
|
3229
|
+
* ```ts import.meta.vitest
|
|
3332
3230
|
* import { Effect, TxHashMap } from "effect"
|
|
3333
3231
|
*
|
|
3334
3232
|
* const program = Effect.gen(function*() {
|
|
@@ -3340,28 +3238,27 @@ export declare const every: {
|
|
|
3340
3238
|
* )
|
|
3341
3239
|
*
|
|
3342
3240
|
* // Check if all users can read
|
|
3343
|
-
*
|
|
3241
|
+
* yield* TxHashMap.every(
|
|
3344
3242
|
* permissions,
|
|
3345
3243
|
* (perms) => perms.canRead
|
|
3346
|
-
* )
|
|
3347
|
-
* console.log(allCanRead) // true
|
|
3244
|
+
* ) // => true
|
|
3348
3245
|
*
|
|
3349
3246
|
* // Check if all users can write
|
|
3350
|
-
*
|
|
3247
|
+
* yield* TxHashMap.every(
|
|
3351
3248
|
* permissions,
|
|
3352
3249
|
* (perms) => perms.canWrite
|
|
3353
|
-
* )
|
|
3354
|
-
* console.log(allCanWrite) // false
|
|
3250
|
+
* ) // => false
|
|
3355
3251
|
*
|
|
3356
3252
|
* // Data-last usage with pipe
|
|
3357
|
-
*
|
|
3253
|
+
* return yield* permissions.pipe(
|
|
3358
3254
|
* TxHashMap.every((perms, username) => perms.canRead && username.length > 2)
|
|
3359
3255
|
* )
|
|
3360
|
-
* console.log(allHaveBasicAccess) // true
|
|
3361
3256
|
* })
|
|
3257
|
+
*
|
|
3258
|
+
* await Effect.runPromise(program) // => true
|
|
3362
3259
|
* ```
|
|
3363
3260
|
*
|
|
3364
|
-
* @category
|
|
3261
|
+
* @category predicates
|
|
3365
3262
|
* @since 4.0.0
|
|
3366
3263
|
*/
|
|
3367
3264
|
<K, V>(self: TxHashMap<K, V>, predicate: (value: V, key: K) => boolean): Effect.Effect<boolean>;
|
|
@@ -3372,8 +3269,8 @@ export declare const every: {
|
|
|
3372
3269
|
*
|
|
3373
3270
|
* **Example** (Running effects for each entry)
|
|
3374
3271
|
*
|
|
3375
|
-
* ```ts
|
|
3376
|
-
* import {
|
|
3272
|
+
* ```ts import.meta.vitest
|
|
3273
|
+
* import { Effect, TxHashMap } from "effect"
|
|
3377
3274
|
*
|
|
3378
3275
|
* const program = Effect.gen(function*() {
|
|
3379
3276
|
* // Create a log processing map
|
|
@@ -3383,26 +3280,17 @@ export declare const every: {
|
|
|
3383
3280
|
* ["debug.log", { size: 512, level: "debug" }]
|
|
3384
3281
|
* )
|
|
3385
3282
|
*
|
|
3386
|
-
*
|
|
3283
|
+
* const messages: Array<string> = []
|
|
3387
3284
|
* yield* TxHashMap.forEach(logs, (logInfo, filename) =>
|
|
3388
|
-
* Effect.
|
|
3389
|
-
*
|
|
3390
|
-
* `Processing ${filename}: ${logInfo.size} bytes, level: ${logInfo.level}`
|
|
3391
|
-
* )
|
|
3392
|
-
* if (logInfo.level === "error") {
|
|
3393
|
-
* yield* Console.log(`⚠️ Error log detected: ${filename}`)
|
|
3394
|
-
* }
|
|
3285
|
+
* Effect.sync(() => {
|
|
3286
|
+
* messages.push(`${filename}: ${logInfo.size} bytes (${logInfo.level})`)
|
|
3395
3287
|
* }))
|
|
3396
3288
|
*
|
|
3397
|
-
*
|
|
3398
|
-
* yield* logs.pipe(
|
|
3399
|
-
* TxHashMap.forEach((logInfo) =>
|
|
3400
|
-
* logInfo.size > 1000
|
|
3401
|
-
* ? Console.log(`Large log file: ${logInfo.size} bytes`)
|
|
3402
|
-
* : Effect.void
|
|
3403
|
-
* )
|
|
3404
|
-
* )
|
|
3289
|
+
* return messages.sort()
|
|
3405
3290
|
* })
|
|
3291
|
+
*
|
|
3292
|
+
* const result = await Effect.runPromise(program)
|
|
3293
|
+
* result // => ["access.log: 2048 bytes (info)", "debug.log: 512 bytes (debug)", "error.log: 1024 bytes (error)"]
|
|
3406
3294
|
* ```
|
|
3407
3295
|
*
|
|
3408
3296
|
* @category combinators
|
|
@@ -3415,8 +3303,8 @@ export declare const forEach: {
|
|
|
3415
3303
|
*
|
|
3416
3304
|
* **Example** (Running effects for each entry)
|
|
3417
3305
|
*
|
|
3418
|
-
* ```ts
|
|
3419
|
-
* import {
|
|
3306
|
+
* ```ts import.meta.vitest
|
|
3307
|
+
* import { Effect, TxHashMap } from "effect"
|
|
3420
3308
|
*
|
|
3421
3309
|
* const program = Effect.gen(function*() {
|
|
3422
3310
|
* // Create a log processing map
|
|
@@ -3426,26 +3314,17 @@ export declare const forEach: {
|
|
|
3426
3314
|
* ["debug.log", { size: 512, level: "debug" }]
|
|
3427
3315
|
* )
|
|
3428
3316
|
*
|
|
3429
|
-
*
|
|
3317
|
+
* const messages: Array<string> = []
|
|
3430
3318
|
* yield* TxHashMap.forEach(logs, (logInfo, filename) =>
|
|
3431
|
-
* Effect.
|
|
3432
|
-
*
|
|
3433
|
-
* `Processing ${filename}: ${logInfo.size} bytes, level: ${logInfo.level}`
|
|
3434
|
-
* )
|
|
3435
|
-
* if (logInfo.level === "error") {
|
|
3436
|
-
* yield* Console.log(`⚠️ Error log detected: ${filename}`)
|
|
3437
|
-
* }
|
|
3319
|
+
* Effect.sync(() => {
|
|
3320
|
+
* messages.push(`${filename}: ${logInfo.size} bytes (${logInfo.level})`)
|
|
3438
3321
|
* }))
|
|
3439
3322
|
*
|
|
3440
|
-
*
|
|
3441
|
-
* yield* logs.pipe(
|
|
3442
|
-
* TxHashMap.forEach((logInfo) =>
|
|
3443
|
-
* logInfo.size > 1000
|
|
3444
|
-
* ? Console.log(`Large log file: ${logInfo.size} bytes`)
|
|
3445
|
-
* : Effect.void
|
|
3446
|
-
* )
|
|
3447
|
-
* )
|
|
3323
|
+
* return messages.sort()
|
|
3448
3324
|
* })
|
|
3325
|
+
*
|
|
3326
|
+
* const result = await Effect.runPromise(program)
|
|
3327
|
+
* result // => ["access.log: 2048 bytes (info)", "debug.log: 512 bytes (debug)", "error.log: 1024 bytes (error)"]
|
|
3449
3328
|
* ```
|
|
3450
3329
|
*
|
|
3451
3330
|
* @category combinators
|
|
@@ -3458,8 +3337,8 @@ export declare const forEach: {
|
|
|
3458
3337
|
*
|
|
3459
3338
|
* **Example** (Running effects for each entry)
|
|
3460
3339
|
*
|
|
3461
|
-
* ```ts
|
|
3462
|
-
* import {
|
|
3340
|
+
* ```ts import.meta.vitest
|
|
3341
|
+
* import { Effect, TxHashMap } from "effect"
|
|
3463
3342
|
*
|
|
3464
3343
|
* const program = Effect.gen(function*() {
|
|
3465
3344
|
* // Create a log processing map
|
|
@@ -3469,26 +3348,17 @@ export declare const forEach: {
|
|
|
3469
3348
|
* ["debug.log", { size: 512, level: "debug" }]
|
|
3470
3349
|
* )
|
|
3471
3350
|
*
|
|
3472
|
-
*
|
|
3351
|
+
* const messages: Array<string> = []
|
|
3473
3352
|
* yield* TxHashMap.forEach(logs, (logInfo, filename) =>
|
|
3474
|
-
* Effect.
|
|
3475
|
-
*
|
|
3476
|
-
* `Processing ${filename}: ${logInfo.size} bytes, level: ${logInfo.level}`
|
|
3477
|
-
* )
|
|
3478
|
-
* if (logInfo.level === "error") {
|
|
3479
|
-
* yield* Console.log(`⚠️ Error log detected: ${filename}`)
|
|
3480
|
-
* }
|
|
3353
|
+
* Effect.sync(() => {
|
|
3354
|
+
* messages.push(`${filename}: ${logInfo.size} bytes (${logInfo.level})`)
|
|
3481
3355
|
* }))
|
|
3482
3356
|
*
|
|
3483
|
-
*
|
|
3484
|
-
* yield* logs.pipe(
|
|
3485
|
-
* TxHashMap.forEach((logInfo) =>
|
|
3486
|
-
* logInfo.size > 1000
|
|
3487
|
-
* ? Console.log(`Large log file: ${logInfo.size} bytes`)
|
|
3488
|
-
* : Effect.void
|
|
3489
|
-
* )
|
|
3490
|
-
* )
|
|
3357
|
+
* return messages.sort()
|
|
3491
3358
|
* })
|
|
3359
|
+
*
|
|
3360
|
+
* const result = await Effect.runPromise(program)
|
|
3361
|
+
* result // => ["access.log: 2048 bytes (info)", "debug.log: 512 bytes (debug)", "error.log: 1024 bytes (error)"]
|
|
3492
3362
|
* ```
|
|
3493
3363
|
*
|
|
3494
3364
|
* @category combinators
|
|
@@ -3506,8 +3376,8 @@ export declare const forEach: {
|
|
|
3506
3376
|
*
|
|
3507
3377
|
* **Example** (Flat mapping entries)
|
|
3508
3378
|
*
|
|
3509
|
-
* ```ts
|
|
3510
|
-
* import { Effect, TxHashMap } from "effect"
|
|
3379
|
+
* ```ts import.meta.vitest
|
|
3380
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
3511
3381
|
*
|
|
3512
3382
|
* const program = Effect.gen(function*() {
|
|
3513
3383
|
* // Create a department-employee map
|
|
@@ -3535,15 +3405,12 @@ export declare const forEach: {
|
|
|
3535
3405
|
* )
|
|
3536
3406
|
*
|
|
3537
3407
|
* // Check the flattened result
|
|
3538
|
-
*
|
|
3539
|
-
*
|
|
3540
|
-
*
|
|
3541
|
-
* const charlie = yield* TxHashMap.get(employeeDetails, "charlie")
|
|
3542
|
-
* console.log(charlie) // Option.some({ department: "marketing", role: "lead" })
|
|
3543
|
-
*
|
|
3544
|
-
* const size = yield* TxHashMap.size(employeeDetails)
|
|
3545
|
-
* console.log(size) // 4 (all employees)
|
|
3408
|
+
* yield* TxHashMap.get(employeeDetails, "alice") // => Option.some({ department: "engineering", role: "lead" })
|
|
3409
|
+
* yield* TxHashMap.get(employeeDetails, "charlie") // => Option.some({ department: "marketing", role: "lead" })
|
|
3410
|
+
* return yield* TxHashMap.size(employeeDetails)
|
|
3546
3411
|
* })
|
|
3412
|
+
*
|
|
3413
|
+
* await Effect.runPromise(program) // => 4
|
|
3547
3414
|
* ```
|
|
3548
3415
|
*
|
|
3549
3416
|
* @category combinators
|
|
@@ -3560,8 +3427,8 @@ export declare const flatMap: {
|
|
|
3560
3427
|
*
|
|
3561
3428
|
* **Example** (Flat mapping entries)
|
|
3562
3429
|
*
|
|
3563
|
-
* ```ts
|
|
3564
|
-
* import { Effect, TxHashMap } from "effect"
|
|
3430
|
+
* ```ts import.meta.vitest
|
|
3431
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
3565
3432
|
*
|
|
3566
3433
|
* const program = Effect.gen(function*() {
|
|
3567
3434
|
* // Create a department-employee map
|
|
@@ -3589,15 +3456,12 @@ export declare const flatMap: {
|
|
|
3589
3456
|
* )
|
|
3590
3457
|
*
|
|
3591
3458
|
* // Check the flattened result
|
|
3592
|
-
*
|
|
3593
|
-
*
|
|
3594
|
-
*
|
|
3595
|
-
* const charlie = yield* TxHashMap.get(employeeDetails, "charlie")
|
|
3596
|
-
* console.log(charlie) // Option.some({ department: "marketing", role: "lead" })
|
|
3597
|
-
*
|
|
3598
|
-
* const size = yield* TxHashMap.size(employeeDetails)
|
|
3599
|
-
* console.log(size) // 4 (all employees)
|
|
3459
|
+
* yield* TxHashMap.get(employeeDetails, "alice") // => Option.some({ department: "engineering", role: "lead" })
|
|
3460
|
+
* yield* TxHashMap.get(employeeDetails, "charlie") // => Option.some({ department: "marketing", role: "lead" })
|
|
3461
|
+
* return yield* TxHashMap.size(employeeDetails)
|
|
3600
3462
|
* })
|
|
3463
|
+
*
|
|
3464
|
+
* await Effect.runPromise(program) // => 4
|
|
3601
3465
|
* ```
|
|
3602
3466
|
*
|
|
3603
3467
|
* @category combinators
|
|
@@ -3614,8 +3478,8 @@ export declare const flatMap: {
|
|
|
3614
3478
|
*
|
|
3615
3479
|
* **Example** (Flat mapping entries)
|
|
3616
3480
|
*
|
|
3617
|
-
* ```ts
|
|
3618
|
-
* import { Effect, TxHashMap } from "effect"
|
|
3481
|
+
* ```ts import.meta.vitest
|
|
3482
|
+
* import { Effect, Option, TxHashMap } from "effect"
|
|
3619
3483
|
*
|
|
3620
3484
|
* const program = Effect.gen(function*() {
|
|
3621
3485
|
* // Create a department-employee map
|
|
@@ -3643,15 +3507,12 @@ export declare const flatMap: {
|
|
|
3643
3507
|
* )
|
|
3644
3508
|
*
|
|
3645
3509
|
* // Check the flattened result
|
|
3646
|
-
*
|
|
3647
|
-
*
|
|
3648
|
-
*
|
|
3649
|
-
* const charlie = yield* TxHashMap.get(employeeDetails, "charlie")
|
|
3650
|
-
* console.log(charlie) // Option.some({ department: "marketing", role: "lead" })
|
|
3651
|
-
*
|
|
3652
|
-
* const size = yield* TxHashMap.size(employeeDetails)
|
|
3653
|
-
* console.log(size) // 4 (all employees)
|
|
3510
|
+
* yield* TxHashMap.get(employeeDetails, "alice") // => Option.some({ department: "engineering", role: "lead" })
|
|
3511
|
+
* yield* TxHashMap.get(employeeDetails, "charlie") // => Option.some({ department: "marketing", role: "lead" })
|
|
3512
|
+
* return yield* TxHashMap.size(employeeDetails)
|
|
3654
3513
|
* })
|
|
3514
|
+
*
|
|
3515
|
+
* await Effect.runPromise(program) // => 4
|
|
3655
3516
|
* ```
|
|
3656
3517
|
*
|
|
3657
3518
|
* @category combinators
|
|
@@ -3669,7 +3530,7 @@ export declare const flatMap: {
|
|
|
3669
3530
|
*
|
|
3670
3531
|
* **Example** (Compacting optional values)
|
|
3671
3532
|
*
|
|
3672
|
-
* ```ts
|
|
3533
|
+
* ```ts import.meta.vitest
|
|
3673
3534
|
* import { Effect, Option, TxHashMap } from "effect"
|
|
3674
3535
|
*
|
|
3675
3536
|
* const program = Effect.gen(function*() {
|
|
@@ -3688,21 +3549,17 @@ export declare const flatMap: {
|
|
|
3688
3549
|
* // Remove all None values and unwrap Some values
|
|
3689
3550
|
* const validUsers = yield* TxHashMap.compact(userData)
|
|
3690
3551
|
*
|
|
3691
|
-
*
|
|
3692
|
-
* console.log(size) // 3 (alice, charlie, eve)
|
|
3693
|
-
*
|
|
3694
|
-
* const alice = yield* TxHashMap.get(validUsers, "alice")
|
|
3695
|
-
* console.log(alice) // Option.some({ age: 30, email: "alice@example.com" })
|
|
3552
|
+
* yield* TxHashMap.size(validUsers) // => 3
|
|
3696
3553
|
*
|
|
3697
|
-
*
|
|
3698
|
-
*
|
|
3554
|
+
* yield* TxHashMap.get(validUsers, "alice") // => Option.some({ age: 30, email: "alice@example.com" })
|
|
3555
|
+
* yield* TxHashMap.get(validUsers, "bob") // => Option.none()
|
|
3699
3556
|
*
|
|
3700
3557
|
* // Useful for cleaning up optional data processing results
|
|
3701
3558
|
* const userAges = yield* TxHashMap.map(validUsers, (user) => user.age)
|
|
3702
|
-
*
|
|
3703
|
-
* const sortedAgeEntries = ageEntries.toSorted(([left], [right]) => left.localeCompare(right))
|
|
3704
|
-
* console.log(sortedAgeEntries) // [["alice", 30], ["charlie", 25], ["eve", 28]]
|
|
3559
|
+
* return (yield* TxHashMap.entries(userAges)).toSorted(([left], [right]) => left.localeCompare(right))
|
|
3705
3560
|
* })
|
|
3561
|
+
*
|
|
3562
|
+
* await Effect.runPromise(program) // => [["alice", 30], ["charlie", 25], ["eve", 28]]
|
|
3706
3563
|
* ```
|
|
3707
3564
|
*
|
|
3708
3565
|
* @category combinators
|
|
@@ -3715,7 +3572,7 @@ export declare const compact: <K, A>(self: TxHashMap<K, Option.Option<A>>) => Ef
|
|
|
3715
3572
|
*
|
|
3716
3573
|
* **Example** (Converting to entries)
|
|
3717
3574
|
*
|
|
3718
|
-
* ```ts
|
|
3575
|
+
* ```ts import.meta.vitest
|
|
3719
3576
|
* import { Effect, TxHashMap } from "effect"
|
|
3720
3577
|
*
|
|
3721
3578
|
* const program = Effect.gen(function*() {
|
|
@@ -3726,24 +3583,18 @@ export declare const compact: <K, A>(self: TxHashMap<K, Option.Option<A>>) => Ef
|
|
|
3726
3583
|
* )
|
|
3727
3584
|
*
|
|
3728
3585
|
* // Get all entries as an array
|
|
3729
|
-
* const
|
|
3730
|
-
*
|
|
3731
|
-
*
|
|
3732
|
-
* // [["language", "en-US"], ["theme", "dark"], ["timezone", "UTC"]]
|
|
3733
|
-
*
|
|
3734
|
-
* // Process entries
|
|
3735
|
-
* for (const [setting, value] of sortedEntries) {
|
|
3736
|
-
* console.log(`${setting}: ${value}`)
|
|
3737
|
-
* }
|
|
3586
|
+
* const sortedEntries = (yield* TxHashMap.toEntries(settings))
|
|
3587
|
+
* .toSorted(([left], [right]) => left.localeCompare(right))
|
|
3588
|
+
* sortedEntries // => [["language", "en-US"], ["theme", "dark"], ["timezone", "UTC"]]
|
|
3738
3589
|
*
|
|
3739
|
-
* // Convert to object
|
|
3740
|
-
*
|
|
3741
|
-
* console.log(JSON.stringify(settingsObj))
|
|
3742
|
-
* // {"language":"en-US","theme":"dark","timezone":"UTC"}
|
|
3590
|
+
* // Convert to an object
|
|
3591
|
+
* return Object.fromEntries(sortedEntries)
|
|
3743
3592
|
* })
|
|
3593
|
+
*
|
|
3594
|
+
* await Effect.runPromise(program) // => { language: "en-US", theme: "dark", timezone: "UTC" }
|
|
3744
3595
|
* ```
|
|
3745
3596
|
*
|
|
3746
|
-
* @category
|
|
3597
|
+
* @category getters
|
|
3747
3598
|
* @since 4.0.0
|
|
3748
3599
|
*/
|
|
3749
3600
|
export declare const toEntries: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Array<readonly [K, V]>>;
|
|
@@ -3753,7 +3604,7 @@ export declare const toEntries: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<A
|
|
|
3753
3604
|
*
|
|
3754
3605
|
* **Example** (Converting to values)
|
|
3755
3606
|
*
|
|
3756
|
-
* ```ts
|
|
3607
|
+
* ```ts import.meta.vitest
|
|
3757
3608
|
* import { Effect, TxHashMap } from "effect"
|
|
3758
3609
|
*
|
|
3759
3610
|
* const program = Effect.gen(function*() {
|
|
@@ -3765,22 +3616,23 @@ export declare const toEntries: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<A
|
|
|
3765
3616
|
*
|
|
3766
3617
|
* // Get all product information
|
|
3767
3618
|
* const products = yield* TxHashMap.toValues(inventory)
|
|
3768
|
-
*
|
|
3619
|
+
* products.length // => 3
|
|
3769
3620
|
*
|
|
3770
3621
|
* // Calculate total inventory value
|
|
3771
3622
|
* const totalValue = products.reduce(
|
|
3772
3623
|
* (sum, product) => sum + (product.price * product.stock),
|
|
3773
3624
|
* 0
|
|
3774
3625
|
* )
|
|
3775
|
-
*
|
|
3626
|
+
* totalValue // => 8025
|
|
3776
3627
|
*
|
|
3777
3628
|
* // Find products with low stock
|
|
3778
|
-
*
|
|
3779
|
-
* console.log(`${lowStockProducts.length} product with low stock`) // 1 product with low stock
|
|
3629
|
+
* return products.filter((product) => product.stock < 10).length
|
|
3780
3630
|
* })
|
|
3631
|
+
*
|
|
3632
|
+
* await Effect.runPromise(program) // => 1
|
|
3781
3633
|
* ```
|
|
3782
3634
|
*
|
|
3783
|
-
* @category
|
|
3635
|
+
* @category getters
|
|
3784
3636
|
* @since 4.0.0
|
|
3785
3637
|
*/
|
|
3786
3638
|
export declare const toValues: <K, V>(self: TxHashMap<K, V>) => Effect.Effect<Array<V>>;
|