effect 4.0.0-beta.65 → 4.0.0-beta.67
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 +113 -67
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +28 -18
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +404 -337
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +190 -146
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +167 -97
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +87 -47
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +62 -31
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +30 -15
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +20 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +16 -0
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +236 -132
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +133 -57
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +77 -65
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +43 -36
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +1518 -575
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +661 -287
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +119 -10
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -6
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +548 -379
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +238 -170
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +15 -8
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +8 -4
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +2 -4
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +2 -4
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +5 -4
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +9 -8
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/ConfigProvider.js +1 -1
- package/dist/Console.d.ts +76 -50
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +69 -46
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +386 -138
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +144 -62
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +69 -48
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +96 -36
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +3 -2
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +875 -444
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +376 -217
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +367 -174
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +145 -71
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +42 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +36 -0
- package/dist/Duration.d.ts +329 -185
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +174 -106
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2445 -2356
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +906 -758
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +38 -3
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -3
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +78 -28
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +75 -27
- package/dist/Encoding.js.map +1 -1
- package/dist/Equivalence.d.ts +14 -19
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +14 -19
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +66 -82
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +38 -29
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -12
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +21 -6
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +7 -5
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +72 -40
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +39 -21
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +119 -58
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +122 -40
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +288 -160
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +176 -74
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -52
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +97 -34
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +104 -73
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +53 -39
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +166 -88
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +68 -42
- package/dist/Filter.js.map +1 -1
- package/dist/Function.d.ts +154 -86
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +53 -37
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +682 -365
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +308 -157
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +29 -13
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +31 -18
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +25 -15
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +444 -256
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +223 -105
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +36 -17
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +75 -8
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +194 -104
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +93 -38
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +20 -9
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +16 -6
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +309 -149
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +129 -65
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -3
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +4 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/Latch.d.ts +98 -15
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +41 -10
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +412 -309
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +262 -181
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +95 -21
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +58 -14
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +92 -131
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +25 -15
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +155 -99
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +211 -184
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +75 -17
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +22 -16
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +133 -157
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +85 -76
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +325 -284
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +217 -212
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +117 -58
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +52 -29
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +52 -30
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +94 -38
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +92 -49
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +123 -71
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +99 -62
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +79 -60
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +3 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +36 -39
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +34 -20
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +116 -64
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +54 -30
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +1 -2
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +0 -1
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +38 -53
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +87 -11
- package/dist/Option.js.map +1 -1
- package/dist/Ordering.d.ts +43 -28
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +4 -2
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +225 -40
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +113 -17
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +77 -13
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +48 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +71 -15
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +59 -12
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +74 -6
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +68 -5
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +66 -31
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +26 -24
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +16 -21
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +9 -14
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +9 -2
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +7 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +364 -262
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +245 -174
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +94 -25
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +61 -13
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +284 -150
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +216 -113
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +54 -35
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +36 -24
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +151 -141
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +66 -20
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +69 -32
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +33 -16
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +273 -129
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +117 -57
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +3 -3
- package/dist/Redactable.js +2 -2
- package/dist/Redacted.d.ts +63 -33
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +30 -14
- package/dist/Redacted.js.map +1 -1
- package/dist/Ref.d.ts +81 -52
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +54 -35
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +73 -31
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +66 -30
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +11 -5
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +11 -5
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +158 -34
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +67 -12
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +261 -116
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +77 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +13 -7
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +44 -6
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +26 -16
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +6 -6
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +43 -18
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +35 -16
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +545 -576
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +261 -247
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +43 -6
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +33 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +815 -294
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +287 -193
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +24 -15
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +13 -9
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +26 -13
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +24 -11
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +1 -8
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +194 -25
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +220 -26
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaTransformation.d.ts +61 -41
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +56 -33
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +7 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +23 -0
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +102 -43
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +57 -23
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +138 -46
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +80 -19
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +28 -8
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +25 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +64 -28
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +22 -13
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +458 -200
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +240 -89
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +43 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +33 -4
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +1899 -1186
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +868 -525
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +171 -95
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +125 -67
- package/dist/String.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +308 -203
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +125 -76
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +13 -5
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +13 -5
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +278 -62
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +116 -23
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +26 -2
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +4 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +39 -7
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +10 -4
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +229 -55
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +94 -18
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +213 -142
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +88 -60
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +182 -146
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +73 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +43 -29
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +22 -15
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +362 -222
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +171 -98
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +178 -104
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +84 -43
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +93 -62
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +54 -36
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +77 -49
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +60 -37
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +279 -241
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +147 -101
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +69 -46
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +48 -32
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +69 -40
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +35 -20
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +101 -54
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +76 -34
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +72 -48
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +33 -22
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +34 -34
- package/dist/UndefinedOr.d.ts +48 -25
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +28 -25
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +71 -116
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +20 -6
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +4 -0
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +81 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/concurrency.js +2 -2
- package/dist/internal/concurrency.js.map +1 -1
- package/dist/internal/core.js +8 -20
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +20 -19
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/executionPlan.js +2 -2
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/option.js +5 -8
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/result.js +5 -8
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +6 -3
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +6 -3
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +39 -34
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +42 -12
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +39 -30
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +25 -10
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.js +7 -7
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +197 -130
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +166 -102
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
- package/dist/unstable/ai/Chat.d.ts +65 -41
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +51 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +9 -8
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +28 -18
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +18 -11
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +36 -30
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +21 -15
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +339 -119
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +264 -98
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +53 -19
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +65 -17
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +13 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +11 -9
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
- package/dist/unstable/ai/Prompt.d.ts +194 -168
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +75 -66
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +153 -140
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +43 -48
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +27 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +42 -32
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +14 -10
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +13 -8
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -6
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +153 -84
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +97 -44
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +33 -42
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +35 -36
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +42 -24
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +42 -24
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +226 -134
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +101 -65
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +72 -26
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +86 -23
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +43 -13
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +30 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +218 -117
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +45 -31
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +7 -7
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +235 -142
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +111 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +42 -14
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +30 -7
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +35 -10
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/HelpDoc.js +21 -0
- package/dist/unstable/cli/Param.d.ts +79 -31
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +161 -99
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +79 -42
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +66 -35
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +178 -47
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +111 -31
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +13 -0
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +7 -7
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +12 -10
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +3 -0
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +35 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +56 -7
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +56 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +39 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +61 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +36 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +11 -3
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +75 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +78 -13
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +30 -2
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +18 -3
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +15 -2
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +24 -2
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +40 -8
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +43 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +11 -4
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +27 -3
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +24 -2
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +105 -23
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +88 -14
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +88 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +31 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +24 -3
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +21 -2
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +102 -13
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +86 -10
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +71 -11
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +101 -12
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +64 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -17
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -17
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +34 -2
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +40 -12
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +31 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +38 -4
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +73 -10
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +70 -9
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +51 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +47 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +10 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +35 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +67 -10
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +23 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +15 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +15 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +21 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +89 -19
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +48 -13
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +29 -2
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +18 -1
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +18 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js +12 -0
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +26 -3
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +26 -3
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +32 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +102 -20
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +21 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +81 -12
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +75 -9
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +149 -21
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +97 -13
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +109 -18
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +69 -13
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +115 -30
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +22 -2
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +24 -6
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +108 -16
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +151 -31
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +111 -20
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +96 -22
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +72 -16
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +54 -8
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +17 -3
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +156 -77
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +93 -39
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +40 -7
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +27 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +33 -4
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +1 -1
- package/dist/unstable/http/FindMyWay.js +1 -1
- package/dist/unstable/http/Headers.d.ts +182 -36
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +86 -16
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +114 -26
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +100 -22
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +205 -96
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +85 -39
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +68 -12
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +71 -9
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +153 -47
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +44 -11
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +42 -16
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +33 -13
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +44 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +35 -5
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +23 -1
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +70 -31
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +34 -3
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +35 -4
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +194 -45
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +122 -28
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +151 -22
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +77 -12
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +90 -10
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +82 -8
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +112 -31
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +43 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +209 -38
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +22 -4
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +47 -5
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +178 -28
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +130 -20
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Node.js +1 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Search.js +1 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Web.js +1 -1
- package/dist/unstable/http/Multipasta.d.ts +1 -1
- package/dist/unstable/http/Multipasta.js +1 -1
- package/dist/unstable/http/Template.d.ts +53 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +26 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +56 -42
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +29 -15
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +233 -49
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +116 -23
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +14 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +47 -9
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +43 -7
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +98 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -6
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +9 -2
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +28 -3
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +73 -15
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +33 -3
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +14 -3
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +32 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +29 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +32 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +49 -12
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +47 -5
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +28 -3
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +32 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +7 -5
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.d.ts +2 -1
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +2 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +81 -21
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +76 -15
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +22 -5
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +24 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +60 -13
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +97 -16
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +90 -14
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +82 -17
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +26 -5
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +36 -4
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +89 -109
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +74 -23
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +11 -6
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +2 -1
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +2 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +121 -36
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +539 -130
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +256 -62
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +29 -3
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +69 -10
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +29 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +28 -5
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +35 -3
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +61 -7
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +255 -56
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +44 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +81 -19
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +53 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +26 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +23 -7
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +39 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +34 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -12
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +73 -23
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +70 -23
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +20 -1
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +20 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +17 -5
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +8 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +8 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +130 -52
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +79 -34
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +104 -24
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +22 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +167 -34
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +124 -29
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +58 -10
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +43 -5
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +35 -4
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +45 -5
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +34 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +38 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +31 -0
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +22 -0
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +99 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +114 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +26 -5
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +8 -4
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +56 -13
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +44 -10
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +29 -8
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +29 -8
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts +3 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +23 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +124 -0
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +82 -0
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +1 -1
- package/dist/unstable/sql/index.js +1 -1
- package/dist/unstable/workers/Transferable.d.ts +65 -13
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +53 -10
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +60 -8
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +43 -4
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +31 -9
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +44 -7
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +24 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +1 -1
- package/dist/unstable/workers/index.js +1 -1
- package/dist/unstable/workflow/Activity.d.ts +61 -10
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +21 -6
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +12 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +22 -2
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +76 -13
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +145 -0
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -0
- package/dist/unstable/workflow/DurableQueue.js +200 -0
- package/dist/unstable/workflow/DurableQueue.js.map +1 -0
- package/dist/unstable/workflow/Workflow.d.ts +100 -31
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +76 -20
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -4
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +2 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +4 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +4 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +11 -11
- package/src/Array.ts +113 -67
- package/src/BigDecimal.ts +404 -337
- package/src/BigInt.ts +167 -97
- package/src/Boolean.ts +62 -31
- package/src/Brand.ts +20 -1
- package/src/Cache.ts +331 -164
- package/src/Cause.ts +77 -65
- package/src/Channel.ts +1585 -607
- package/src/ChannelSchema.ts +137 -12
- package/src/Chunk.ts +549 -380
- package/src/Clock.ts +15 -8
- package/src/Combiner.ts +2 -4
- package/src/Config.ts +12 -10
- package/src/ConfigProvider.ts +1 -1
- package/src/Console.ts +88 -58
- package/src/Context.ts +397 -149
- package/src/Cron.ts +111 -48
- package/src/Data.ts +3 -2
- package/src/DateTime.ts +876 -445
- package/src/Deferred.ts +367 -174
- package/src/Differ.ts +42 -0
- package/src/Duration.ts +329 -185
- package/src/Effect.ts +2474 -2395
- package/src/Effectable.ts +39 -4
- package/src/Encoding.ts +78 -28
- package/src/Equivalence.ts +14 -19
- package/src/ErrorReporter.ts +66 -82
- package/src/ExecutionPlan.ts +97 -13
- package/src/Exit.ts +7 -5
- package/src/Fiber.ts +72 -40
- package/src/FiberHandle.ts +158 -58
- package/src/FiberMap.ts +329 -164
- package/src/FiberSet.ts +130 -52
- package/src/FileSystem.ts +106 -74
- package/src/Filter.ts +166 -88
- package/src/Function.ts +154 -86
- package/src/Graph.ts +682 -365
- package/src/HKT.ts +29 -13
- package/src/Hash.ts +31 -18
- package/src/HashMap.ts +444 -256
- package/src/HashRing.ts +94 -17
- package/src/HashSet.ts +194 -104
- package/src/Inspectable.ts +22 -10
- package/src/Iterable.ts +309 -149
- package/src/JsonPatch.ts +4 -3
- package/src/Latch.ts +98 -15
- package/src/Layer.ts +488 -345
- package/src/LayerMap.ts +98 -25
- package/src/LogLevel.ts +92 -131
- package/src/Logger.ts +357 -288
- package/src/ManagedRuntime.ts +75 -17
- package/src/Match.ts +133 -157
- package/src/Metric.ts +355 -304
- package/src/MutableHashMap.ts +161 -84
- package/src/MutableHashSet.ts +122 -52
- package/src/MutableList.ts +141 -81
- package/src/MutableRef.ts +130 -90
- package/src/Newtype.ts +3 -0
- package/src/NonEmptyIterable.ts +36 -39
- package/src/Number.ts +116 -64
- package/src/Optic.ts +1 -2
- package/src/Option.ts +41 -53
- package/src/Ordering.ts +43 -28
- package/src/PartitionedSemaphore.ts +225 -40
- package/src/Path.ts +77 -13
- package/src/Pipeable.ts +76 -21
- package/src/PlatformError.ts +74 -6
- package/src/Pool.ts +94 -31
- package/src/Predicate.ts +16 -21
- package/src/PrimaryKey.ts +9 -2
- package/src/PubSub.ts +364 -262
- package/src/Pull.ts +94 -25
- package/src/Queue.ts +284 -150
- package/src/Random.ts +54 -35
- package/src/RcMap.ts +151 -141
- package/src/RcRef.ts +69 -32
- package/src/Record.ts +273 -129
- package/src/Redactable.ts +3 -3
- package/src/Redacted.ts +63 -33
- package/src/Ref.ts +161 -104
- package/src/References.ts +73 -31
- package/src/RegExp.ts +11 -5
- package/src/Request.ts +158 -34
- package/src/RequestResolver.ts +277 -119
- package/src/Resource.ts +45 -7
- package/src/Result.ts +31 -18
- package/src/Runtime.ts +45 -19
- package/src/Schedule.ts +575 -600
- package/src/Scheduler.ts +43 -6
- package/src/Schema.ts +845 -319
- package/src/SchemaAST.ts +25 -16
- package/src/SchemaGetter.ts +32 -17
- package/src/SchemaIssue.ts +1 -8
- package/src/SchemaParser.ts +262 -38
- package/src/SchemaTransformation.ts +61 -41
- package/src/SchemaUtils.ts +23 -0
- package/src/Scope.ts +102 -43
- package/src/ScopedCache.ts +192 -56
- package/src/ScopedRef.ts +28 -8
- package/src/Semaphore.ts +64 -28
- package/src/Sink.ts +458 -200
- package/src/Stdio.ts +43 -6
- package/src/Stream.ts +2043 -1256
- package/src/String.ts +171 -95
- package/src/SubscriptionRef.ts +308 -203
- package/src/Symbol.ts +13 -5
- package/src/SynchronizedRef.ts +278 -62
- package/src/Take.ts +26 -2
- package/src/Terminal.ts +40 -7
- package/src/Tracer.ts +229 -55
- package/src/Trie.ts +213 -142
- package/src/TxChunk.ts +182 -146
- package/src/TxDeferred.ts +43 -29
- package/src/TxHashMap.ts +370 -230
- package/src/TxHashSet.ts +250 -152
- package/src/TxPriorityQueue.ts +96 -64
- package/src/TxPubSub.ts +77 -49
- package/src/TxQueue.ts +279 -241
- package/src/TxReentrantLock.ts +70 -47
- package/src/TxRef.ts +70 -41
- package/src/TxSemaphore.ts +101 -54
- package/src/TxSubscriptionRef.ts +72 -48
- package/src/Types.ts +34 -34
- package/src/UndefinedOr.ts +48 -25
- package/src/Unify.ts +71 -116
- package/src/Utils.ts +4 -0
- package/src/index.ts +81 -32
- package/src/internal/concurrency.ts +2 -2
- package/src/internal/core.ts +12 -23
- package/src/internal/effect.ts +25 -29
- package/src/internal/executionPlan.ts +2 -2
- package/src/internal/option.ts +5 -8
- package/src/internal/result.ts +5 -8
- package/src/internal/schema/schema.ts +1 -1
- package/src/testing/FastCheck.ts +6 -3
- package/src/testing/TestClock.ts +63 -34
- package/src/testing/TestConsole.ts +49 -30
- package/src/testing/TestSchema.ts +8 -8
- package/src/unstable/ai/AiError.ts +187 -120
- package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/unstable/ai/Chat.ts +69 -43
- package/src/unstable/ai/EmbeddingModel.ts +12 -11
- package/src/unstable/ai/IdGenerator.ts +28 -18
- package/src/unstable/ai/LanguageModel.ts +47 -46
- package/src/unstable/ai/McpSchema.ts +339 -119
- package/src/unstable/ai/McpServer.ts +78 -21
- package/src/unstable/ai/Model.ts +23 -18
- package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
- package/src/unstable/ai/Prompt.ts +210 -184
- package/src/unstable/ai/Response.ts +159 -147
- package/src/unstable/ai/ResponseIdTracker.ts +43 -4
- package/src/unstable/ai/Telemetry.ts +42 -32
- package/src/unstable/ai/Tokenizer.ts +13 -8
- package/src/unstable/ai/Tool.ts +154 -85
- package/src/unstable/ai/Toolkit.ts +81 -84
- package/src/unstable/ai/index.ts +42 -24
- package/src/unstable/cli/Argument.ts +226 -134
- package/src/unstable/cli/CliError.ts +96 -26
- package/src/unstable/cli/CliOutput.ts +43 -13
- package/src/unstable/cli/Command.ts +225 -125
- package/src/unstable/cli/Completions.ts +7 -7
- package/src/unstable/cli/Flag.ts +235 -142
- package/src/unstable/cli/GlobalFlag.ts +42 -14
- package/src/unstable/cli/HelpDoc.ts +35 -10
- package/src/unstable/cli/Param.ts +328 -190
- package/src/unstable/cli/Primitive.ts +79 -42
- package/src/unstable/cli/Prompt.ts +210 -58
- package/src/unstable/cli/internal/ansi.ts +13 -0
- package/src/unstable/cli/internal/command.ts +17 -15
- package/src/unstable/cli/internal/config.ts +3 -0
- package/src/unstable/cli/internal/lexer.ts +11 -0
- package/src/unstable/cluster/ClusterCron.ts +35 -1
- package/src/unstable/cluster/ClusterError.ts +56 -7
- package/src/unstable/cluster/ClusterMetrics.ts +39 -5
- package/src/unstable/cluster/ClusterSchema.ts +61 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +36 -3
- package/src/unstable/cluster/DeliverAt.ts +39 -4
- package/src/unstable/cluster/Entity.ts +110 -19
- package/src/unstable/cluster/EntityAddress.ts +30 -2
- package/src/unstable/cluster/EntityId.ts +18 -3
- package/src/unstable/cluster/EntityProxy.ts +34 -2
- package/src/unstable/cluster/EntityProxyServer.ts +44 -8
- package/src/unstable/cluster/EntityResource.ts +43 -6
- package/src/unstable/cluster/EntityType.ts +27 -3
- package/src/unstable/cluster/Envelope.ts +128 -23
- package/src/unstable/cluster/HttpRunner.ts +88 -13
- package/src/unstable/cluster/K8sHttpClient.ts +49 -6
- package/src/unstable/cluster/MachineId.ts +24 -3
- package/src/unstable/cluster/Message.ts +102 -13
- package/src/unstable/cluster/MessageStorage.ts +128 -22
- package/src/unstable/cluster/Reply.ts +101 -12
- package/src/unstable/cluster/Runner.ts +47 -17
- package/src/unstable/cluster/RunnerAddress.ts +34 -2
- package/src/unstable/cluster/RunnerHealth.ts +40 -12
- package/src/unstable/cluster/RunnerServer.ts +31 -4
- package/src/unstable/cluster/RunnerStorage.ts +42 -5
- package/src/unstable/cluster/Runners.ts +73 -10
- package/src/unstable/cluster/ShardId.ts +51 -5
- package/src/unstable/cluster/Sharding.ts +35 -4
- package/src/unstable/cluster/ShardingConfig.ts +76 -11
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
- package/src/unstable/cluster/SingleRunner.ts +23 -1
- package/src/unstable/cluster/Singleton.ts +15 -1
- package/src/unstable/cluster/SingletonAddress.ts +21 -1
- package/src/unstable/cluster/Snowflake.ts +89 -19
- package/src/unstable/cluster/SocketRunner.ts +29 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
- package/src/unstable/cluster/TestRunner.ts +18 -1
- package/src/unstable/cluster/internal/hash.ts +12 -0
- package/src/unstable/devtools/DevTools.ts +26 -3
- package/src/unstable/devtools/DevToolsClient.ts +32 -5
- package/src/unstable/devtools/DevToolsSchema.ts +201 -44
- package/src/unstable/devtools/DevToolsServer.ts +27 -2
- package/src/unstable/encoding/Msgpack.ts +97 -12
- package/src/unstable/encoding/Ndjson.ts +149 -21
- package/src/unstable/encoding/Sse.ts +109 -18
- package/src/unstable/eventlog/Event.ts +131 -30
- package/src/unstable/eventlog/EventGroup.ts +50 -17
- package/src/unstable/eventlog/EventJournal.ts +120 -20
- package/src/unstable/eventlog/EventLog.ts +151 -31
- package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
- package/src/unstable/eventlog/EventLogMessage.ts +92 -18
- package/src/unstable/eventlog/EventLogRemote.ts +54 -8
- package/src/unstable/eventlog/EventLogServer.ts +33 -3
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
- package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
- package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
- package/src/unstable/http/Cookies.ts +156 -77
- package/src/unstable/http/Etag.ts +40 -7
- package/src/unstable/http/FetchHttpClient.ts +33 -4
- package/src/unstable/http/FindMyWay.ts +1 -1
- package/src/unstable/http/Headers.ts +252 -50
- package/src/unstable/http/HttpBody.ts +130 -28
- package/src/unstable/http/HttpClient.ts +206 -97
- package/src/unstable/http/HttpClientError.ts +80 -12
- package/src/unstable/http/HttpClientRequest.ts +320 -102
- package/src/unstable/http/HttpClientResponse.ts +59 -16
- package/src/unstable/http/HttpEffect.ts +66 -18
- package/src/unstable/http/HttpIncomingMessage.ts +47 -7
- package/src/unstable/http/HttpMethod.ts +35 -5
- package/src/unstable/http/HttpMiddleware.ts +63 -16
- package/src/unstable/http/HttpPlatform.ts +35 -4
- package/src/unstable/http/HttpRouter.ts +221 -57
- package/src/unstable/http/HttpServer.ts +152 -23
- package/src/unstable/http/HttpServerError.ts +90 -10
- package/src/unstable/http/HttpServerRequest.ts +136 -32
- package/src/unstable/http/HttpServerRespondable.ts +49 -6
- package/src/unstable/http/HttpServerResponse.ts +395 -72
- package/src/unstable/http/HttpStaticServer.ts +22 -4
- package/src/unstable/http/HttpTraceContext.ts +53 -6
- package/src/unstable/http/Multipart.ts +179 -29
- package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
- package/src/unstable/http/Multipasta/Node.ts +1 -1
- package/src/unstable/http/Multipasta/Search.ts +1 -1
- package/src/unstable/http/Multipasta/Web.ts +1 -1
- package/src/unstable/http/Multipasta.ts +1 -1
- package/src/unstable/http/Template.ts +53 -0
- package/src/unstable/http/Url.ts +56 -42
- package/src/unstable/http/UrlParams.ts +233 -49
- package/src/unstable/httpapi/HttpApi.ts +49 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +86 -20
- package/src/unstable/httpapi/HttpApiClient.ts +80 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
- package/src/unstable/httpapi/HttpApiError.ts +100 -1
- package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
- package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -23
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
- package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
- package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
- package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
- package/src/unstable/httpapi/HttpApiTest.ts +31 -3
- package/src/unstable/httpapi/OpenApi.ts +115 -15
- package/src/unstable/observability/Otlp.ts +33 -3
- package/src/unstable/observability/OtlpExporter.ts +32 -1
- package/src/unstable/observability/OtlpLogger.ts +31 -2
- package/src/unstable/observability/OtlpMetrics.ts +37 -4
- package/src/unstable/observability/OtlpResource.ts +68 -12
- package/src/unstable/observability/OtlpSerialization.ts +28 -3
- package/src/unstable/observability/OtlpTracer.ts +38 -2
- package/src/unstable/observability/PrometheusMetrics.ts +32 -12
- package/src/unstable/observability/index.ts +2 -1
- package/src/unstable/persistence/KeyValueStore.ts +108 -28
- package/src/unstable/persistence/Persistable.ts +76 -15
- package/src/unstable/persistence/PersistedCache.ts +27 -2
- package/src/unstable/persistence/PersistedQueue.ts +98 -16
- package/src/unstable/persistence/Persistence.ts +97 -16
- package/src/unstable/persistence/RateLimiter.ts +98 -22
- package/src/unstable/persistence/Redis.ts +42 -5
- package/src/unstable/process/ChildProcess.ts +100 -79
- package/src/unstable/process/ChildProcessSpawner.ts +22 -11
- package/src/unstable/process/index.ts +2 -1
- package/src/unstable/reactivity/AsyncResult.ts +202 -61
- package/src/unstable/reactivity/Atom.ts +597 -143
- package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
- package/src/unstable/reactivity/AtomRef.ts +51 -7
- package/src/unstable/reactivity/AtomRegistry.ts +141 -22
- package/src/unstable/reactivity/AtomRpc.ts +36 -2
- package/src/unstable/reactivity/Hydration.ts +45 -5
- package/src/unstable/reactivity/Reactivity.ts +95 -13
- package/src/unstable/rpc/Rpc.ts +255 -56
- package/src/unstable/rpc/RpcClient.ts +108 -20
- package/src/unstable/rpc/RpcClientError.ts +26 -2
- package/src/unstable/rpc/RpcGroup.ts +51 -8
- package/src/unstable/rpc/RpcMessage.ts +128 -32
- package/src/unstable/rpc/RpcMiddleware.ts +100 -20
- package/src/unstable/rpc/RpcSchema.ts +38 -4
- package/src/unstable/rpc/RpcSerialization.ts +60 -13
- package/src/unstable/rpc/RpcServer.ts +108 -25
- package/src/unstable/rpc/RpcTest.ts +20 -1
- package/src/unstable/rpc/RpcWorker.ts +42 -8
- package/src/unstable/rpc/Utils.ts +31 -0
- package/src/unstable/schema/Model.ts +148 -52
- package/src/unstable/schema/VariantSchema.ts +104 -24
- package/src/unstable/socket/Socket.ts +168 -35
- package/src/unstable/socket/SocketServer.ts +58 -10
- package/src/unstable/sql/Migrator.ts +57 -5
- package/src/unstable/sql/SqlClient.ts +55 -2
- package/src/unstable/sql/SqlConnection.ts +31 -0
- package/src/unstable/sql/SqlError.ts +117 -0
- package/src/unstable/sql/SqlModel.ts +26 -5
- package/src/unstable/sql/SqlResolver.ts +56 -13
- package/src/unstable/sql/SqlSchema.ts +29 -8
- package/src/unstable/sql/SqlStream.ts +23 -0
- package/src/unstable/sql/Statement.ts +141 -0
- package/src/unstable/sql/index.ts +1 -1
- package/src/unstable/workers/Transferable.ts +65 -13
- package/src/unstable/workers/Worker.ts +60 -8
- package/src/unstable/workers/WorkerError.ts +50 -9
- package/src/unstable/workers/WorkerRunner.ts +32 -3
- package/src/unstable/workers/index.ts +1 -1
- package/src/unstable/workflow/Activity.ts +62 -11
- package/src/unstable/workflow/DurableClock.ts +26 -3
- package/src/unstable/workflow/DurableDeferred.ts +146 -31
- package/src/unstable/workflow/DurableQueue.ts +366 -0
- package/src/unstable/workflow/Workflow.ts +122 -32
- package/src/unstable/workflow/WorkflowEngine.ts +40 -5
- package/src/unstable/workflow/WorkflowProxy.ts +32 -2
- package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
- package/src/unstable/workflow/index.ts +5 -0
package/src/Chunk.ts
CHANGED
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
* - **Iteration**: O(n)
|
|
29
29
|
* - **Memory**: Structural sharing minimizes allocation
|
|
30
30
|
*
|
|
31
|
-
*
|
|
31
|
+
* **Example** (Creating and combining chunks)
|
|
32
|
+
*
|
|
32
33
|
* ```ts
|
|
33
34
|
* import { Chunk } from "effect"
|
|
34
35
|
*
|
|
@@ -42,7 +43,8 @@
|
|
|
42
43
|
* console.log(Chunk.toReadonlyArray(combined)) // [1, 2, 3, 4, 5, 6]
|
|
43
44
|
* ```
|
|
44
45
|
*
|
|
45
|
-
*
|
|
46
|
+
* **Example** (Transforming chunks)
|
|
47
|
+
*
|
|
46
48
|
* ```ts
|
|
47
49
|
* import { Chunk } from "effect"
|
|
48
50
|
*
|
|
@@ -53,17 +55,17 @@
|
|
|
53
55
|
* const sum = Chunk.reduce(evens, 0, (acc, n) => acc + n) // 12
|
|
54
56
|
* ```
|
|
55
57
|
*
|
|
56
|
-
*
|
|
58
|
+
* **Example** (Processing chunks with Effect)
|
|
59
|
+
*
|
|
57
60
|
* ```ts
|
|
58
61
|
* import { Chunk, Effect } from "effect"
|
|
59
62
|
*
|
|
60
63
|
* // Working with Effects
|
|
61
|
-
* const processChunk = (chunk: Chunk.Chunk<number>)
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* })
|
|
64
|
+
* const processChunk = Effect.fnUntraced(function*(chunk: Chunk.Chunk<number>) {
|
|
65
|
+
* const mapped = Chunk.map(chunk, (n) => n * 2)
|
|
66
|
+
* const filtered = Chunk.filter(mapped, (n) => n > 5)
|
|
67
|
+
* return Chunk.toReadonlyArray(filtered)
|
|
68
|
+
* })
|
|
67
69
|
* ```
|
|
68
70
|
*
|
|
69
71
|
* @since 2.0.0
|
|
@@ -94,7 +96,8 @@ const TypeId = "~effect/collections/Chunk"
|
|
|
94
96
|
/**
|
|
95
97
|
* A Chunk is an immutable, ordered collection optimized for efficient concatenation and access patterns.
|
|
96
98
|
*
|
|
97
|
-
*
|
|
99
|
+
* **Example** (Inspecting chunk values)
|
|
100
|
+
*
|
|
98
101
|
* ```ts
|
|
99
102
|
* import { Chunk } from "effect"
|
|
100
103
|
*
|
|
@@ -120,7 +123,8 @@ export interface Chunk<out A> extends Iterable<A>, Equal.Equal, Pipeable, Inspec
|
|
|
120
123
|
/**
|
|
121
124
|
* A non-empty Chunk guaranteed to contain at least one element.
|
|
122
125
|
*
|
|
123
|
-
*
|
|
126
|
+
* **Example** (Working with non-empty chunks)
|
|
127
|
+
*
|
|
124
128
|
* ```ts
|
|
125
129
|
* import { Chunk } from "effect"
|
|
126
130
|
*
|
|
@@ -137,7 +141,8 @@ export interface NonEmptyChunk<out A> extends Chunk<A>, NonEmptyIterable<A> {}
|
|
|
137
141
|
/**
|
|
138
142
|
* Type lambda for Chunk, used for higher-kinded type operations.
|
|
139
143
|
*
|
|
140
|
-
*
|
|
144
|
+
* **Example** (Applying the Chunk type lambda)
|
|
145
|
+
*
|
|
141
146
|
* ```ts
|
|
142
147
|
* import type { ChunkTypeLambda } from "effect/Chunk"
|
|
143
148
|
* import type { Kind } from "effect/HKT"
|
|
@@ -204,9 +209,11 @@ function copy<A>(
|
|
|
204
209
|
const emptyArray: ReadonlyArray<never> = []
|
|
205
210
|
|
|
206
211
|
/**
|
|
207
|
-
*
|
|
212
|
+
* Creates an `Equivalence` for chunks that compares chunk lengths and then
|
|
213
|
+
* compares corresponding elements with the provided element equivalence.
|
|
214
|
+
*
|
|
215
|
+
* **Example** (Comparing chunks for equivalence)
|
|
208
216
|
*
|
|
209
|
-
* @example
|
|
210
217
|
* ```ts
|
|
211
218
|
* import { Chunk } from "effect"
|
|
212
219
|
* import * as Equivalence from "effect/Equivalence"
|
|
@@ -316,7 +323,8 @@ const makeChunk = <A>(backing: Backing<A>): Chunk<A> => {
|
|
|
316
323
|
/**
|
|
317
324
|
* Checks if `u` is a `Chunk<unknown>`
|
|
318
325
|
*
|
|
319
|
-
*
|
|
326
|
+
* **Example** (Checking for chunks)
|
|
327
|
+
*
|
|
320
328
|
* ```ts
|
|
321
329
|
* import { Chunk } from "effect"
|
|
322
330
|
*
|
|
@@ -335,7 +343,8 @@ export const isChunk: {
|
|
|
335
343
|
/**
|
|
336
344
|
* Checks if `u` is a `Chunk<unknown>`
|
|
337
345
|
*
|
|
338
|
-
*
|
|
346
|
+
* **Example** (Checking for chunks)
|
|
347
|
+
*
|
|
339
348
|
* ```ts
|
|
340
349
|
* import { Chunk } from "effect"
|
|
341
350
|
*
|
|
@@ -354,7 +363,8 @@ export const isChunk: {
|
|
|
354
363
|
/**
|
|
355
364
|
* Checks if `u` is a `Chunk<unknown>`
|
|
356
365
|
*
|
|
357
|
-
*
|
|
366
|
+
* **Example** (Checking for chunks)
|
|
367
|
+
*
|
|
358
368
|
* ```ts
|
|
359
369
|
* import { Chunk } from "effect"
|
|
360
370
|
*
|
|
@@ -377,7 +387,8 @@ const _empty = makeChunk<never>({ _tag: "IEmpty" })
|
|
|
377
387
|
/**
|
|
378
388
|
* Creates an empty `Chunk`.
|
|
379
389
|
*
|
|
380
|
-
*
|
|
390
|
+
* **Example** (Creating an empty chunk)
|
|
391
|
+
*
|
|
381
392
|
* ```ts
|
|
382
393
|
* import { Chunk } from "effect"
|
|
383
394
|
*
|
|
@@ -393,13 +404,13 @@ export const empty: <A = never>() => Chunk<A> = () => _empty
|
|
|
393
404
|
/**
|
|
394
405
|
* Builds a `NonEmptyChunk` from an non-empty collection of elements.
|
|
395
406
|
*
|
|
396
|
-
*
|
|
407
|
+
* **Example** (Creating a non-empty chunk)
|
|
408
|
+
*
|
|
397
409
|
* ```ts
|
|
398
410
|
* import { Chunk } from "effect"
|
|
399
411
|
*
|
|
400
412
|
* const chunk = Chunk.make(1, 2, 3, 4)
|
|
401
|
-
* console.log(chunk)
|
|
402
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
|
|
413
|
+
* console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4]
|
|
403
414
|
* ```
|
|
404
415
|
*
|
|
405
416
|
* @category constructors
|
|
@@ -411,13 +422,13 @@ export const make = <As extends readonly [any, ...Array<any>]>(...as: As): NonEm
|
|
|
411
422
|
/**
|
|
412
423
|
* Builds a `NonEmptyChunk` from a single element.
|
|
413
424
|
*
|
|
414
|
-
*
|
|
425
|
+
* **Example** (Creating a single-element chunk)
|
|
426
|
+
*
|
|
415
427
|
* ```ts
|
|
416
428
|
* import { Chunk } from "effect"
|
|
417
429
|
*
|
|
418
430
|
* const chunk = Chunk.of("hello")
|
|
419
|
-
* console.log(chunk)
|
|
420
|
-
* // { _id: 'Chunk', values: [ "hello" ] }
|
|
431
|
+
* console.log(Chunk.toArray(chunk)) // ["hello"]
|
|
421
432
|
* ```
|
|
422
433
|
*
|
|
423
434
|
* @category constructors
|
|
@@ -428,13 +439,13 @@ export const of = <A>(a: A): NonEmptyChunk<A> => makeChunk({ _tag: "ISingleton",
|
|
|
428
439
|
/**
|
|
429
440
|
* Creates a new `Chunk` from an iterable collection of values.
|
|
430
441
|
*
|
|
431
|
-
*
|
|
442
|
+
* **Example** (Creating chunks from iterables)
|
|
443
|
+
*
|
|
432
444
|
* ```ts
|
|
433
445
|
* import { Chunk } from "effect"
|
|
434
446
|
*
|
|
435
447
|
* const chunk = Chunk.fromIterable([1, 2, 3])
|
|
436
|
-
* console.log(chunk)
|
|
437
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
448
|
+
* console.log(Chunk.toArray(chunk)) // [1, 2, 3]
|
|
438
449
|
* ```
|
|
439
450
|
*
|
|
440
451
|
* @category constructors
|
|
@@ -478,7 +489,8 @@ const toArray_ = <A>(self: Chunk<A>): Array<A> => toReadonlyArray(self).slice()
|
|
|
478
489
|
* (`NonEmptyChunk`), the function will return a `NonEmptyArray`, ensuring the
|
|
479
490
|
* non-empty property is preserved.
|
|
480
491
|
*
|
|
481
|
-
*
|
|
492
|
+
* **Example** (Converting chunks to mutable arrays)
|
|
493
|
+
*
|
|
482
494
|
* ```ts
|
|
483
495
|
* import { Chunk } from "effect"
|
|
484
496
|
*
|
|
@@ -527,7 +539,8 @@ const toReadonlyArray_ = <A>(self: Chunk<A>): ReadonlyArray<A> => {
|
|
|
527
539
|
* non-empty (`NonEmptyChunk`), the function will return a
|
|
528
540
|
* `NonEmptyReadonlyArray`, ensuring the non-empty property is preserved.
|
|
529
541
|
*
|
|
530
|
-
*
|
|
542
|
+
* **Example** (Converting chunks to readonly arrays)
|
|
543
|
+
*
|
|
531
544
|
* ```ts
|
|
532
545
|
* import { Chunk } from "effect"
|
|
533
546
|
*
|
|
@@ -571,7 +584,7 @@ const reverseChunk = <A>(self: Chunk<A>): Chunk<A> => {
|
|
|
571
584
|
* Reverses the order of elements in a `Chunk`.
|
|
572
585
|
* Importantly, if the input chunk is a `NonEmptyChunk`, the reversed chunk will also be a `NonEmptyChunk`.
|
|
573
586
|
*
|
|
574
|
-
*
|
|
587
|
+
* **Example** (Reversing chunks)
|
|
575
588
|
*
|
|
576
589
|
* ```ts
|
|
577
590
|
* import { Chunk } from "effect"
|
|
@@ -579,19 +592,19 @@ const reverseChunk = <A>(self: Chunk<A>): Chunk<A> => {
|
|
|
579
592
|
* const chunk = Chunk.make(1, 2, 3)
|
|
580
593
|
* const result = Chunk.reverse(chunk)
|
|
581
594
|
*
|
|
582
|
-
* console.log(result)
|
|
583
|
-
* // { _id: 'Chunk', values: [ 3, 2, 1 ] }
|
|
595
|
+
* console.log(Chunk.toArray(result)) // [3, 2, 1]
|
|
584
596
|
* ```
|
|
585
597
|
*
|
|
586
|
-
* @since 2.0.0
|
|
587
598
|
* @category elements
|
|
599
|
+
* @since 2.0.0
|
|
588
600
|
*/
|
|
589
601
|
export const reverse: <S extends Chunk<any>>(self: S) => Chunk.With<S, Chunk.Infer<S>> = reverseChunk as any
|
|
590
602
|
|
|
591
603
|
/**
|
|
592
604
|
* This function provides a safe way to read a value at a particular index from a `Chunk`.
|
|
593
605
|
*
|
|
594
|
-
*
|
|
606
|
+
* **Example** (Accessing elements safely)
|
|
607
|
+
*
|
|
595
608
|
* ```ts
|
|
596
609
|
* import { Chunk } from "effect"
|
|
597
610
|
*
|
|
@@ -613,7 +626,8 @@ export const get: {
|
|
|
613
626
|
/**
|
|
614
627
|
* This function provides a safe way to read a value at a particular index from a `Chunk`.
|
|
615
628
|
*
|
|
616
|
-
*
|
|
629
|
+
* **Example** (Accessing elements safely)
|
|
630
|
+
*
|
|
617
631
|
* ```ts
|
|
618
632
|
* import { Chunk } from "effect"
|
|
619
633
|
*
|
|
@@ -635,7 +649,8 @@ export const get: {
|
|
|
635
649
|
/**
|
|
636
650
|
* This function provides a safe way to read a value at a particular index from a `Chunk`.
|
|
637
651
|
*
|
|
638
|
-
*
|
|
652
|
+
* **Example** (Accessing elements safely)
|
|
653
|
+
*
|
|
639
654
|
* ```ts
|
|
640
655
|
* import { Chunk } from "effect"
|
|
641
656
|
*
|
|
@@ -663,7 +678,8 @@ export const get: {
|
|
|
663
678
|
/**
|
|
664
679
|
* Wraps an array into a chunk without copying, unsafe on mutable arrays
|
|
665
680
|
*
|
|
666
|
-
*
|
|
681
|
+
* **Example** (Creating chunks without copying arrays)
|
|
682
|
+
*
|
|
667
683
|
* ```ts
|
|
668
684
|
* import { Chunk } from "effect"
|
|
669
685
|
*
|
|
@@ -676,8 +692,8 @@ export const get: {
|
|
|
676
692
|
* console.log(Chunk.toArray(chunk)) // [999, 2, 3, 4, 5]
|
|
677
693
|
* ```
|
|
678
694
|
*
|
|
679
|
-
* @since 2.0.0
|
|
680
695
|
* @category unsafe
|
|
696
|
+
* @since 2.0.0
|
|
681
697
|
*/
|
|
682
698
|
export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
|
|
683
699
|
self.length === 0 ? empty() : self.length === 1 ? of(self[0]) : makeChunk({ _tag: "IArray", array: self })
|
|
@@ -685,7 +701,8 @@ export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
|
|
|
685
701
|
/**
|
|
686
702
|
* Wraps an array into a chunk without copying, unsafe on mutable arrays
|
|
687
703
|
*
|
|
688
|
-
*
|
|
704
|
+
* **Example** (Creating non-empty chunks without copying arrays)
|
|
705
|
+
*
|
|
689
706
|
* ```ts
|
|
690
707
|
* import { Chunk } from "effect"
|
|
691
708
|
* import * as Array from "effect/Array"
|
|
@@ -698,8 +715,8 @@ export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
|
|
|
698
715
|
* console.log(Chunk.isNonEmpty(chunk)) // true
|
|
699
716
|
* ```
|
|
700
717
|
*
|
|
701
|
-
* @since 2.0.0
|
|
702
718
|
* @category unsafe
|
|
719
|
+
* @since 2.0.0
|
|
703
720
|
*/
|
|
704
721
|
export const fromNonEmptyArrayUnsafe = <A>(self: NonEmptyReadonlyArray<A>): NonEmptyChunk<A> =>
|
|
705
722
|
fromArrayUnsafe(self) as any
|
|
@@ -707,73 +724,64 @@ export const fromNonEmptyArrayUnsafe = <A>(self: NonEmptyReadonlyArray<A>): NonE
|
|
|
707
724
|
/**
|
|
708
725
|
* Gets an element unsafely, will throw on out of bounds
|
|
709
726
|
*
|
|
710
|
-
*
|
|
727
|
+
* **Example** (Accessing elements unsafely)
|
|
728
|
+
*
|
|
711
729
|
* ```ts
|
|
712
|
-
* import { Chunk } from "effect"
|
|
730
|
+
* import { Chunk, Option } from "effect"
|
|
713
731
|
*
|
|
714
732
|
* const chunk = Chunk.make("a", "b", "c", "d")
|
|
715
733
|
*
|
|
716
734
|
* console.log(Chunk.getUnsafe(chunk, 1)) // "b"
|
|
717
735
|
* console.log(Chunk.getUnsafe(chunk, 3)) // "d"
|
|
718
736
|
*
|
|
719
|
-
* //
|
|
720
|
-
*
|
|
721
|
-
* Chunk.getUnsafe(chunk, 10) // throws "Index out of bounds"
|
|
722
|
-
* } catch (error) {
|
|
723
|
-
* console.log((error as Error).message) // "Index out of bounds"
|
|
724
|
-
* }
|
|
737
|
+
* // Use Chunk.get when the index may be out of bounds
|
|
738
|
+
* console.log(Option.isNone(Chunk.get(chunk, 10))) // true
|
|
725
739
|
* ```
|
|
726
740
|
*
|
|
727
|
-
* @since 2.0.0
|
|
728
741
|
* @category unsafe
|
|
742
|
+
* @since 2.0.0
|
|
729
743
|
*/
|
|
730
744
|
export const getUnsafe: {
|
|
731
745
|
/**
|
|
732
746
|
* Gets an element unsafely, will throw on out of bounds
|
|
733
747
|
*
|
|
734
|
-
*
|
|
748
|
+
* **Example** (Accessing elements unsafely)
|
|
749
|
+
*
|
|
735
750
|
* ```ts
|
|
736
|
-
* import { Chunk } from "effect"
|
|
751
|
+
* import { Chunk, Option } from "effect"
|
|
737
752
|
*
|
|
738
753
|
* const chunk = Chunk.make("a", "b", "c", "d")
|
|
739
754
|
*
|
|
740
755
|
* console.log(Chunk.getUnsafe(chunk, 1)) // "b"
|
|
741
756
|
* console.log(Chunk.getUnsafe(chunk, 3)) // "d"
|
|
742
757
|
*
|
|
743
|
-
* //
|
|
744
|
-
*
|
|
745
|
-
* Chunk.getUnsafe(chunk, 10) // throws "Index out of bounds"
|
|
746
|
-
* } catch (error) {
|
|
747
|
-
* console.log((error as Error).message) // "Index out of bounds"
|
|
748
|
-
* }
|
|
758
|
+
* // Use Chunk.get when the index may be out of bounds
|
|
759
|
+
* console.log(Option.isNone(Chunk.get(chunk, 10))) // true
|
|
749
760
|
* ```
|
|
750
761
|
*
|
|
751
|
-
* @since 2.0.0
|
|
752
762
|
* @category unsafe
|
|
763
|
+
* @since 2.0.0
|
|
753
764
|
*/
|
|
754
765
|
(index: number): <A>(self: Chunk<A>) => A
|
|
755
766
|
/**
|
|
756
767
|
* Gets an element unsafely, will throw on out of bounds
|
|
757
768
|
*
|
|
758
|
-
*
|
|
769
|
+
* **Example** (Accessing elements unsafely)
|
|
770
|
+
*
|
|
759
771
|
* ```ts
|
|
760
|
-
* import { Chunk } from "effect"
|
|
772
|
+
* import { Chunk, Option } from "effect"
|
|
761
773
|
*
|
|
762
774
|
* const chunk = Chunk.make("a", "b", "c", "d")
|
|
763
775
|
*
|
|
764
776
|
* console.log(Chunk.getUnsafe(chunk, 1)) // "b"
|
|
765
777
|
* console.log(Chunk.getUnsafe(chunk, 3)) // "d"
|
|
766
778
|
*
|
|
767
|
-
* //
|
|
768
|
-
*
|
|
769
|
-
* Chunk.getUnsafe(chunk, 10) // throws "Index out of bounds"
|
|
770
|
-
* } catch (error) {
|
|
771
|
-
* console.log((error as Error).message) // "Index out of bounds"
|
|
772
|
-
* }
|
|
779
|
+
* // Use Chunk.get when the index may be out of bounds
|
|
780
|
+
* console.log(Option.isNone(Chunk.get(chunk, 10))) // true
|
|
773
781
|
* ```
|
|
774
782
|
*
|
|
775
|
-
* @since 2.0.0
|
|
776
783
|
* @category unsafe
|
|
784
|
+
* @since 2.0.0
|
|
777
785
|
*/
|
|
778
786
|
<A>(self: Chunk<A>, index: number): A
|
|
779
787
|
} = dual(2, <A>(self: Chunk<A>, index: number): A => {
|
|
@@ -808,7 +816,8 @@ export const getUnsafe: {
|
|
|
808
816
|
/**
|
|
809
817
|
* Appends the specified element to the end of the `Chunk`.
|
|
810
818
|
*
|
|
811
|
-
*
|
|
819
|
+
* **Example** (Appending an element)
|
|
820
|
+
*
|
|
812
821
|
* ```ts
|
|
813
822
|
* import { Chunk } from "effect"
|
|
814
823
|
*
|
|
@@ -829,7 +838,8 @@ export const append: {
|
|
|
829
838
|
/**
|
|
830
839
|
* Appends the specified element to the end of the `Chunk`.
|
|
831
840
|
*
|
|
832
|
-
*
|
|
841
|
+
* **Example** (Appending an element)
|
|
842
|
+
*
|
|
833
843
|
* ```ts
|
|
834
844
|
* import { Chunk } from "effect"
|
|
835
845
|
*
|
|
@@ -850,7 +860,8 @@ export const append: {
|
|
|
850
860
|
/**
|
|
851
861
|
* Appends the specified element to the end of the `Chunk`.
|
|
852
862
|
*
|
|
853
|
-
*
|
|
863
|
+
* **Example** (Appending an element)
|
|
864
|
+
*
|
|
854
865
|
* ```ts
|
|
855
866
|
* import { Chunk } from "effect"
|
|
856
867
|
*
|
|
@@ -873,7 +884,8 @@ export const append: {
|
|
|
873
884
|
/**
|
|
874
885
|
* Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
|
|
875
886
|
*
|
|
876
|
-
*
|
|
887
|
+
* **Example** (Prepending an element)
|
|
888
|
+
*
|
|
877
889
|
* ```ts
|
|
878
890
|
* import { Chunk } from "effect"
|
|
879
891
|
*
|
|
@@ -894,7 +906,8 @@ export const prepend: {
|
|
|
894
906
|
/**
|
|
895
907
|
* Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
|
|
896
908
|
*
|
|
897
|
-
*
|
|
909
|
+
* **Example** (Prepending an element)
|
|
910
|
+
*
|
|
898
911
|
* ```ts
|
|
899
912
|
* import { Chunk } from "effect"
|
|
900
913
|
*
|
|
@@ -915,7 +928,8 @@ export const prepend: {
|
|
|
915
928
|
/**
|
|
916
929
|
* Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
|
|
917
930
|
*
|
|
918
|
-
*
|
|
931
|
+
* **Example** (Prepending an element)
|
|
932
|
+
*
|
|
919
933
|
* ```ts
|
|
920
934
|
* import { Chunk } from "effect"
|
|
921
935
|
*
|
|
@@ -938,14 +952,14 @@ export const prepend: {
|
|
|
938
952
|
/**
|
|
939
953
|
* Takes the first up to `n` elements from the chunk.
|
|
940
954
|
*
|
|
941
|
-
*
|
|
955
|
+
* **Example** (Taking elements from the start)
|
|
956
|
+
*
|
|
942
957
|
* ```ts
|
|
943
958
|
* import { Chunk } from "effect"
|
|
944
959
|
*
|
|
945
960
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
946
961
|
* const result = Chunk.take(chunk, 3)
|
|
947
|
-
* console.log(result)
|
|
948
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
962
|
+
* console.log(Chunk.toArray(result)) // [1, 2, 3]
|
|
949
963
|
* ```
|
|
950
964
|
*
|
|
951
965
|
* @category elements
|
|
@@ -955,14 +969,14 @@ export const take: {
|
|
|
955
969
|
/**
|
|
956
970
|
* Takes the first up to `n` elements from the chunk.
|
|
957
971
|
*
|
|
958
|
-
*
|
|
972
|
+
* **Example** (Taking elements from the start)
|
|
973
|
+
*
|
|
959
974
|
* ```ts
|
|
960
975
|
* import { Chunk } from "effect"
|
|
961
976
|
*
|
|
962
977
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
963
978
|
* const result = Chunk.take(chunk, 3)
|
|
964
|
-
* console.log(result)
|
|
965
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
979
|
+
* console.log(Chunk.toArray(result)) // [1, 2, 3]
|
|
966
980
|
* ```
|
|
967
981
|
*
|
|
968
982
|
* @category elements
|
|
@@ -972,14 +986,14 @@ export const take: {
|
|
|
972
986
|
/**
|
|
973
987
|
* Takes the first up to `n` elements from the chunk.
|
|
974
988
|
*
|
|
975
|
-
*
|
|
989
|
+
* **Example** (Taking elements from the start)
|
|
990
|
+
*
|
|
976
991
|
* ```ts
|
|
977
992
|
* import { Chunk } from "effect"
|
|
978
993
|
*
|
|
979
994
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
980
995
|
* const result = Chunk.take(chunk, 3)
|
|
981
|
-
* console.log(result)
|
|
982
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
996
|
+
* console.log(Chunk.toArray(result)) // [1, 2, 3]
|
|
983
997
|
* ```
|
|
984
998
|
*
|
|
985
999
|
* @category elements
|
|
@@ -1027,14 +1041,14 @@ export const take: {
|
|
|
1027
1041
|
/**
|
|
1028
1042
|
* Drops the first up to `n` elements from the chunk.
|
|
1029
1043
|
*
|
|
1030
|
-
*
|
|
1044
|
+
* **Example** (Dropping elements from the start)
|
|
1045
|
+
*
|
|
1031
1046
|
* ```ts
|
|
1032
1047
|
* import { Chunk } from "effect"
|
|
1033
1048
|
*
|
|
1034
1049
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1035
1050
|
* const result = Chunk.drop(chunk, 2)
|
|
1036
|
-
* console.log(result)
|
|
1037
|
-
* // { _id: 'Chunk', values: [ 3, 4, 5 ] }
|
|
1051
|
+
* console.log(Chunk.toArray(result)) // [3, 4, 5]
|
|
1038
1052
|
* ```
|
|
1039
1053
|
*
|
|
1040
1054
|
* @category elements
|
|
@@ -1044,14 +1058,14 @@ export const drop: {
|
|
|
1044
1058
|
/**
|
|
1045
1059
|
* Drops the first up to `n` elements from the chunk.
|
|
1046
1060
|
*
|
|
1047
|
-
*
|
|
1061
|
+
* **Example** (Dropping elements from the start)
|
|
1062
|
+
*
|
|
1048
1063
|
* ```ts
|
|
1049
1064
|
* import { Chunk } from "effect"
|
|
1050
1065
|
*
|
|
1051
1066
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1052
1067
|
* const result = Chunk.drop(chunk, 2)
|
|
1053
|
-
* console.log(result)
|
|
1054
|
-
* // { _id: 'Chunk', values: [ 3, 4, 5 ] }
|
|
1068
|
+
* console.log(Chunk.toArray(result)) // [3, 4, 5]
|
|
1055
1069
|
* ```
|
|
1056
1070
|
*
|
|
1057
1071
|
* @category elements
|
|
@@ -1061,14 +1075,14 @@ export const drop: {
|
|
|
1061
1075
|
/**
|
|
1062
1076
|
* Drops the first up to `n` elements from the chunk.
|
|
1063
1077
|
*
|
|
1064
|
-
*
|
|
1078
|
+
* **Example** (Dropping elements from the start)
|
|
1079
|
+
*
|
|
1065
1080
|
* ```ts
|
|
1066
1081
|
* import { Chunk } from "effect"
|
|
1067
1082
|
*
|
|
1068
1083
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1069
1084
|
* const result = Chunk.drop(chunk, 2)
|
|
1070
|
-
* console.log(result)
|
|
1071
|
-
* // { _id: 'Chunk', values: [ 3, 4, 5 ] }
|
|
1085
|
+
* console.log(Chunk.toArray(result)) // [3, 4, 5]
|
|
1072
1086
|
* ```
|
|
1073
1087
|
*
|
|
1074
1088
|
* @category elements
|
|
@@ -1115,14 +1129,14 @@ export const drop: {
|
|
|
1115
1129
|
/**
|
|
1116
1130
|
* Drops the last `n` elements.
|
|
1117
1131
|
*
|
|
1118
|
-
*
|
|
1132
|
+
* **Example** (Dropping elements from the end)
|
|
1133
|
+
*
|
|
1119
1134
|
* ```ts
|
|
1120
1135
|
* import { Chunk } from "effect"
|
|
1121
1136
|
*
|
|
1122
1137
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1123
1138
|
* const result = Chunk.dropRight(chunk, 2)
|
|
1124
|
-
* console.log(result)
|
|
1125
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
1139
|
+
* console.log(Chunk.toArray(result)) // [1, 2, 3]
|
|
1126
1140
|
* ```
|
|
1127
1141
|
*
|
|
1128
1142
|
* @category elements
|
|
@@ -1132,14 +1146,14 @@ export const dropRight: {
|
|
|
1132
1146
|
/**
|
|
1133
1147
|
* Drops the last `n` elements.
|
|
1134
1148
|
*
|
|
1135
|
-
*
|
|
1149
|
+
* **Example** (Dropping elements from the end)
|
|
1150
|
+
*
|
|
1136
1151
|
* ```ts
|
|
1137
1152
|
* import { Chunk } from "effect"
|
|
1138
1153
|
*
|
|
1139
1154
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1140
1155
|
* const result = Chunk.dropRight(chunk, 2)
|
|
1141
|
-
* console.log(result)
|
|
1142
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
1156
|
+
* console.log(Chunk.toArray(result)) // [1, 2, 3]
|
|
1143
1157
|
* ```
|
|
1144
1158
|
*
|
|
1145
1159
|
* @category elements
|
|
@@ -1149,14 +1163,14 @@ export const dropRight: {
|
|
|
1149
1163
|
/**
|
|
1150
1164
|
* Drops the last `n` elements.
|
|
1151
1165
|
*
|
|
1152
|
-
*
|
|
1166
|
+
* **Example** (Dropping elements from the end)
|
|
1167
|
+
*
|
|
1153
1168
|
* ```ts
|
|
1154
1169
|
* import { Chunk } from "effect"
|
|
1155
1170
|
*
|
|
1156
1171
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1157
1172
|
* const result = Chunk.dropRight(chunk, 2)
|
|
1158
|
-
* console.log(result)
|
|
1159
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3 ] }
|
|
1173
|
+
* console.log(Chunk.toArray(result)) // [1, 2, 3]
|
|
1160
1174
|
* ```
|
|
1161
1175
|
*
|
|
1162
1176
|
* @category elements
|
|
@@ -1168,14 +1182,14 @@ export const dropRight: {
|
|
|
1168
1182
|
/**
|
|
1169
1183
|
* Drops all elements so long as the predicate returns true.
|
|
1170
1184
|
*
|
|
1171
|
-
*
|
|
1185
|
+
* **Example** (Dropping elements while a predicate matches)
|
|
1186
|
+
*
|
|
1172
1187
|
* ```ts
|
|
1173
1188
|
* import { Chunk } from "effect"
|
|
1174
1189
|
*
|
|
1175
1190
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1176
1191
|
* const result = Chunk.dropWhile(chunk, (n) => n < 3)
|
|
1177
|
-
* console.log(result)
|
|
1178
|
-
* // { _id: 'Chunk', values: [ 3, 4, 5 ] }
|
|
1192
|
+
* console.log(Chunk.toArray(result)) // [3, 4, 5]
|
|
1179
1193
|
* ```
|
|
1180
1194
|
*
|
|
1181
1195
|
* @category elements
|
|
@@ -1185,14 +1199,14 @@ export const dropWhile: {
|
|
|
1185
1199
|
/**
|
|
1186
1200
|
* Drops all elements so long as the predicate returns true.
|
|
1187
1201
|
*
|
|
1188
|
-
*
|
|
1202
|
+
* **Example** (Dropping elements while a predicate matches)
|
|
1203
|
+
*
|
|
1189
1204
|
* ```ts
|
|
1190
1205
|
* import { Chunk } from "effect"
|
|
1191
1206
|
*
|
|
1192
1207
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1193
1208
|
* const result = Chunk.dropWhile(chunk, (n) => n < 3)
|
|
1194
|
-
* console.log(result)
|
|
1195
|
-
* // { _id: 'Chunk', values: [ 3, 4, 5 ] }
|
|
1209
|
+
* console.log(Chunk.toArray(result)) // [3, 4, 5]
|
|
1196
1210
|
* ```
|
|
1197
1211
|
*
|
|
1198
1212
|
* @category elements
|
|
@@ -1202,14 +1216,14 @@ export const dropWhile: {
|
|
|
1202
1216
|
/**
|
|
1203
1217
|
* Drops all elements so long as the predicate returns true.
|
|
1204
1218
|
*
|
|
1205
|
-
*
|
|
1219
|
+
* **Example** (Dropping elements while a predicate matches)
|
|
1220
|
+
*
|
|
1206
1221
|
* ```ts
|
|
1207
1222
|
* import { Chunk } from "effect"
|
|
1208
1223
|
*
|
|
1209
1224
|
* const chunk = Chunk.make(1, 2, 3, 4, 5)
|
|
1210
1225
|
* const result = Chunk.dropWhile(chunk, (n) => n < 3)
|
|
1211
|
-
* console.log(result)
|
|
1212
|
-
* // { _id: 'Chunk', values: [ 3, 4, 5 ] }
|
|
1226
|
+
* console.log(Chunk.toArray(result)) // [3, 4, 5]
|
|
1213
1227
|
* ```
|
|
1214
1228
|
*
|
|
1215
1229
|
* @category elements
|
|
@@ -1230,7 +1244,7 @@ export const dropWhile: {
|
|
|
1230
1244
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
1231
1245
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1232
1246
|
*
|
|
1233
|
-
*
|
|
1247
|
+
* **Example** (Prepending all elements)
|
|
1234
1248
|
*
|
|
1235
1249
|
* ```ts
|
|
1236
1250
|
* import { Chunk } from "effect"
|
|
@@ -1252,7 +1266,7 @@ export const prependAll: {
|
|
|
1252
1266
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
1253
1267
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1254
1268
|
*
|
|
1255
|
-
*
|
|
1269
|
+
* **Example** (Prepending all elements)
|
|
1256
1270
|
*
|
|
1257
1271
|
* ```ts
|
|
1258
1272
|
* import { Chunk } from "effect"
|
|
@@ -1274,7 +1288,7 @@ export const prependAll: {
|
|
|
1274
1288
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
1275
1289
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1276
1290
|
*
|
|
1277
|
-
*
|
|
1291
|
+
* **Example** (Prepending all elements)
|
|
1278
1292
|
*
|
|
1279
1293
|
* ```ts
|
|
1280
1294
|
* import { Chunk } from "effect"
|
|
@@ -1296,7 +1310,7 @@ export const prependAll: {
|
|
|
1296
1310
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
1297
1311
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1298
1312
|
*
|
|
1299
|
-
*
|
|
1313
|
+
* **Example** (Prepending all elements)
|
|
1300
1314
|
*
|
|
1301
1315
|
* ```ts
|
|
1302
1316
|
* import { Chunk } from "effect"
|
|
@@ -1318,7 +1332,7 @@ export const prependAll: {
|
|
|
1318
1332
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
1319
1333
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1320
1334
|
*
|
|
1321
|
-
*
|
|
1335
|
+
* **Example** (Prepending all elements)
|
|
1322
1336
|
*
|
|
1323
1337
|
* ```ts
|
|
1324
1338
|
* import { Chunk } from "effect"
|
|
@@ -1342,7 +1356,7 @@ export const prependAll: {
|
|
|
1342
1356
|
* Concatenates two chunks, combining their elements.
|
|
1343
1357
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1344
1358
|
*
|
|
1345
|
-
*
|
|
1359
|
+
* **Example** (Appending all elements)
|
|
1346
1360
|
*
|
|
1347
1361
|
* ```ts
|
|
1348
1362
|
* import { Chunk } from "effect"
|
|
@@ -1364,7 +1378,7 @@ export const appendAll: {
|
|
|
1364
1378
|
* Concatenates two chunks, combining their elements.
|
|
1365
1379
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1366
1380
|
*
|
|
1367
|
-
*
|
|
1381
|
+
* **Example** (Appending all elements)
|
|
1368
1382
|
*
|
|
1369
1383
|
* ```ts
|
|
1370
1384
|
* import { Chunk } from "effect"
|
|
@@ -1386,7 +1400,7 @@ export const appendAll: {
|
|
|
1386
1400
|
* Concatenates two chunks, combining their elements.
|
|
1387
1401
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1388
1402
|
*
|
|
1389
|
-
*
|
|
1403
|
+
* **Example** (Appending all elements)
|
|
1390
1404
|
*
|
|
1391
1405
|
* ```ts
|
|
1392
1406
|
* import { Chunk } from "effect"
|
|
@@ -1408,7 +1422,7 @@ export const appendAll: {
|
|
|
1408
1422
|
* Concatenates two chunks, combining their elements.
|
|
1409
1423
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1410
1424
|
*
|
|
1411
|
-
*
|
|
1425
|
+
* **Example** (Appending all elements)
|
|
1412
1426
|
*
|
|
1413
1427
|
* ```ts
|
|
1414
1428
|
* import { Chunk } from "effect"
|
|
@@ -1430,7 +1444,7 @@ export const appendAll: {
|
|
|
1430
1444
|
* Concatenates two chunks, combining their elements.
|
|
1431
1445
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1432
1446
|
*
|
|
1433
|
-
*
|
|
1447
|
+
* **Example** (Appending all elements)
|
|
1434
1448
|
*
|
|
1435
1449
|
* ```ts
|
|
1436
1450
|
* import { Chunk } from "effect"
|
|
@@ -1461,7 +1475,7 @@ export const appendAll: {
|
|
|
1461
1475
|
* Concatenates two chunks, combining their elements.
|
|
1462
1476
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
1463
1477
|
*
|
|
1464
|
-
*
|
|
1478
|
+
* **Example** (Appending all elements)
|
|
1465
1479
|
*
|
|
1466
1480
|
* ```ts
|
|
1467
1481
|
* import { Chunk } from "effect"
|
|
@@ -1513,7 +1527,8 @@ export const appendAll: {
|
|
|
1513
1527
|
/**
|
|
1514
1528
|
* Returns a filtered and mapped subset of the elements.
|
|
1515
1529
|
*
|
|
1516
|
-
*
|
|
1530
|
+
* **Example** (Filtering and mapping values)
|
|
1531
|
+
*
|
|
1517
1532
|
* ```ts
|
|
1518
1533
|
* import { Chunk } from "effect"
|
|
1519
1534
|
* import * as Result from "effect/Result"
|
|
@@ -1533,14 +1548,15 @@ export const appendAll: {
|
|
|
1533
1548
|
* console.log(Chunk.toArray(evenIndexNumbers)) // [1]
|
|
1534
1549
|
* ```
|
|
1535
1550
|
*
|
|
1536
|
-
* @since 2.0.0
|
|
1537
1551
|
* @category filtering
|
|
1552
|
+
* @since 2.0.0
|
|
1538
1553
|
*/
|
|
1539
1554
|
export const filterMap: {
|
|
1540
1555
|
/**
|
|
1541
1556
|
* Returns a filtered and mapped subset of the elements.
|
|
1542
1557
|
*
|
|
1543
|
-
*
|
|
1558
|
+
* **Example** (Filtering and mapping values)
|
|
1559
|
+
*
|
|
1544
1560
|
* ```ts
|
|
1545
1561
|
* import { Chunk } from "effect"
|
|
1546
1562
|
* import * as Result from "effect/Result"
|
|
@@ -1560,14 +1576,15 @@ export const filterMap: {
|
|
|
1560
1576
|
* console.log(Chunk.toArray(evenIndexNumbers)) // [1]
|
|
1561
1577
|
* ```
|
|
1562
1578
|
*
|
|
1563
|
-
* @since 2.0.0
|
|
1564
1579
|
* @category filtering
|
|
1580
|
+
* @since 2.0.0
|
|
1565
1581
|
*/
|
|
1566
1582
|
<A, B, X>(f: (input: A, i: number) => Result<B, X>): (self: Chunk<A>) => Chunk<B>
|
|
1567
1583
|
/**
|
|
1568
1584
|
* Returns a filtered and mapped subset of the elements.
|
|
1569
1585
|
*
|
|
1570
|
-
*
|
|
1586
|
+
* **Example** (Filtering and mapping values)
|
|
1587
|
+
*
|
|
1571
1588
|
* ```ts
|
|
1572
1589
|
* import { Chunk } from "effect"
|
|
1573
1590
|
* import * as Result from "effect/Result"
|
|
@@ -1587,8 +1604,8 @@ export const filterMap: {
|
|
|
1587
1604
|
* console.log(Chunk.toArray(evenIndexNumbers)) // [1]
|
|
1588
1605
|
* ```
|
|
1589
1606
|
*
|
|
1590
|
-
* @since 2.0.0
|
|
1591
1607
|
* @category filtering
|
|
1608
|
+
* @since 2.0.0
|
|
1592
1609
|
*/
|
|
1593
1610
|
<A, B, X>(self: Chunk<A>, f: (input: A, i: number) => Result<B, X>): Chunk<B>
|
|
1594
1611
|
} = dual(
|
|
@@ -1609,7 +1626,8 @@ export const filterMap: {
|
|
|
1609
1626
|
/**
|
|
1610
1627
|
* Returns a filtered subset of the elements.
|
|
1611
1628
|
*
|
|
1612
|
-
*
|
|
1629
|
+
* **Example** (Filtering values)
|
|
1630
|
+
*
|
|
1613
1631
|
* ```ts
|
|
1614
1632
|
* import { Chunk } from "effect"
|
|
1615
1633
|
*
|
|
@@ -1623,14 +1641,15 @@ export const filterMap: {
|
|
|
1623
1641
|
* console.log(Chunk.toArray(numbers)) // [42, 100]
|
|
1624
1642
|
* ```
|
|
1625
1643
|
*
|
|
1626
|
-
* @since 2.0.0
|
|
1627
1644
|
* @category filtering
|
|
1645
|
+
* @since 2.0.0
|
|
1628
1646
|
*/
|
|
1629
1647
|
export const filter: {
|
|
1630
1648
|
/**
|
|
1631
1649
|
* Returns a filtered subset of the elements.
|
|
1632
1650
|
*
|
|
1633
|
-
*
|
|
1651
|
+
* **Example** (Filtering values)
|
|
1652
|
+
*
|
|
1634
1653
|
* ```ts
|
|
1635
1654
|
* import { Chunk } from "effect"
|
|
1636
1655
|
*
|
|
@@ -1644,14 +1663,15 @@ export const filter: {
|
|
|
1644
1663
|
* console.log(Chunk.toArray(numbers)) // [42, 100]
|
|
1645
1664
|
* ```
|
|
1646
1665
|
*
|
|
1647
|
-
* @since 2.0.0
|
|
1648
1666
|
* @category filtering
|
|
1667
|
+
* @since 2.0.0
|
|
1649
1668
|
*/
|
|
1650
1669
|
<A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Chunk<B>
|
|
1651
1670
|
/**
|
|
1652
1671
|
* Returns a filtered subset of the elements.
|
|
1653
1672
|
*
|
|
1654
|
-
*
|
|
1673
|
+
* **Example** (Filtering values)
|
|
1674
|
+
*
|
|
1655
1675
|
* ```ts
|
|
1656
1676
|
* import { Chunk } from "effect"
|
|
1657
1677
|
*
|
|
@@ -1665,14 +1685,15 @@ export const filter: {
|
|
|
1665
1685
|
* console.log(Chunk.toArray(numbers)) // [42, 100]
|
|
1666
1686
|
* ```
|
|
1667
1687
|
*
|
|
1668
|
-
* @since 2.0.0
|
|
1669
1688
|
* @category filtering
|
|
1689
|
+
* @since 2.0.0
|
|
1670
1690
|
*/
|
|
1671
1691
|
<A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Chunk<A>
|
|
1672
1692
|
/**
|
|
1673
1693
|
* Returns a filtered subset of the elements.
|
|
1674
1694
|
*
|
|
1675
|
-
*
|
|
1695
|
+
* **Example** (Filtering values)
|
|
1696
|
+
*
|
|
1676
1697
|
* ```ts
|
|
1677
1698
|
* import { Chunk } from "effect"
|
|
1678
1699
|
*
|
|
@@ -1686,14 +1707,15 @@ export const filter: {
|
|
|
1686
1707
|
* console.log(Chunk.toArray(numbers)) // [42, 100]
|
|
1687
1708
|
* ```
|
|
1688
1709
|
*
|
|
1689
|
-
* @since 2.0.0
|
|
1690
1710
|
* @category filtering
|
|
1711
|
+
* @since 2.0.0
|
|
1691
1712
|
*/
|
|
1692
1713
|
<A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Chunk<B>
|
|
1693
1714
|
/**
|
|
1694
1715
|
* Returns a filtered subset of the elements.
|
|
1695
1716
|
*
|
|
1696
|
-
*
|
|
1717
|
+
* **Example** (Filtering values)
|
|
1718
|
+
*
|
|
1697
1719
|
* ```ts
|
|
1698
1720
|
* import { Chunk } from "effect"
|
|
1699
1721
|
*
|
|
@@ -1707,8 +1729,8 @@ export const filter: {
|
|
|
1707
1729
|
* console.log(Chunk.toArray(numbers)) // [42, 100]
|
|
1708
1730
|
* ```
|
|
1709
1731
|
*
|
|
1710
|
-
* @since 2.0.0
|
|
1711
1732
|
* @category filtering
|
|
1733
|
+
* @since 2.0.0
|
|
1712
1734
|
*/
|
|
1713
1735
|
<A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A>
|
|
1714
1736
|
} = dual(
|
|
@@ -1719,7 +1741,8 @@ export const filter: {
|
|
|
1719
1741
|
/**
|
|
1720
1742
|
* Transforms all elements of the chunk for as long as the specified function succeeds.
|
|
1721
1743
|
*
|
|
1722
|
-
*
|
|
1744
|
+
* **Example** (Filtering and mapping while values match)
|
|
1745
|
+
*
|
|
1723
1746
|
* ```ts
|
|
1724
1747
|
* import { Chunk } from "effect"
|
|
1725
1748
|
* import * as Result from "effect/Result"
|
|
@@ -1740,14 +1763,15 @@ export const filter: {
|
|
|
1740
1763
|
* console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
|
|
1741
1764
|
* ```
|
|
1742
1765
|
*
|
|
1743
|
-
* @since 2.0.0
|
|
1744
1766
|
* @category filtering
|
|
1767
|
+
* @since 2.0.0
|
|
1745
1768
|
*/
|
|
1746
1769
|
export const filterMapWhile: {
|
|
1747
1770
|
/**
|
|
1748
1771
|
* Transforms all elements of the chunk for as long as the specified function succeeds.
|
|
1749
1772
|
*
|
|
1750
|
-
*
|
|
1773
|
+
* **Example** (Filtering and mapping while values match)
|
|
1774
|
+
*
|
|
1751
1775
|
* ```ts
|
|
1752
1776
|
* import { Chunk } from "effect"
|
|
1753
1777
|
* import * as Result from "effect/Result"
|
|
@@ -1768,14 +1792,15 @@ export const filterMapWhile: {
|
|
|
1768
1792
|
* console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
|
|
1769
1793
|
* ```
|
|
1770
1794
|
*
|
|
1771
|
-
* @since 2.0.0
|
|
1772
1795
|
* @category filtering
|
|
1796
|
+
* @since 2.0.0
|
|
1773
1797
|
*/
|
|
1774
1798
|
<A, B, X>(f: Filter.Filter<A, B, X>): (self: Chunk<A>) => Chunk<B>
|
|
1775
1799
|
/**
|
|
1776
1800
|
* Transforms all elements of the chunk for as long as the specified function succeeds.
|
|
1777
1801
|
*
|
|
1778
|
-
*
|
|
1802
|
+
* **Example** (Filtering and mapping while values match)
|
|
1803
|
+
*
|
|
1779
1804
|
* ```ts
|
|
1780
1805
|
* import { Chunk } from "effect"
|
|
1781
1806
|
* import * as Result from "effect/Result"
|
|
@@ -1796,8 +1821,8 @@ export const filterMapWhile: {
|
|
|
1796
1821
|
* console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
|
|
1797
1822
|
* ```
|
|
1798
1823
|
*
|
|
1799
|
-
* @since 2.0.0
|
|
1800
1824
|
* @category filtering
|
|
1825
|
+
* @since 2.0.0
|
|
1801
1826
|
*/
|
|
1802
1827
|
<A, B, X>(self: Chunk<A>, f: Filter.Filter<A, B, X>): Chunk<B>
|
|
1803
1828
|
} = dual(2, <A, B, X>(self: Chunk<A>, f: Filter.Filter<A, B, X>): Chunk<B> => {
|
|
@@ -1816,15 +1841,15 @@ export const filterMapWhile: {
|
|
|
1816
1841
|
/**
|
|
1817
1842
|
* Filter out optional values
|
|
1818
1843
|
*
|
|
1819
|
-
*
|
|
1844
|
+
* **Example** (Compacting optional values)
|
|
1845
|
+
*
|
|
1820
1846
|
* ```ts
|
|
1821
1847
|
* import { Chunk } from "effect"
|
|
1822
1848
|
* import * as Option from "effect/Option"
|
|
1823
1849
|
*
|
|
1824
1850
|
* const chunk = Chunk.make(Option.some(1), Option.none(), Option.some(3))
|
|
1825
1851
|
* const result = Chunk.compact(chunk)
|
|
1826
|
-
* console.log(result)
|
|
1827
|
-
* // { _id: 'Chunk', values: [ 1, 3 ] }
|
|
1852
|
+
* console.log(Chunk.toArray(result)) // [1, 3]
|
|
1828
1853
|
* ```
|
|
1829
1854
|
*
|
|
1830
1855
|
* @category filtering
|
|
@@ -1843,7 +1868,8 @@ export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => {
|
|
|
1843
1868
|
/**
|
|
1844
1869
|
* Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
|
|
1845
1870
|
*
|
|
1846
|
-
*
|
|
1871
|
+
* **Example** (Flat mapping chunks)
|
|
1872
|
+
*
|
|
1847
1873
|
* ```ts
|
|
1848
1874
|
* import { Chunk } from "effect"
|
|
1849
1875
|
*
|
|
@@ -1864,14 +1890,15 @@ export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => {
|
|
|
1864
1890
|
* console.log(Chunk.toArray(indexed)) // [1, 3, 5]
|
|
1865
1891
|
* ```
|
|
1866
1892
|
*
|
|
1867
|
-
* @since 2.0.0
|
|
1868
1893
|
* @category sequencing
|
|
1894
|
+
* @since 2.0.0
|
|
1869
1895
|
*/
|
|
1870
1896
|
export const flatMap: {
|
|
1871
1897
|
/**
|
|
1872
1898
|
* Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
|
|
1873
1899
|
*
|
|
1874
|
-
*
|
|
1900
|
+
* **Example** (Flat mapping chunks)
|
|
1901
|
+
*
|
|
1875
1902
|
* ```ts
|
|
1876
1903
|
* import { Chunk } from "effect"
|
|
1877
1904
|
*
|
|
@@ -1892,14 +1919,15 @@ export const flatMap: {
|
|
|
1892
1919
|
* console.log(Chunk.toArray(indexed)) // [1, 3, 5]
|
|
1893
1920
|
* ```
|
|
1894
1921
|
*
|
|
1895
|
-
* @since 2.0.0
|
|
1896
1922
|
* @category sequencing
|
|
1923
|
+
* @since 2.0.0
|
|
1897
1924
|
*/
|
|
1898
1925
|
<S extends Chunk<any>, T extends Chunk<any>>(f: (a: Chunk.Infer<S>, i: number) => T): (self: S) => Chunk.AndNonEmpty<S, T, Chunk.Infer<T>>
|
|
1899
1926
|
/**
|
|
1900
1927
|
* Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
|
|
1901
1928
|
*
|
|
1902
|
-
*
|
|
1929
|
+
* **Example** (Flat mapping chunks)
|
|
1930
|
+
*
|
|
1903
1931
|
* ```ts
|
|
1904
1932
|
* import { Chunk } from "effect"
|
|
1905
1933
|
*
|
|
@@ -1920,14 +1948,15 @@ export const flatMap: {
|
|
|
1920
1948
|
* console.log(Chunk.toArray(indexed)) // [1, 3, 5]
|
|
1921
1949
|
* ```
|
|
1922
1950
|
*
|
|
1923
|
-
* @since 2.0.0
|
|
1924
1951
|
* @category sequencing
|
|
1952
|
+
* @since 2.0.0
|
|
1925
1953
|
*/
|
|
1926
1954
|
<A, B>(self: NonEmptyChunk<A>, f: (a: A, i: number) => NonEmptyChunk<B>): NonEmptyChunk<B>
|
|
1927
1955
|
/**
|
|
1928
1956
|
* Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
|
|
1929
1957
|
*
|
|
1930
|
-
*
|
|
1958
|
+
* **Example** (Flat mapping chunks)
|
|
1959
|
+
*
|
|
1931
1960
|
* ```ts
|
|
1932
1961
|
* import { Chunk } from "effect"
|
|
1933
1962
|
*
|
|
@@ -1948,8 +1977,8 @@ export const flatMap: {
|
|
|
1948
1977
|
* console.log(Chunk.toArray(indexed)) // [1, 3, 5]
|
|
1949
1978
|
* ```
|
|
1950
1979
|
*
|
|
1951
|
-
* @since 2.0.0
|
|
1952
1980
|
* @category sequencing
|
|
1981
|
+
* @since 2.0.0
|
|
1953
1982
|
*/
|
|
1954
1983
|
<A, B>(self: Chunk<A>, f: (a: A, i: number) => Chunk<B>): Chunk<B>
|
|
1955
1984
|
} = dual(2, <A, B>(self: Chunk<A>, f: (a: A, i: number) => Chunk<B>) => {
|
|
@@ -1974,7 +2003,8 @@ export const flatMap: {
|
|
|
1974
2003
|
* instead, it is primarily used for side effects, such as logging or
|
|
1975
2004
|
* accumulating data in an external variable.
|
|
1976
2005
|
*
|
|
1977
|
-
*
|
|
2006
|
+
* **Example** (Iterating over chunk values)
|
|
2007
|
+
*
|
|
1978
2008
|
* ```ts
|
|
1979
2009
|
* import { Chunk } from "effect"
|
|
1980
2010
|
*
|
|
@@ -1997,8 +2027,8 @@ export const flatMap: {
|
|
|
1997
2027
|
* // Index 3: 4
|
|
1998
2028
|
* ```
|
|
1999
2029
|
*
|
|
2000
|
-
* @since 2.0.0
|
|
2001
2030
|
* @category combinators
|
|
2031
|
+
* @since 2.0.0
|
|
2002
2032
|
*/
|
|
2003
2033
|
export const forEach: {
|
|
2004
2034
|
/**
|
|
@@ -2011,7 +2041,8 @@ export const forEach: {
|
|
|
2011
2041
|
* instead, it is primarily used for side effects, such as logging or
|
|
2012
2042
|
* accumulating data in an external variable.
|
|
2013
2043
|
*
|
|
2014
|
-
*
|
|
2044
|
+
* **Example** (Iterating over chunk values)
|
|
2045
|
+
*
|
|
2015
2046
|
* ```ts
|
|
2016
2047
|
* import { Chunk } from "effect"
|
|
2017
2048
|
*
|
|
@@ -2034,8 +2065,8 @@ export const forEach: {
|
|
|
2034
2065
|
* // Index 3: 4
|
|
2035
2066
|
* ```
|
|
2036
2067
|
*
|
|
2037
|
-
* @since 2.0.0
|
|
2038
2068
|
* @category combinators
|
|
2069
|
+
* @since 2.0.0
|
|
2039
2070
|
*/
|
|
2040
2071
|
<A, B>(f: (a: A, index: number) => B): (self: Chunk<A>) => void
|
|
2041
2072
|
/**
|
|
@@ -2048,7 +2079,8 @@ export const forEach: {
|
|
|
2048
2079
|
* instead, it is primarily used for side effects, such as logging or
|
|
2049
2080
|
* accumulating data in an external variable.
|
|
2050
2081
|
*
|
|
2051
|
-
*
|
|
2082
|
+
* **Example** (Iterating over chunk values)
|
|
2083
|
+
*
|
|
2052
2084
|
* ```ts
|
|
2053
2085
|
* import { Chunk } from "effect"
|
|
2054
2086
|
*
|
|
@@ -2071,8 +2103,8 @@ export const forEach: {
|
|
|
2071
2103
|
* // Index 3: 4
|
|
2072
2104
|
* ```
|
|
2073
2105
|
*
|
|
2074
|
-
* @since 2.0.0
|
|
2075
2106
|
* @category combinators
|
|
2107
|
+
* @since 2.0.0
|
|
2076
2108
|
*/
|
|
2077
2109
|
<A, B>(self: Chunk<A>, f: (a: A, index: number) => B): void
|
|
2078
2110
|
} = dual(2, <A, B>(self: Chunk<A>, f: (a: A) => B): void => toReadonlyArray(self).forEach(f))
|
|
@@ -2080,7 +2112,8 @@ export const forEach: {
|
|
|
2080
2112
|
/**
|
|
2081
2113
|
* Flattens a chunk of chunks into a single chunk by concatenating all chunks.
|
|
2082
2114
|
*
|
|
2083
|
-
*
|
|
2115
|
+
* **Example** (Flattening nested chunks)
|
|
2116
|
+
*
|
|
2084
2117
|
* ```ts
|
|
2085
2118
|
* import { Chunk } from "effect"
|
|
2086
2119
|
*
|
|
@@ -2101,15 +2134,16 @@ export const forEach: {
|
|
|
2101
2134
|
* console.log(Chunk.toArray(Chunk.flatten(withEmpty))) // [1, 2, 3, 4]
|
|
2102
2135
|
* ```
|
|
2103
2136
|
*
|
|
2104
|
-
* @since 2.0.0
|
|
2105
2137
|
* @category sequencing
|
|
2138
|
+
* @since 2.0.0
|
|
2106
2139
|
*/
|
|
2107
2140
|
export const flatten: <S extends Chunk<Chunk<any>>>(self: S) => Chunk.Flatten<S> = flatMap(identity) as any
|
|
2108
2141
|
|
|
2109
2142
|
/**
|
|
2110
2143
|
* Groups elements in chunks of up to `n` elements.
|
|
2111
2144
|
*
|
|
2112
|
-
*
|
|
2145
|
+
* **Example** (Splitting into fixed-size chunks)
|
|
2146
|
+
*
|
|
2113
2147
|
* ```ts
|
|
2114
2148
|
* import { Chunk } from "effect"
|
|
2115
2149
|
*
|
|
@@ -2126,14 +2160,15 @@ export const flatten: <S extends Chunk<Chunk<any>>>(self: S) => Chunk.Flatten<S>
|
|
|
2126
2160
|
* // [[1, 2], [3, 4], [5]]
|
|
2127
2161
|
* ```
|
|
2128
2162
|
*
|
|
2129
|
-
* @since 2.0.0
|
|
2130
2163
|
* @category elements
|
|
2164
|
+
* @since 2.0.0
|
|
2131
2165
|
*/
|
|
2132
2166
|
export const chunksOf: {
|
|
2133
2167
|
/**
|
|
2134
2168
|
* Groups elements in chunks of up to `n` elements.
|
|
2135
2169
|
*
|
|
2136
|
-
*
|
|
2170
|
+
* **Example** (Splitting into fixed-size chunks)
|
|
2171
|
+
*
|
|
2137
2172
|
* ```ts
|
|
2138
2173
|
* import { Chunk } from "effect"
|
|
2139
2174
|
*
|
|
@@ -2150,14 +2185,15 @@ export const chunksOf: {
|
|
|
2150
2185
|
* // [[1, 2], [3, 4], [5]]
|
|
2151
2186
|
* ```
|
|
2152
2187
|
*
|
|
2153
|
-
* @since 2.0.0
|
|
2154
2188
|
* @category elements
|
|
2189
|
+
* @since 2.0.0
|
|
2155
2190
|
*/
|
|
2156
2191
|
(n: number): <A>(self: Chunk<A>) => Chunk<Chunk<A>>
|
|
2157
2192
|
/**
|
|
2158
2193
|
* Groups elements in chunks of up to `n` elements.
|
|
2159
2194
|
*
|
|
2160
|
-
*
|
|
2195
|
+
* **Example** (Splitting into fixed-size chunks)
|
|
2196
|
+
*
|
|
2161
2197
|
* ```ts
|
|
2162
2198
|
* import { Chunk } from "effect"
|
|
2163
2199
|
*
|
|
@@ -2174,8 +2210,8 @@ export const chunksOf: {
|
|
|
2174
2210
|
* // [[1, 2], [3, 4], [5]]
|
|
2175
2211
|
* ```
|
|
2176
2212
|
*
|
|
2177
|
-
* @since 2.0.0
|
|
2178
2213
|
* @category elements
|
|
2214
|
+
* @since 2.0.0
|
|
2179
2215
|
*/
|
|
2180
2216
|
<A>(self: Chunk<A>, n: number): Chunk<Chunk<A>>
|
|
2181
2217
|
} = dual(2, <A>(self: Chunk<A>, n: number) => {
|
|
@@ -2199,7 +2235,8 @@ export const chunksOf: {
|
|
|
2199
2235
|
*
|
|
2200
2236
|
* The order and references of result values are determined by the Chunk.
|
|
2201
2237
|
*
|
|
2202
|
-
*
|
|
2238
|
+
* **Example** (Intersecting chunks)
|
|
2239
|
+
*
|
|
2203
2240
|
* ```ts
|
|
2204
2241
|
* import { Chunk } from "effect"
|
|
2205
2242
|
*
|
|
@@ -2219,8 +2256,8 @@ export const chunksOf: {
|
|
|
2219
2256
|
* console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
|
|
2220
2257
|
* ```
|
|
2221
2258
|
*
|
|
2222
|
-
* @since 2.0.0
|
|
2223
2259
|
* @category elements
|
|
2260
|
+
* @since 2.0.0
|
|
2224
2261
|
*/
|
|
2225
2262
|
export const intersection: {
|
|
2226
2263
|
/**
|
|
@@ -2228,7 +2265,8 @@ export const intersection: {
|
|
|
2228
2265
|
*
|
|
2229
2266
|
* The order and references of result values are determined by the Chunk.
|
|
2230
2267
|
*
|
|
2231
|
-
*
|
|
2268
|
+
* **Example** (Intersecting chunks)
|
|
2269
|
+
*
|
|
2232
2270
|
* ```ts
|
|
2233
2271
|
* import { Chunk } from "effect"
|
|
2234
2272
|
*
|
|
@@ -2248,8 +2286,8 @@ export const intersection: {
|
|
|
2248
2286
|
* console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
|
|
2249
2287
|
* ```
|
|
2250
2288
|
*
|
|
2251
|
-
* @since 2.0.0
|
|
2252
2289
|
* @category elements
|
|
2290
|
+
* @since 2.0.0
|
|
2253
2291
|
*/
|
|
2254
2292
|
<A>(that: Chunk<A>): <B>(self: Chunk<B>) => Chunk<A & B>
|
|
2255
2293
|
/**
|
|
@@ -2257,7 +2295,8 @@ export const intersection: {
|
|
|
2257
2295
|
*
|
|
2258
2296
|
* The order and references of result values are determined by the Chunk.
|
|
2259
2297
|
*
|
|
2260
|
-
*
|
|
2298
|
+
* **Example** (Intersecting chunks)
|
|
2299
|
+
*
|
|
2261
2300
|
* ```ts
|
|
2262
2301
|
* import { Chunk } from "effect"
|
|
2263
2302
|
*
|
|
@@ -2277,8 +2316,8 @@ export const intersection: {
|
|
|
2277
2316
|
* console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
|
|
2278
2317
|
* ```
|
|
2279
2318
|
*
|
|
2280
|
-
* @since 2.0.0
|
|
2281
2319
|
* @category elements
|
|
2320
|
+
* @since 2.0.0
|
|
2282
2321
|
*/
|
|
2283
2322
|
<A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<A & B>
|
|
2284
2323
|
} = dual(
|
|
@@ -2290,7 +2329,8 @@ export const intersection: {
|
|
|
2290
2329
|
/**
|
|
2291
2330
|
* Determines if the chunk is empty.
|
|
2292
2331
|
*
|
|
2293
|
-
*
|
|
2332
|
+
* **Example** (Checking for empty chunks)
|
|
2333
|
+
*
|
|
2294
2334
|
* ```ts
|
|
2295
2335
|
* import { Chunk } from "effect"
|
|
2296
2336
|
*
|
|
@@ -2306,7 +2346,8 @@ export const isEmpty = <A>(self: Chunk<A>): boolean => self.length === 0
|
|
|
2306
2346
|
/**
|
|
2307
2347
|
* Determines if the chunk is not empty.
|
|
2308
2348
|
*
|
|
2309
|
-
*
|
|
2349
|
+
* **Example** (Checking for non-empty chunks)
|
|
2350
|
+
*
|
|
2310
2351
|
* ```ts
|
|
2311
2352
|
* import { Chunk } from "effect"
|
|
2312
2353
|
*
|
|
@@ -2322,7 +2363,8 @@ export const isNonEmpty = <A>(self: Chunk<A>): self is NonEmptyChunk<A> => self.
|
|
|
2322
2363
|
/**
|
|
2323
2364
|
* Returns the first element of this chunk if it exists.
|
|
2324
2365
|
*
|
|
2325
|
-
*
|
|
2366
|
+
* **Example** (Getting the first element)
|
|
2367
|
+
*
|
|
2326
2368
|
* ```ts
|
|
2327
2369
|
* import { Chunk } from "effect"
|
|
2328
2370
|
*
|
|
@@ -2340,9 +2382,10 @@ export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
|
|
|
2340
2382
|
*
|
|
2341
2383
|
* It will throw an error if the chunk is empty.
|
|
2342
2384
|
*
|
|
2343
|
-
*
|
|
2385
|
+
* **Example** (Getting the first element unsafely)
|
|
2386
|
+
*
|
|
2344
2387
|
* ```ts
|
|
2345
|
-
* import { Chunk } from "effect"
|
|
2388
|
+
* import { Chunk, Option } from "effect"
|
|
2346
2389
|
*
|
|
2347
2390
|
* const chunk = Chunk.make(1, 2, 3, 4)
|
|
2348
2391
|
* console.log(Chunk.headUnsafe(chunk)) // 1
|
|
@@ -2350,23 +2393,20 @@ export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
|
|
|
2350
2393
|
* const singleElement = Chunk.make("hello")
|
|
2351
2394
|
* console.log(Chunk.headUnsafe(singleElement)) // "hello"
|
|
2352
2395
|
*
|
|
2353
|
-
* //
|
|
2354
|
-
*
|
|
2355
|
-
* Chunk.headUnsafe(Chunk.empty())
|
|
2356
|
-
* } catch (error) {
|
|
2357
|
-
* console.log((error as Error).message) // "Index out of bounds"
|
|
2358
|
-
* }
|
|
2396
|
+
* // Use Chunk.head when the chunk may be empty
|
|
2397
|
+
* console.log(Option.isNone(Chunk.head(Chunk.empty()))) // true
|
|
2359
2398
|
* ```
|
|
2360
2399
|
*
|
|
2361
|
-
* @since 2.0.0
|
|
2362
2400
|
* @category unsafe
|
|
2401
|
+
* @since 2.0.0
|
|
2363
2402
|
*/
|
|
2364
2403
|
export const headUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, 0)
|
|
2365
2404
|
|
|
2366
2405
|
/**
|
|
2367
2406
|
* Returns the first element of this non empty chunk.
|
|
2368
2407
|
*
|
|
2369
|
-
*
|
|
2408
|
+
* **Example** (Getting the first element of a non-empty chunk)
|
|
2409
|
+
*
|
|
2370
2410
|
* ```ts
|
|
2371
2411
|
* import { Chunk } from "effect"
|
|
2372
2412
|
*
|
|
@@ -2380,15 +2420,16 @@ export const headUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, 0)
|
|
|
2380
2420
|
* // Chunk.headNonEmpty(Chunk.empty()) // TypeScript error
|
|
2381
2421
|
* ```
|
|
2382
2422
|
*
|
|
2383
|
-
* @since 2.0.0
|
|
2384
2423
|
* @category elements
|
|
2424
|
+
* @since 2.0.0
|
|
2385
2425
|
*/
|
|
2386
2426
|
export const headNonEmpty: <A>(self: NonEmptyChunk<A>) => A = headUnsafe
|
|
2387
2427
|
|
|
2388
2428
|
/**
|
|
2389
2429
|
* Returns the last element of this chunk if it exists.
|
|
2390
2430
|
*
|
|
2391
|
-
*
|
|
2431
|
+
* **Example** (Getting the last element)
|
|
2432
|
+
*
|
|
2392
2433
|
* ```ts
|
|
2393
2434
|
* import { Chunk } from "effect"
|
|
2394
2435
|
*
|
|
@@ -2406,9 +2447,10 @@ export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
|
|
|
2406
2447
|
*
|
|
2407
2448
|
* It will throw an error if the chunk is empty.
|
|
2408
2449
|
*
|
|
2409
|
-
*
|
|
2450
|
+
* **Example** (Getting the last element unsafely)
|
|
2451
|
+
*
|
|
2410
2452
|
* ```ts
|
|
2411
|
-
* import { Chunk } from "effect"
|
|
2453
|
+
* import { Chunk, Option } from "effect"
|
|
2412
2454
|
*
|
|
2413
2455
|
* const chunk = Chunk.make(1, 2, 3, 4)
|
|
2414
2456
|
* console.log(Chunk.lastUnsafe(chunk)) // 4
|
|
@@ -2416,23 +2458,20 @@ export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
|
|
|
2416
2458
|
* const singleElement = Chunk.make("hello")
|
|
2417
2459
|
* console.log(Chunk.lastUnsafe(singleElement)) // "hello"
|
|
2418
2460
|
*
|
|
2419
|
-
* //
|
|
2420
|
-
*
|
|
2421
|
-
* Chunk.lastUnsafe(Chunk.empty())
|
|
2422
|
-
* } catch (error) {
|
|
2423
|
-
* console.log((error as Error).message) // "Index out of bounds"
|
|
2424
|
-
* }
|
|
2461
|
+
* // Use Chunk.last when the chunk may be empty
|
|
2462
|
+
* console.log(Option.isNone(Chunk.last(Chunk.empty()))) // true
|
|
2425
2463
|
* ```
|
|
2426
2464
|
*
|
|
2427
|
-
* @since 2.0.0
|
|
2428
2465
|
* @category unsafe
|
|
2466
|
+
* @since 2.0.0
|
|
2429
2467
|
*/
|
|
2430
2468
|
export const lastUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, self.length - 1)
|
|
2431
2469
|
|
|
2432
2470
|
/**
|
|
2433
2471
|
* Returns the last element of this non empty chunk.
|
|
2434
2472
|
*
|
|
2435
|
-
*
|
|
2473
|
+
* **Example** (Getting the last element of a non-empty chunk)
|
|
2474
|
+
*
|
|
2436
2475
|
* ```ts
|
|
2437
2476
|
* import { Chunk } from "effect"
|
|
2438
2477
|
*
|
|
@@ -2446,15 +2485,16 @@ export const lastUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, self.length
|
|
|
2446
2485
|
* // Chunk.lastNonEmpty(Chunk.empty()) // TypeScript error
|
|
2447
2486
|
* ```
|
|
2448
2487
|
*
|
|
2449
|
-
* @since 3.4.0
|
|
2450
2488
|
* @category elements
|
|
2489
|
+
* @since 3.4.0
|
|
2451
2490
|
*/
|
|
2452
2491
|
export const lastNonEmpty: <A>(self: NonEmptyChunk<A>) => A = lastUnsafe
|
|
2453
2492
|
|
|
2454
2493
|
/**
|
|
2455
2494
|
* A namespace containing utility types for Chunk operations.
|
|
2456
2495
|
*
|
|
2457
|
-
*
|
|
2496
|
+
* **Example** (Working with Chunk utility types)
|
|
2497
|
+
*
|
|
2458
2498
|
* ```ts
|
|
2459
2499
|
* import type { Chunk } from "effect"
|
|
2460
2500
|
*
|
|
@@ -2474,7 +2514,8 @@ export declare namespace Chunk {
|
|
|
2474
2514
|
/**
|
|
2475
2515
|
* Infers the element type of a Chunk.
|
|
2476
2516
|
*
|
|
2477
|
-
*
|
|
2517
|
+
* **Example** (Inferring element types)
|
|
2518
|
+
*
|
|
2478
2519
|
* ```ts
|
|
2479
2520
|
* import type { Chunk } from "effect"
|
|
2480
2521
|
*
|
|
@@ -2493,7 +2534,8 @@ export declare namespace Chunk {
|
|
|
2493
2534
|
/**
|
|
2494
2535
|
* Constructs a Chunk type preserving non-emptiness.
|
|
2495
2536
|
*
|
|
2496
|
-
*
|
|
2537
|
+
* **Example** (Preserving non-emptiness)
|
|
2538
|
+
*
|
|
2497
2539
|
* ```ts
|
|
2498
2540
|
* import type { Chunk } from "effect"
|
|
2499
2541
|
*
|
|
@@ -2512,7 +2554,8 @@ export declare namespace Chunk {
|
|
|
2512
2554
|
/**
|
|
2513
2555
|
* Creates a non-empty Chunk if either input is non-empty.
|
|
2514
2556
|
*
|
|
2515
|
-
*
|
|
2557
|
+
* **Example** (Preserving non-emptiness from either input)
|
|
2558
|
+
*
|
|
2516
2559
|
* ```ts
|
|
2517
2560
|
* import type { Chunk } from "effect"
|
|
2518
2561
|
*
|
|
@@ -2547,7 +2590,8 @@ export declare namespace Chunk {
|
|
|
2547
2590
|
/**
|
|
2548
2591
|
* Creates a non-empty Chunk only if both inputs are non-empty.
|
|
2549
2592
|
*
|
|
2550
|
-
*
|
|
2593
|
+
* **Example** (Requiring non-emptiness from both inputs)
|
|
2594
|
+
*
|
|
2551
2595
|
* ```ts
|
|
2552
2596
|
* import type { Chunk } from "effect"
|
|
2553
2597
|
*
|
|
@@ -2582,7 +2626,8 @@ export declare namespace Chunk {
|
|
|
2582
2626
|
/**
|
|
2583
2627
|
* Flattens a nested Chunk type.
|
|
2584
2628
|
*
|
|
2585
|
-
*
|
|
2629
|
+
* **Example** (Flattening nested chunk types)
|
|
2630
|
+
*
|
|
2586
2631
|
* ```ts
|
|
2587
2632
|
* import type { Chunk } from "effect"
|
|
2588
2633
|
*
|
|
@@ -2605,76 +2650,72 @@ export declare namespace Chunk {
|
|
|
2605
2650
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
2606
2651
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
2607
2652
|
*
|
|
2608
|
-
*
|
|
2653
|
+
* **Example** (Mapping values)
|
|
2609
2654
|
*
|
|
2610
2655
|
* ```ts
|
|
2611
2656
|
* import { Chunk } from "effect"
|
|
2612
2657
|
*
|
|
2613
2658
|
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
2614
2659
|
*
|
|
2615
|
-
* console.log(result)
|
|
2616
|
-
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
2660
|
+
* console.log(Chunk.toArray(result)) // [2, 3]
|
|
2617
2661
|
* ```
|
|
2618
2662
|
*
|
|
2619
|
-
* @since 2.0.0
|
|
2620
2663
|
* @category mapping
|
|
2664
|
+
* @since 2.0.0
|
|
2621
2665
|
*/
|
|
2622
2666
|
export const map: {
|
|
2623
2667
|
/**
|
|
2624
2668
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
2625
2669
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
2626
2670
|
*
|
|
2627
|
-
*
|
|
2671
|
+
* **Example** (Mapping values)
|
|
2628
2672
|
*
|
|
2629
2673
|
* ```ts
|
|
2630
2674
|
* import { Chunk } from "effect"
|
|
2631
2675
|
*
|
|
2632
2676
|
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
2633
2677
|
*
|
|
2634
|
-
* console.log(result)
|
|
2635
|
-
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
2678
|
+
* console.log(Chunk.toArray(result)) // [2, 3]
|
|
2636
2679
|
* ```
|
|
2637
2680
|
*
|
|
2638
|
-
* @since 2.0.0
|
|
2639
2681
|
* @category mapping
|
|
2682
|
+
* @since 2.0.0
|
|
2640
2683
|
*/
|
|
2641
2684
|
<S extends Chunk<any>, B>(f: (a: Chunk.Infer<S>, i: number) => B): (self: S) => Chunk.With<S, B>
|
|
2642
2685
|
/**
|
|
2643
2686
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
2644
2687
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
2645
2688
|
*
|
|
2646
|
-
*
|
|
2689
|
+
* **Example** (Mapping values)
|
|
2647
2690
|
*
|
|
2648
2691
|
* ```ts
|
|
2649
2692
|
* import { Chunk } from "effect"
|
|
2650
2693
|
*
|
|
2651
2694
|
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
2652
2695
|
*
|
|
2653
|
-
* console.log(result)
|
|
2654
|
-
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
2696
|
+
* console.log(Chunk.toArray(result)) // [2, 3]
|
|
2655
2697
|
* ```
|
|
2656
2698
|
*
|
|
2657
|
-
* @since 2.0.0
|
|
2658
2699
|
* @category mapping
|
|
2700
|
+
* @since 2.0.0
|
|
2659
2701
|
*/
|
|
2660
2702
|
<A, B>(self: NonEmptyChunk<A>, f: (a: A, i: number) => B): NonEmptyChunk<B>
|
|
2661
2703
|
/**
|
|
2662
2704
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
2663
2705
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
2664
2706
|
*
|
|
2665
|
-
*
|
|
2707
|
+
* **Example** (Mapping values)
|
|
2666
2708
|
*
|
|
2667
2709
|
* ```ts
|
|
2668
2710
|
* import { Chunk } from "effect"
|
|
2669
2711
|
*
|
|
2670
2712
|
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
2671
2713
|
*
|
|
2672
|
-
* console.log(result)
|
|
2673
|
-
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
2714
|
+
* console.log(Chunk.toArray(result)) // [2, 3]
|
|
2674
2715
|
* ```
|
|
2675
2716
|
*
|
|
2676
|
-
* @since 2.0.0
|
|
2677
2717
|
* @category mapping
|
|
2718
|
+
* @since 2.0.0
|
|
2678
2719
|
*/
|
|
2679
2720
|
<A, B>(self: Chunk<A>, f: (a: A, i: number) => B): Chunk<B>
|
|
2680
2721
|
} = dual(2, <A, B>(self: Chunk<A>, f: (a: A, i: number) => B): Chunk<B> =>
|
|
@@ -2685,7 +2726,8 @@ export const map: {
|
|
|
2685
2726
|
/**
|
|
2686
2727
|
* Statefully maps over the chunk, producing new elements of type `B`.
|
|
2687
2728
|
*
|
|
2688
|
-
*
|
|
2729
|
+
* **Example** (Mapping with accumulated state)
|
|
2730
|
+
*
|
|
2689
2731
|
* ```ts
|
|
2690
2732
|
* import { Chunk } from "effect"
|
|
2691
2733
|
*
|
|
@@ -2708,14 +2750,15 @@ export const map: {
|
|
|
2708
2750
|
* console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
|
|
2709
2751
|
* ```
|
|
2710
2752
|
*
|
|
2711
|
-
* @since 2.0.0
|
|
2712
2753
|
* @category folding
|
|
2754
|
+
* @since 2.0.0
|
|
2713
2755
|
*/
|
|
2714
2756
|
export const mapAccum: {
|
|
2715
2757
|
/**
|
|
2716
2758
|
* Statefully maps over the chunk, producing new elements of type `B`.
|
|
2717
2759
|
*
|
|
2718
|
-
*
|
|
2760
|
+
* **Example** (Mapping with accumulated state)
|
|
2761
|
+
*
|
|
2719
2762
|
* ```ts
|
|
2720
2763
|
* import { Chunk } from "effect"
|
|
2721
2764
|
*
|
|
@@ -2738,14 +2781,15 @@ export const mapAccum: {
|
|
|
2738
2781
|
* console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
|
|
2739
2782
|
* ```
|
|
2740
2783
|
*
|
|
2741
|
-
* @since 2.0.0
|
|
2742
2784
|
* @category folding
|
|
2785
|
+
* @since 2.0.0
|
|
2743
2786
|
*/
|
|
2744
2787
|
<S, A, B>(s: S, f: (s: S, a: A) => readonly [S, B]): (self: Chunk<A>) => [S, Chunk<B>]
|
|
2745
2788
|
/**
|
|
2746
2789
|
* Statefully maps over the chunk, producing new elements of type `B`.
|
|
2747
2790
|
*
|
|
2748
|
-
*
|
|
2791
|
+
* **Example** (Mapping with accumulated state)
|
|
2792
|
+
*
|
|
2749
2793
|
* ```ts
|
|
2750
2794
|
* import { Chunk } from "effect"
|
|
2751
2795
|
*
|
|
@@ -2768,8 +2812,8 @@ export const mapAccum: {
|
|
|
2768
2812
|
* console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
|
|
2769
2813
|
* ```
|
|
2770
2814
|
*
|
|
2771
|
-
* @since 2.0.0
|
|
2772
2815
|
* @category folding
|
|
2816
|
+
* @since 2.0.0
|
|
2773
2817
|
*/
|
|
2774
2818
|
<S, A, B>(self: Chunk<A>, s: S, f: (s: S, a: A) => readonly [S, B]): [S, Chunk<B>]
|
|
2775
2819
|
} = dual(3, <S, A, B>(self: Chunk<A>, s: S, f: (s: S, a: A) => readonly [S, B]): [S, Chunk<B>] => {
|
|
@@ -2783,7 +2827,8 @@ export const mapAccum: {
|
|
|
2783
2827
|
* - Returns `[excluded, satisfying]`.
|
|
2784
2828
|
* - The filter receives `(element, index)`.
|
|
2785
2829
|
*
|
|
2786
|
-
*
|
|
2830
|
+
* **Example** (Partitioning with a Result)
|
|
2831
|
+
*
|
|
2787
2832
|
* ```ts
|
|
2788
2833
|
* import { Chunk, Result } from "effect"
|
|
2789
2834
|
*
|
|
@@ -2805,7 +2850,8 @@ export const partition: {
|
|
|
2805
2850
|
* - Returns `[excluded, satisfying]`.
|
|
2806
2851
|
* - The filter receives `(element, index)`.
|
|
2807
2852
|
*
|
|
2808
|
-
*
|
|
2853
|
+
* **Example** (Partitioning with a Result)
|
|
2854
|
+
*
|
|
2809
2855
|
* ```ts
|
|
2810
2856
|
* import { Chunk, Result } from "effect"
|
|
2811
2857
|
*
|
|
@@ -2827,7 +2873,8 @@ export const partition: {
|
|
|
2827
2873
|
* - Returns `[excluded, satisfying]`.
|
|
2828
2874
|
* - The filter receives `(element, index)`.
|
|
2829
2875
|
*
|
|
2830
|
-
*
|
|
2876
|
+
* **Example** (Partitioning with a Result)
|
|
2877
|
+
*
|
|
2831
2878
|
* ```ts
|
|
2832
2879
|
* import { Chunk, Result } from "effect"
|
|
2833
2880
|
*
|
|
@@ -2855,9 +2902,14 @@ export const partition: {
|
|
|
2855
2902
|
)
|
|
2856
2903
|
|
|
2857
2904
|
/**
|
|
2858
|
-
*
|
|
2905
|
+
* Separates a chunk of `Result` values into a chunk of failures and a chunk of
|
|
2906
|
+
* successes.
|
|
2907
|
+
*
|
|
2908
|
+
* The returned tuple is `[failures, successes]`, preserving the original order
|
|
2909
|
+
* within each side.
|
|
2910
|
+
*
|
|
2911
|
+
* **Example** (Separating failures and successes)
|
|
2859
2912
|
*
|
|
2860
|
-
* @example
|
|
2861
2913
|
* ```ts
|
|
2862
2914
|
* import { Chunk } from "effect"
|
|
2863
2915
|
* import * as Result from "effect/Result"
|
|
@@ -2893,7 +2945,8 @@ export const separate = <A, B>(self: Chunk<Result<B, A>>): [Chunk<A>, Chunk<B>]
|
|
|
2893
2945
|
/**
|
|
2894
2946
|
* Retrieves the size of the chunk.
|
|
2895
2947
|
*
|
|
2896
|
-
*
|
|
2948
|
+
* **Example** (Getting chunk size)
|
|
2949
|
+
*
|
|
2897
2950
|
* ```ts
|
|
2898
2951
|
* import { Chunk } from "effect"
|
|
2899
2952
|
*
|
|
@@ -2909,7 +2962,8 @@ export const size = <A>(self: Chunk<A>): number => self.length
|
|
|
2909
2962
|
/**
|
|
2910
2963
|
* Sort the elements of a Chunk in increasing order, creating a new Chunk.
|
|
2911
2964
|
*
|
|
2912
|
-
*
|
|
2965
|
+
* **Example** (Sorting chunks)
|
|
2966
|
+
*
|
|
2913
2967
|
* ```ts
|
|
2914
2968
|
* import { Chunk } from "effect"
|
|
2915
2969
|
* import * as Order from "effect/Order"
|
|
@@ -2928,14 +2982,15 @@ export const size = <A>(self: Chunk<A>): number => self.length
|
|
|
2928
2982
|
* console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
|
|
2929
2983
|
* ```
|
|
2930
2984
|
*
|
|
2931
|
-
* @since 2.0.0
|
|
2932
2985
|
* @category sorting
|
|
2986
|
+
* @since 2.0.0
|
|
2933
2987
|
*/
|
|
2934
2988
|
export const sort: {
|
|
2935
2989
|
/**
|
|
2936
2990
|
* Sort the elements of a Chunk in increasing order, creating a new Chunk.
|
|
2937
2991
|
*
|
|
2938
|
-
*
|
|
2992
|
+
* **Example** (Sorting chunks)
|
|
2993
|
+
*
|
|
2939
2994
|
* ```ts
|
|
2940
2995
|
* import { Chunk } from "effect"
|
|
2941
2996
|
* import * as Order from "effect/Order"
|
|
@@ -2954,14 +3009,15 @@ export const sort: {
|
|
|
2954
3009
|
* console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
|
|
2955
3010
|
* ```
|
|
2956
3011
|
*
|
|
2957
|
-
* @since 2.0.0
|
|
2958
3012
|
* @category sorting
|
|
3013
|
+
* @since 2.0.0
|
|
2959
3014
|
*/
|
|
2960
3015
|
<B>(O: Order.Order<B>): <A extends B>(self: Chunk<A>) => Chunk<A>
|
|
2961
3016
|
/**
|
|
2962
3017
|
* Sort the elements of a Chunk in increasing order, creating a new Chunk.
|
|
2963
3018
|
*
|
|
2964
|
-
*
|
|
3019
|
+
* **Example** (Sorting chunks)
|
|
3020
|
+
*
|
|
2965
3021
|
* ```ts
|
|
2966
3022
|
* import { Chunk } from "effect"
|
|
2967
3023
|
* import * as Order from "effect/Order"
|
|
@@ -2980,8 +3036,8 @@ export const sort: {
|
|
|
2980
3036
|
* console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
|
|
2981
3037
|
* ```
|
|
2982
3038
|
*
|
|
2983
|
-
* @since 2.0.0
|
|
2984
3039
|
* @category sorting
|
|
3040
|
+
* @since 2.0.0
|
|
2985
3041
|
*/
|
|
2986
3042
|
<A extends B, B>(self: Chunk<A>, O: Order.Order<B>): Chunk<A>
|
|
2987
3043
|
} = dual(
|
|
@@ -2992,7 +3048,8 @@ export const sort: {
|
|
|
2992
3048
|
/**
|
|
2993
3049
|
* Sorts the elements of a Chunk based on a projection function.
|
|
2994
3050
|
*
|
|
2995
|
-
*
|
|
3051
|
+
* **Example** (Sorting chunks by a derived value)
|
|
3052
|
+
*
|
|
2996
3053
|
* ```ts
|
|
2997
3054
|
* import { Chunk } from "effect"
|
|
2998
3055
|
* import * as Order from "effect/Order"
|
|
@@ -3019,14 +3076,15 @@ export const sort: {
|
|
|
3019
3076
|
* console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
|
|
3020
3077
|
* ```
|
|
3021
3078
|
*
|
|
3022
|
-
* @since 2.0.0
|
|
3023
3079
|
* @category sorting
|
|
3080
|
+
* @since 2.0.0
|
|
3024
3081
|
*/
|
|
3025
3082
|
export const sortWith: {
|
|
3026
3083
|
/**
|
|
3027
3084
|
* Sorts the elements of a Chunk based on a projection function.
|
|
3028
3085
|
*
|
|
3029
|
-
*
|
|
3086
|
+
* **Example** (Sorting chunks by a derived value)
|
|
3087
|
+
*
|
|
3030
3088
|
* ```ts
|
|
3031
3089
|
* import { Chunk } from "effect"
|
|
3032
3090
|
* import * as Order from "effect/Order"
|
|
@@ -3053,14 +3111,15 @@ export const sortWith: {
|
|
|
3053
3111
|
* console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
|
|
3054
3112
|
* ```
|
|
3055
3113
|
*
|
|
3056
|
-
* @since 2.0.0
|
|
3057
3114
|
* @category sorting
|
|
3115
|
+
* @since 2.0.0
|
|
3058
3116
|
*/
|
|
3059
3117
|
<A, B>(f: (a: A) => B, order: Order.Order<B>): (self: Chunk<A>) => Chunk<A>
|
|
3060
3118
|
/**
|
|
3061
3119
|
* Sorts the elements of a Chunk based on a projection function.
|
|
3062
3120
|
*
|
|
3063
|
-
*
|
|
3121
|
+
* **Example** (Sorting chunks by a derived value)
|
|
3122
|
+
*
|
|
3064
3123
|
* ```ts
|
|
3065
3124
|
* import { Chunk } from "effect"
|
|
3066
3125
|
* import * as Order from "effect/Order"
|
|
@@ -3087,8 +3146,8 @@ export const sortWith: {
|
|
|
3087
3146
|
* console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
|
|
3088
3147
|
* ```
|
|
3089
3148
|
*
|
|
3090
|
-
* @since 2.0.0
|
|
3091
3149
|
* @category sorting
|
|
3150
|
+
* @since 2.0.0
|
|
3092
3151
|
*/
|
|
3093
3152
|
<A, B>(self: Chunk<A>, f: (a: A) => B, order: Order.Order<B>): Chunk<A>
|
|
3094
3153
|
} = dual(
|
|
@@ -3099,7 +3158,8 @@ export const sortWith: {
|
|
|
3099
3158
|
/**
|
|
3100
3159
|
* Returns two splits of this chunk at the specified index.
|
|
3101
3160
|
*
|
|
3102
|
-
*
|
|
3161
|
+
* **Example** (Splitting at an index)
|
|
3162
|
+
*
|
|
3103
3163
|
* ```ts
|
|
3104
3164
|
* import { Chunk } from "effect"
|
|
3105
3165
|
*
|
|
@@ -3119,14 +3179,15 @@ export const sortWith: {
|
|
|
3119
3179
|
* console.log(Chunk.toArray(empty2)) // []
|
|
3120
3180
|
* ```
|
|
3121
3181
|
*
|
|
3122
|
-
* @since 2.0.0
|
|
3123
3182
|
* @category splitting
|
|
3183
|
+
* @since 2.0.0
|
|
3124
3184
|
*/
|
|
3125
3185
|
export const splitAt: {
|
|
3126
3186
|
/**
|
|
3127
3187
|
* Returns two splits of this chunk at the specified index.
|
|
3128
3188
|
*
|
|
3129
|
-
*
|
|
3189
|
+
* **Example** (Splitting at an index)
|
|
3190
|
+
*
|
|
3130
3191
|
* ```ts
|
|
3131
3192
|
* import { Chunk } from "effect"
|
|
3132
3193
|
*
|
|
@@ -3146,14 +3207,15 @@ export const splitAt: {
|
|
|
3146
3207
|
* console.log(Chunk.toArray(empty2)) // []
|
|
3147
3208
|
* ```
|
|
3148
3209
|
*
|
|
3149
|
-
* @since 2.0.0
|
|
3150
3210
|
* @category splitting
|
|
3211
|
+
* @since 2.0.0
|
|
3151
3212
|
*/
|
|
3152
3213
|
(n: number): <A>(self: Chunk<A>) => [beforeIndex: Chunk<A>, fromIndex: Chunk<A>]
|
|
3153
3214
|
/**
|
|
3154
3215
|
* Returns two splits of this chunk at the specified index.
|
|
3155
3216
|
*
|
|
3156
|
-
*
|
|
3217
|
+
* **Example** (Splitting at an index)
|
|
3218
|
+
*
|
|
3157
3219
|
* ```ts
|
|
3158
3220
|
* import { Chunk } from "effect"
|
|
3159
3221
|
*
|
|
@@ -3173,17 +3235,22 @@ export const splitAt: {
|
|
|
3173
3235
|
* console.log(Chunk.toArray(empty2)) // []
|
|
3174
3236
|
* ```
|
|
3175
3237
|
*
|
|
3176
|
-
* @since 2.0.0
|
|
3177
3238
|
* @category splitting
|
|
3239
|
+
* @since 2.0.0
|
|
3178
3240
|
*/
|
|
3179
3241
|
<A>(self: Chunk<A>, n: number): [beforeIndex: Chunk<A>, fromIndex: Chunk<A>]
|
|
3180
3242
|
} = dual(2, <A>(self: Chunk<A>, n: number): [Chunk<A>, Chunk<A>] => [take(self, n), drop(self, n)])
|
|
3181
3243
|
|
|
3182
3244
|
/**
|
|
3183
|
-
* Splits a `NonEmptyChunk`
|
|
3184
|
-
*
|
|
3245
|
+
* Splits a `NonEmptyChunk` at `n`, returning a non-empty prefix and the
|
|
3246
|
+
* remaining suffix.
|
|
3247
|
+
*
|
|
3248
|
+
* `n` is floored and normalized to at least `1`. If `n` is greater than or
|
|
3249
|
+
* equal to the chunk length, the first result is the original chunk and the
|
|
3250
|
+
* second result is empty.
|
|
3251
|
+
*
|
|
3252
|
+
* **Example** (Splitting non-empty chunks at an index)
|
|
3185
3253
|
*
|
|
3186
|
-
* @example
|
|
3187
3254
|
* ```ts
|
|
3188
3255
|
* import { Chunk } from "effect"
|
|
3189
3256
|
*
|
|
@@ -3206,10 +3273,15 @@ export const splitAt: {
|
|
|
3206
3273
|
*/
|
|
3207
3274
|
export const splitNonEmptyAt: {
|
|
3208
3275
|
/**
|
|
3209
|
-
* Splits a `NonEmptyChunk`
|
|
3210
|
-
*
|
|
3276
|
+
* Splits a `NonEmptyChunk` at `n`, returning a non-empty prefix and the
|
|
3277
|
+
* remaining suffix.
|
|
3278
|
+
*
|
|
3279
|
+
* `n` is floored and normalized to at least `1`. If `n` is greater than or
|
|
3280
|
+
* equal to the chunk length, the first result is the original chunk and the
|
|
3281
|
+
* second result is empty.
|
|
3282
|
+
*
|
|
3283
|
+
* **Example** (Splitting non-empty chunks at an index)
|
|
3211
3284
|
*
|
|
3212
|
-
* @example
|
|
3213
3285
|
* ```ts
|
|
3214
3286
|
* import { Chunk } from "effect"
|
|
3215
3287
|
*
|
|
@@ -3232,10 +3304,15 @@ export const splitNonEmptyAt: {
|
|
|
3232
3304
|
*/
|
|
3233
3305
|
(n: number): <A>(self: NonEmptyChunk<A>) => [beforeIndex: NonEmptyChunk<A>, fromIndex: Chunk<A>]
|
|
3234
3306
|
/**
|
|
3235
|
-
* Splits a `NonEmptyChunk`
|
|
3236
|
-
*
|
|
3307
|
+
* Splits a `NonEmptyChunk` at `n`, returning a non-empty prefix and the
|
|
3308
|
+
* remaining suffix.
|
|
3309
|
+
*
|
|
3310
|
+
* `n` is floored and normalized to at least `1`. If `n` is greater than or
|
|
3311
|
+
* equal to the chunk length, the first result is the original chunk and the
|
|
3312
|
+
* second result is empty.
|
|
3313
|
+
*
|
|
3314
|
+
* **Example** (Splitting non-empty chunks at an index)
|
|
3237
3315
|
*
|
|
3238
|
-
* @example
|
|
3239
3316
|
* ```ts
|
|
3240
3317
|
* import { Chunk } from "effect"
|
|
3241
3318
|
*
|
|
@@ -3265,9 +3342,13 @@ export const splitNonEmptyAt: {
|
|
|
3265
3342
|
})
|
|
3266
3343
|
|
|
3267
3344
|
/**
|
|
3268
|
-
* Splits
|
|
3345
|
+
* Splits a chunk into up to `n` chunks, distributing elements in order.
|
|
3346
|
+
*
|
|
3347
|
+
* The chunk size is derived from the input length and `n`; the final chunk may
|
|
3348
|
+
* contain fewer elements than the others.
|
|
3349
|
+
*
|
|
3350
|
+
* **Example** (Splitting chunks into groups)
|
|
3269
3351
|
*
|
|
3270
|
-
* @example
|
|
3271
3352
|
* ```ts
|
|
3272
3353
|
* import { Chunk } from "effect"
|
|
3273
3354
|
*
|
|
@@ -3288,14 +3369,18 @@ export const splitNonEmptyAt: {
|
|
|
3288
3369
|
* // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
|
|
3289
3370
|
* ```
|
|
3290
3371
|
*
|
|
3291
|
-
* @since 2.0.0
|
|
3292
3372
|
* @category splitting
|
|
3373
|
+
* @since 2.0.0
|
|
3293
3374
|
*/
|
|
3294
3375
|
export const split: {
|
|
3295
3376
|
/**
|
|
3296
|
-
* Splits
|
|
3377
|
+
* Splits a chunk into up to `n` chunks, distributing elements in order.
|
|
3378
|
+
*
|
|
3379
|
+
* The chunk size is derived from the input length and `n`; the final chunk may
|
|
3380
|
+
* contain fewer elements than the others.
|
|
3381
|
+
*
|
|
3382
|
+
* **Example** (Splitting chunks into groups)
|
|
3297
3383
|
*
|
|
3298
|
-
* @example
|
|
3299
3384
|
* ```ts
|
|
3300
3385
|
* import { Chunk } from "effect"
|
|
3301
3386
|
*
|
|
@@ -3316,14 +3401,18 @@ export const split: {
|
|
|
3316
3401
|
* // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
|
|
3317
3402
|
* ```
|
|
3318
3403
|
*
|
|
3319
|
-
* @since 2.0.0
|
|
3320
3404
|
* @category splitting
|
|
3405
|
+
* @since 2.0.0
|
|
3321
3406
|
*/
|
|
3322
3407
|
(n: number): <A>(self: Chunk<A>) => Chunk<Chunk<A>>
|
|
3323
3408
|
/**
|
|
3324
|
-
* Splits
|
|
3409
|
+
* Splits a chunk into up to `n` chunks, distributing elements in order.
|
|
3410
|
+
*
|
|
3411
|
+
* The chunk size is derived from the input length and `n`; the final chunk may
|
|
3412
|
+
* contain fewer elements than the others.
|
|
3413
|
+
*
|
|
3414
|
+
* **Example** (Splitting chunks into groups)
|
|
3325
3415
|
*
|
|
3326
|
-
* @example
|
|
3327
3416
|
* ```ts
|
|
3328
3417
|
* import { Chunk } from "effect"
|
|
3329
3418
|
*
|
|
@@ -3344,8 +3433,8 @@ export const split: {
|
|
|
3344
3433
|
* // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
|
|
3345
3434
|
* ```
|
|
3346
3435
|
*
|
|
3347
|
-
* @since 2.0.0
|
|
3348
3436
|
* @category splitting
|
|
3437
|
+
* @since 2.0.0
|
|
3349
3438
|
*/
|
|
3350
3439
|
<A>(self: Chunk<A>, n: number): Chunk<Chunk<A>>
|
|
3351
3440
|
} = dual(2, <A>(self: Chunk<A>, n: number) => chunksOf(self, Math.ceil(self.length / Math.floor(n))))
|
|
@@ -3354,7 +3443,8 @@ export const split: {
|
|
|
3354
3443
|
* Splits this chunk on the first element that matches this predicate.
|
|
3355
3444
|
* Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.
|
|
3356
3445
|
*
|
|
3357
|
-
*
|
|
3446
|
+
* **Example** (Splitting at a matching element)
|
|
3447
|
+
*
|
|
3358
3448
|
* ```ts
|
|
3359
3449
|
* import { Chunk } from "effect"
|
|
3360
3450
|
*
|
|
@@ -3382,7 +3472,8 @@ export const splitWhere: {
|
|
|
3382
3472
|
* Splits this chunk on the first element that matches this predicate.
|
|
3383
3473
|
* Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.
|
|
3384
3474
|
*
|
|
3385
|
-
*
|
|
3475
|
+
* **Example** (Splitting at a matching element)
|
|
3476
|
+
*
|
|
3386
3477
|
* ```ts
|
|
3387
3478
|
* import { Chunk } from "effect"
|
|
3388
3479
|
*
|
|
@@ -3410,7 +3501,8 @@ export const splitWhere: {
|
|
|
3410
3501
|
* Splits this chunk on the first element that matches this predicate.
|
|
3411
3502
|
* Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.
|
|
3412
3503
|
*
|
|
3413
|
-
*
|
|
3504
|
+
* **Example** (Splitting at a matching element)
|
|
3505
|
+
*
|
|
3414
3506
|
* ```ts
|
|
3415
3507
|
* import { Chunk } from "effect"
|
|
3416
3508
|
*
|
|
@@ -3449,7 +3541,8 @@ export const splitWhere: {
|
|
|
3449
3541
|
/**
|
|
3450
3542
|
* Returns every elements after the first.
|
|
3451
3543
|
*
|
|
3452
|
-
*
|
|
3544
|
+
* **Example** (Getting the tail safely)
|
|
3545
|
+
*
|
|
3453
3546
|
* ```ts
|
|
3454
3547
|
* import { Chunk } from "effect"
|
|
3455
3548
|
*
|
|
@@ -3463,15 +3556,16 @@ export const splitWhere: {
|
|
|
3463
3556
|
* console.log(Chunk.tail(empty)) // Option.none()
|
|
3464
3557
|
* ```
|
|
3465
3558
|
*
|
|
3466
|
-
* @since 2.0.0
|
|
3467
3559
|
* @category elements
|
|
3560
|
+
* @since 2.0.0
|
|
3468
3561
|
*/
|
|
3469
3562
|
export const tail = <A>(self: Chunk<A>): O.Option<Chunk<A>> => self.length > 0 ? O.some(drop(self, 1)) : O.none()
|
|
3470
3563
|
|
|
3471
3564
|
/**
|
|
3472
3565
|
* Returns every elements after the first.
|
|
3473
3566
|
*
|
|
3474
|
-
*
|
|
3567
|
+
* **Example** (Getting the tail of a non-empty chunk)
|
|
3568
|
+
*
|
|
3475
3569
|
* ```ts
|
|
3476
3570
|
* import { Chunk } from "effect"
|
|
3477
3571
|
*
|
|
@@ -3487,15 +3581,16 @@ export const tail = <A>(self: Chunk<A>): O.Option<Chunk<A>> => self.length > 0 ?
|
|
|
3487
3581
|
* // Chunk.tailNonEmpty(Chunk.empty()) // TypeScript error
|
|
3488
3582
|
* ```
|
|
3489
3583
|
*
|
|
3490
|
-
* @since 2.0.0
|
|
3491
3584
|
* @category elements
|
|
3585
|
+
* @since 2.0.0
|
|
3492
3586
|
*/
|
|
3493
3587
|
export const tailNonEmpty = <A>(self: NonEmptyChunk<A>): Chunk<A> => drop(self, 1)
|
|
3494
3588
|
|
|
3495
3589
|
/**
|
|
3496
3590
|
* Takes the last `n` elements.
|
|
3497
3591
|
*
|
|
3498
|
-
*
|
|
3592
|
+
* **Example** (Taking elements from the end)
|
|
3593
|
+
*
|
|
3499
3594
|
* ```ts
|
|
3500
3595
|
* import { Chunk } from "effect"
|
|
3501
3596
|
*
|
|
@@ -3512,14 +3607,15 @@ export const tailNonEmpty = <A>(self: NonEmptyChunk<A>): Chunk<A> => drop(self,
|
|
|
3512
3607
|
* console.log(Chunk.toArray(none)) // []
|
|
3513
3608
|
* ```
|
|
3514
3609
|
*
|
|
3515
|
-
* @since 2.0.0
|
|
3516
3610
|
* @category elements
|
|
3611
|
+
* @since 2.0.0
|
|
3517
3612
|
*/
|
|
3518
3613
|
export const takeRight: {
|
|
3519
3614
|
/**
|
|
3520
3615
|
* Takes the last `n` elements.
|
|
3521
3616
|
*
|
|
3522
|
-
*
|
|
3617
|
+
* **Example** (Taking elements from the end)
|
|
3618
|
+
*
|
|
3523
3619
|
* ```ts
|
|
3524
3620
|
* import { Chunk } from "effect"
|
|
3525
3621
|
*
|
|
@@ -3536,14 +3632,15 @@ export const takeRight: {
|
|
|
3536
3632
|
* console.log(Chunk.toArray(none)) // []
|
|
3537
3633
|
* ```
|
|
3538
3634
|
*
|
|
3539
|
-
* @since 2.0.0
|
|
3540
3635
|
* @category elements
|
|
3636
|
+
* @since 2.0.0
|
|
3541
3637
|
*/
|
|
3542
3638
|
(n: number): <A>(self: Chunk<A>) => Chunk<A>
|
|
3543
3639
|
/**
|
|
3544
3640
|
* Takes the last `n` elements.
|
|
3545
3641
|
*
|
|
3546
|
-
*
|
|
3642
|
+
* **Example** (Taking elements from the end)
|
|
3643
|
+
*
|
|
3547
3644
|
* ```ts
|
|
3548
3645
|
* import { Chunk } from "effect"
|
|
3549
3646
|
*
|
|
@@ -3560,8 +3657,8 @@ export const takeRight: {
|
|
|
3560
3657
|
* console.log(Chunk.toArray(none)) // []
|
|
3561
3658
|
* ```
|
|
3562
3659
|
*
|
|
3563
|
-
* @since 2.0.0
|
|
3564
3660
|
* @category elements
|
|
3661
|
+
* @since 2.0.0
|
|
3565
3662
|
*/
|
|
3566
3663
|
<A>(self: Chunk<A>, n: number): Chunk<A>
|
|
3567
3664
|
} = dual(2, <A>(self: Chunk<A>, n: number): Chunk<A> => drop(self, self.length - n))
|
|
@@ -3569,7 +3666,8 @@ export const takeRight: {
|
|
|
3569
3666
|
/**
|
|
3570
3667
|
* Takes all elements so long as the predicate returns true.
|
|
3571
3668
|
*
|
|
3572
|
-
*
|
|
3669
|
+
* **Example** (Taking elements while a predicate matches)
|
|
3670
|
+
*
|
|
3573
3671
|
* ```ts
|
|
3574
3672
|
* import { Chunk } from "effect"
|
|
3575
3673
|
*
|
|
@@ -3587,14 +3685,15 @@ export const takeRight: {
|
|
|
3587
3685
|
* console.log(Chunk.toArray(all)) // [1, 2, 3]
|
|
3588
3686
|
* ```
|
|
3589
3687
|
*
|
|
3590
|
-
* @since 2.0.0
|
|
3591
3688
|
* @category elements
|
|
3689
|
+
* @since 2.0.0
|
|
3592
3690
|
*/
|
|
3593
3691
|
export const takeWhile: {
|
|
3594
3692
|
/**
|
|
3595
3693
|
* Takes all elements so long as the predicate returns true.
|
|
3596
3694
|
*
|
|
3597
|
-
*
|
|
3695
|
+
* **Example** (Taking elements while a predicate matches)
|
|
3696
|
+
*
|
|
3598
3697
|
* ```ts
|
|
3599
3698
|
* import { Chunk } from "effect"
|
|
3600
3699
|
*
|
|
@@ -3612,14 +3711,15 @@ export const takeWhile: {
|
|
|
3612
3711
|
* console.log(Chunk.toArray(all)) // [1, 2, 3]
|
|
3613
3712
|
* ```
|
|
3614
3713
|
*
|
|
3615
|
-
* @since 2.0.0
|
|
3616
3714
|
* @category elements
|
|
3715
|
+
* @since 2.0.0
|
|
3617
3716
|
*/
|
|
3618
3717
|
<A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Chunk<B>
|
|
3619
3718
|
/**
|
|
3620
3719
|
* Takes all elements so long as the predicate returns true.
|
|
3621
3720
|
*
|
|
3622
|
-
*
|
|
3721
|
+
* **Example** (Taking elements while a predicate matches)
|
|
3722
|
+
*
|
|
3623
3723
|
* ```ts
|
|
3624
3724
|
* import { Chunk } from "effect"
|
|
3625
3725
|
*
|
|
@@ -3637,14 +3737,15 @@ export const takeWhile: {
|
|
|
3637
3737
|
* console.log(Chunk.toArray(all)) // [1, 2, 3]
|
|
3638
3738
|
* ```
|
|
3639
3739
|
*
|
|
3640
|
-
* @since 2.0.0
|
|
3641
3740
|
* @category elements
|
|
3741
|
+
* @since 2.0.0
|
|
3642
3742
|
*/
|
|
3643
3743
|
<A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Chunk<A>
|
|
3644
3744
|
/**
|
|
3645
3745
|
* Takes all elements so long as the predicate returns true.
|
|
3646
3746
|
*
|
|
3647
|
-
*
|
|
3747
|
+
* **Example** (Taking elements while a predicate matches)
|
|
3748
|
+
*
|
|
3648
3749
|
* ```ts
|
|
3649
3750
|
* import { Chunk } from "effect"
|
|
3650
3751
|
*
|
|
@@ -3662,14 +3763,15 @@ export const takeWhile: {
|
|
|
3662
3763
|
* console.log(Chunk.toArray(all)) // [1, 2, 3]
|
|
3663
3764
|
* ```
|
|
3664
3765
|
*
|
|
3665
|
-
* @since 2.0.0
|
|
3666
3766
|
* @category elements
|
|
3767
|
+
* @since 2.0.0
|
|
3667
3768
|
*/
|
|
3668
3769
|
<A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Chunk<B>
|
|
3669
3770
|
/**
|
|
3670
3771
|
* Takes all elements so long as the predicate returns true.
|
|
3671
3772
|
*
|
|
3672
|
-
*
|
|
3773
|
+
* **Example** (Taking elements while a predicate matches)
|
|
3774
|
+
*
|
|
3673
3775
|
* ```ts
|
|
3674
3776
|
* import { Chunk } from "effect"
|
|
3675
3777
|
*
|
|
@@ -3687,8 +3789,8 @@ export const takeWhile: {
|
|
|
3687
3789
|
* console.log(Chunk.toArray(all)) // [1, 2, 3]
|
|
3688
3790
|
* ```
|
|
3689
3791
|
*
|
|
3690
|
-
* @since 2.0.0
|
|
3691
3792
|
* @category elements
|
|
3793
|
+
* @since 2.0.0
|
|
3692
3794
|
*/
|
|
3693
3795
|
<A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A>
|
|
3694
3796
|
} = dual(2, <A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A> => {
|
|
@@ -3706,7 +3808,8 @@ export const takeWhile: {
|
|
|
3706
3808
|
/**
|
|
3707
3809
|
* Creates a Chunks of unique values, in order, from all given Chunks.
|
|
3708
3810
|
*
|
|
3709
|
-
*
|
|
3811
|
+
* **Example** (Unioning chunks)
|
|
3812
|
+
*
|
|
3710
3813
|
* ```ts
|
|
3711
3814
|
* import { Chunk } from "effect"
|
|
3712
3815
|
*
|
|
@@ -3722,14 +3825,15 @@ export const takeWhile: {
|
|
|
3722
3825
|
* console.log(Chunk.toArray(unified)) // [1, 2, 3]
|
|
3723
3826
|
* ```
|
|
3724
3827
|
*
|
|
3725
|
-
* @since 2.0.0
|
|
3726
3828
|
* @category elements
|
|
3829
|
+
* @since 2.0.0
|
|
3727
3830
|
*/
|
|
3728
3831
|
export const union: {
|
|
3729
3832
|
/**
|
|
3730
3833
|
* Creates a Chunks of unique values, in order, from all given Chunks.
|
|
3731
3834
|
*
|
|
3732
|
-
*
|
|
3835
|
+
* **Example** (Unioning chunks)
|
|
3836
|
+
*
|
|
3733
3837
|
* ```ts
|
|
3734
3838
|
* import { Chunk } from "effect"
|
|
3735
3839
|
*
|
|
@@ -3745,14 +3849,15 @@ export const union: {
|
|
|
3745
3849
|
* console.log(Chunk.toArray(unified)) // [1, 2, 3]
|
|
3746
3850
|
* ```
|
|
3747
3851
|
*
|
|
3748
|
-
* @since 2.0.0
|
|
3749
3852
|
* @category elements
|
|
3853
|
+
* @since 2.0.0
|
|
3750
3854
|
*/
|
|
3751
3855
|
<A>(that: Chunk<A>): <B>(self: Chunk<B>) => Chunk<A | B>
|
|
3752
3856
|
/**
|
|
3753
3857
|
* Creates a Chunks of unique values, in order, from all given Chunks.
|
|
3754
3858
|
*
|
|
3755
|
-
*
|
|
3859
|
+
* **Example** (Unioning chunks)
|
|
3860
|
+
*
|
|
3756
3861
|
* ```ts
|
|
3757
3862
|
* import { Chunk } from "effect"
|
|
3758
3863
|
*
|
|
@@ -3768,8 +3873,8 @@ export const union: {
|
|
|
3768
3873
|
* console.log(Chunk.toArray(unified)) // [1, 2, 3]
|
|
3769
3874
|
* ```
|
|
3770
3875
|
*
|
|
3771
|
-
* @since 2.0.0
|
|
3772
3876
|
* @category elements
|
|
3877
|
+
* @since 2.0.0
|
|
3773
3878
|
*/
|
|
3774
3879
|
<A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<A | B>
|
|
3775
3880
|
} = dual(
|
|
@@ -3778,9 +3883,11 @@ export const union: {
|
|
|
3778
3883
|
)
|
|
3779
3884
|
|
|
3780
3885
|
/**
|
|
3781
|
-
*
|
|
3886
|
+
* Removes duplicate elements from a `Chunk`, preserving the first occurrence
|
|
3887
|
+
* of each value.
|
|
3888
|
+
*
|
|
3889
|
+
* **Example** (Removing duplicate values)
|
|
3782
3890
|
*
|
|
3783
|
-
* @example
|
|
3784
3891
|
* ```ts
|
|
3785
3892
|
* import { Chunk } from "effect"
|
|
3786
3893
|
*
|
|
@@ -3799,15 +3906,16 @@ export const union: {
|
|
|
3799
3906
|
* console.log(Chunk.toArray(uniqueDeduped)) // [1, 2, 3]
|
|
3800
3907
|
* ```
|
|
3801
3908
|
*
|
|
3802
|
-
* @since 2.0.0
|
|
3803
3909
|
* @category elements
|
|
3910
|
+
* @since 2.0.0
|
|
3804
3911
|
*/
|
|
3805
3912
|
export const dedupe = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupe(toReadonlyArray(self)))
|
|
3806
3913
|
|
|
3807
3914
|
/**
|
|
3808
3915
|
* Deduplicates adjacent elements that are identical.
|
|
3809
3916
|
*
|
|
3810
|
-
*
|
|
3917
|
+
* **Example** (Removing adjacent duplicates)
|
|
3918
|
+
*
|
|
3811
3919
|
* ```ts
|
|
3812
3920
|
* import { Chunk } from "effect"
|
|
3813
3921
|
*
|
|
@@ -3821,8 +3929,8 @@ export const dedupe = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupe
|
|
|
3821
3929
|
* console.log(Chunk.toArray(mixedResult)) // ["a", "b", "a"]
|
|
3822
3930
|
* ```
|
|
3823
3931
|
*
|
|
3824
|
-
* @since 2.0.0
|
|
3825
3932
|
* @category filtering
|
|
3933
|
+
* @since 2.0.0
|
|
3826
3934
|
*/
|
|
3827
3935
|
export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupeAdjacent(self))
|
|
3828
3936
|
|
|
@@ -3831,7 +3939,8 @@ export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(R
|
|
|
3831
3939
|
*
|
|
3832
3940
|
* Note: The function is reverse of `zip`.
|
|
3833
3941
|
*
|
|
3834
|
-
*
|
|
3942
|
+
* **Example** (Unzipping pairs)
|
|
3943
|
+
*
|
|
3835
3944
|
* ```ts
|
|
3836
3945
|
* import { Chunk } from "effect"
|
|
3837
3946
|
*
|
|
@@ -3851,8 +3960,8 @@ export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(R
|
|
|
3851
3960
|
* console.log(Chunk.toArray(emptyStrs)) // []
|
|
3852
3961
|
* ```
|
|
3853
3962
|
*
|
|
3854
|
-
* @since 2.0.0
|
|
3855
3963
|
* @category elements
|
|
3964
|
+
* @since 2.0.0
|
|
3856
3965
|
*/
|
|
3857
3966
|
export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>] => {
|
|
3858
3967
|
const [left, right] = RA.unzip(self)
|
|
@@ -3862,7 +3971,8 @@ export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>]
|
|
|
3862
3971
|
/**
|
|
3863
3972
|
* Zips this chunk pointwise with the specified chunk using the specified combiner.
|
|
3864
3973
|
*
|
|
3865
|
-
*
|
|
3974
|
+
* **Example** (Zipping chunks with a function)
|
|
3975
|
+
*
|
|
3866
3976
|
* ```ts
|
|
3867
3977
|
* import { Chunk } from "effect"
|
|
3868
3978
|
*
|
|
@@ -3878,14 +3988,15 @@ export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>]
|
|
|
3878
3988
|
* console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
|
|
3879
3989
|
* ```
|
|
3880
3990
|
*
|
|
3881
|
-
* @since 2.0.0
|
|
3882
3991
|
* @category zipping
|
|
3992
|
+
* @since 2.0.0
|
|
3883
3993
|
*/
|
|
3884
3994
|
export const zipWith: {
|
|
3885
3995
|
/**
|
|
3886
3996
|
* Zips this chunk pointwise with the specified chunk using the specified combiner.
|
|
3887
3997
|
*
|
|
3888
|
-
*
|
|
3998
|
+
* **Example** (Zipping chunks with a function)
|
|
3999
|
+
*
|
|
3889
4000
|
* ```ts
|
|
3890
4001
|
* import { Chunk } from "effect"
|
|
3891
4002
|
*
|
|
@@ -3901,14 +4012,15 @@ export const zipWith: {
|
|
|
3901
4012
|
* console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
|
|
3902
4013
|
* ```
|
|
3903
4014
|
*
|
|
3904
|
-
* @since 2.0.0
|
|
3905
4015
|
* @category zipping
|
|
4016
|
+
* @since 2.0.0
|
|
3906
4017
|
*/
|
|
3907
4018
|
<A, B, C>(that: Chunk<B>, f: (a: A, b: B) => C): (self: Chunk<A>) => Chunk<C>
|
|
3908
4019
|
/**
|
|
3909
4020
|
* Zips this chunk pointwise with the specified chunk using the specified combiner.
|
|
3910
4021
|
*
|
|
3911
|
-
*
|
|
4022
|
+
* **Example** (Zipping chunks with a function)
|
|
4023
|
+
*
|
|
3912
4024
|
* ```ts
|
|
3913
4025
|
* import { Chunk } from "effect"
|
|
3914
4026
|
*
|
|
@@ -3924,8 +4036,8 @@ export const zipWith: {
|
|
|
3924
4036
|
* console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
|
|
3925
4037
|
* ```
|
|
3926
4038
|
*
|
|
3927
|
-
* @since 2.0.0
|
|
3928
4039
|
* @category zipping
|
|
4040
|
+
* @since 2.0.0
|
|
3929
4041
|
*/
|
|
3930
4042
|
<A, B, C>(self: Chunk<A>, that: Chunk<B>, f: (a: A, b: B) => C): Chunk<C>
|
|
3931
4043
|
} = dual(
|
|
@@ -3937,7 +4049,8 @@ export const zipWith: {
|
|
|
3937
4049
|
/**
|
|
3938
4050
|
* Zips this chunk pointwise with the specified chunk.
|
|
3939
4051
|
*
|
|
3940
|
-
*
|
|
4052
|
+
* **Example** (Zipping chunks)
|
|
4053
|
+
*
|
|
3941
4054
|
* ```ts
|
|
3942
4055
|
* import { Chunk } from "effect"
|
|
3943
4056
|
*
|
|
@@ -3953,14 +4066,15 @@ export const zipWith: {
|
|
|
3953
4066
|
* console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
|
|
3954
4067
|
* ```
|
|
3955
4068
|
*
|
|
3956
|
-
* @since 2.0.0
|
|
3957
4069
|
* @category zipping
|
|
4070
|
+
* @since 2.0.0
|
|
3958
4071
|
*/
|
|
3959
4072
|
export const zip: {
|
|
3960
4073
|
/**
|
|
3961
4074
|
* Zips this chunk pointwise with the specified chunk.
|
|
3962
4075
|
*
|
|
3963
|
-
*
|
|
4076
|
+
* **Example** (Zipping chunks)
|
|
4077
|
+
*
|
|
3964
4078
|
* ```ts
|
|
3965
4079
|
* import { Chunk } from "effect"
|
|
3966
4080
|
*
|
|
@@ -3976,14 +4090,15 @@ export const zip: {
|
|
|
3976
4090
|
* console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
|
|
3977
4091
|
* ```
|
|
3978
4092
|
*
|
|
3979
|
-
* @since 2.0.0
|
|
3980
4093
|
* @category zipping
|
|
4094
|
+
* @since 2.0.0
|
|
3981
4095
|
*/
|
|
3982
4096
|
<B>(that: Chunk<B>): <A>(self: Chunk<A>) => Chunk<[A, B]>
|
|
3983
4097
|
/**
|
|
3984
4098
|
* Zips this chunk pointwise with the specified chunk.
|
|
3985
4099
|
*
|
|
3986
|
-
*
|
|
4100
|
+
* **Example** (Zipping chunks)
|
|
4101
|
+
*
|
|
3987
4102
|
* ```ts
|
|
3988
4103
|
* import { Chunk } from "effect"
|
|
3989
4104
|
*
|
|
@@ -3999,8 +4114,8 @@ export const zip: {
|
|
|
3999
4114
|
* console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
|
|
4000
4115
|
* ```
|
|
4001
4116
|
*
|
|
4002
|
-
* @since 2.0.0
|
|
4003
4117
|
* @category zipping
|
|
4118
|
+
* @since 2.0.0
|
|
4004
4119
|
*/
|
|
4005
4120
|
<A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<[A, B]>
|
|
4006
4121
|
} = dual(
|
|
@@ -4011,7 +4126,8 @@ export const zip: {
|
|
|
4011
4126
|
/**
|
|
4012
4127
|
* Delete the element at the specified index, creating a new `Chunk`.
|
|
4013
4128
|
*
|
|
4014
|
-
*
|
|
4129
|
+
* **Example** (Removing an element)
|
|
4130
|
+
*
|
|
4015
4131
|
* ```ts
|
|
4016
4132
|
* import { Chunk } from "effect"
|
|
4017
4133
|
*
|
|
@@ -4035,7 +4151,8 @@ export const remove: {
|
|
|
4035
4151
|
/**
|
|
4036
4152
|
* Delete the element at the specified index, creating a new `Chunk`.
|
|
4037
4153
|
*
|
|
4038
|
-
*
|
|
4154
|
+
* **Example** (Removing an element)
|
|
4155
|
+
*
|
|
4039
4156
|
* ```ts
|
|
4040
4157
|
* import { Chunk } from "effect"
|
|
4041
4158
|
*
|
|
@@ -4059,7 +4176,8 @@ export const remove: {
|
|
|
4059
4176
|
/**
|
|
4060
4177
|
* Delete the element at the specified index, creating a new `Chunk`.
|
|
4061
4178
|
*
|
|
4062
|
-
*
|
|
4179
|
+
* **Example** (Removing an element)
|
|
4180
|
+
*
|
|
4063
4181
|
* ```ts
|
|
4064
4182
|
* import { Chunk } from "effect"
|
|
4065
4183
|
*
|
|
@@ -4089,7 +4207,8 @@ export const remove: {
|
|
|
4089
4207
|
* Applies a function to the element at the specified index, creating a new `Chunk`,
|
|
4090
4208
|
* or returns `None` if the index is out of bounds.
|
|
4091
4209
|
*
|
|
4092
|
-
*
|
|
4210
|
+
* **Example** (Modifying an element)
|
|
4211
|
+
*
|
|
4093
4212
|
* ```ts
|
|
4094
4213
|
* import { Chunk } from "effect"
|
|
4095
4214
|
*
|
|
@@ -4114,7 +4233,8 @@ export const modify: {
|
|
|
4114
4233
|
* Applies a function to the element at the specified index, creating a new `Chunk`,
|
|
4115
4234
|
* or returns `None` if the index is out of bounds.
|
|
4116
4235
|
*
|
|
4117
|
-
*
|
|
4236
|
+
* **Example** (Modifying an element)
|
|
4237
|
+
*
|
|
4118
4238
|
* ```ts
|
|
4119
4239
|
* import { Chunk } from "effect"
|
|
4120
4240
|
*
|
|
@@ -4139,7 +4259,8 @@ export const modify: {
|
|
|
4139
4259
|
* Applies a function to the element at the specified index, creating a new `Chunk`,
|
|
4140
4260
|
* or returns `None` if the index is out of bounds.
|
|
4141
4261
|
*
|
|
4142
|
-
*
|
|
4262
|
+
* **Example** (Modifying an element)
|
|
4263
|
+
*
|
|
4143
4264
|
* ```ts
|
|
4144
4265
|
* import { Chunk } from "effect"
|
|
4145
4266
|
*
|
|
@@ -4170,7 +4291,8 @@ export const modify: {
|
|
|
4170
4291
|
* Change the element at the specified index, creating a new `Chunk`,
|
|
4171
4292
|
* or returns `None` if the index is out of bounds.
|
|
4172
4293
|
*
|
|
4173
|
-
*
|
|
4294
|
+
* **Example** (Replacing an element)
|
|
4295
|
+
*
|
|
4174
4296
|
* ```ts
|
|
4175
4297
|
* import { Chunk } from "effect"
|
|
4176
4298
|
*
|
|
@@ -4195,7 +4317,8 @@ export const replace: {
|
|
|
4195
4317
|
* Change the element at the specified index, creating a new `Chunk`,
|
|
4196
4318
|
* or returns `None` if the index is out of bounds.
|
|
4197
4319
|
*
|
|
4198
|
-
*
|
|
4320
|
+
* **Example** (Replacing an element)
|
|
4321
|
+
*
|
|
4199
4322
|
* ```ts
|
|
4200
4323
|
* import { Chunk } from "effect"
|
|
4201
4324
|
*
|
|
@@ -4220,7 +4343,8 @@ export const replace: {
|
|
|
4220
4343
|
* Change the element at the specified index, creating a new `Chunk`,
|
|
4221
4344
|
* or returns `None` if the index is out of bounds.
|
|
4222
4345
|
*
|
|
4223
|
-
*
|
|
4346
|
+
* **Example** (Replacing an element)
|
|
4347
|
+
*
|
|
4224
4348
|
* ```ts
|
|
4225
4349
|
* import { Chunk } from "effect"
|
|
4226
4350
|
*
|
|
@@ -4248,13 +4372,13 @@ export const replace: {
|
|
|
4248
4372
|
*
|
|
4249
4373
|
* **Note**. `n` is normalized to an integer >= 1.
|
|
4250
4374
|
*
|
|
4251
|
-
*
|
|
4375
|
+
* **Example** (Generating chunks from indices)
|
|
4376
|
+
*
|
|
4252
4377
|
* ```ts
|
|
4253
4378
|
* import { Chunk } from "effect"
|
|
4254
4379
|
*
|
|
4255
4380
|
* const chunk = Chunk.makeBy(5, (i) => i * 2)
|
|
4256
|
-
* console.log(chunk)
|
|
4257
|
-
* // { _id: 'Chunk', values: [ 0, 2, 4, 6, 8 ] }
|
|
4381
|
+
* console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
|
|
4258
4382
|
* ```
|
|
4259
4383
|
*
|
|
4260
4384
|
* @category constructors
|
|
@@ -4266,13 +4390,13 @@ export const makeBy: {
|
|
|
4266
4390
|
*
|
|
4267
4391
|
* **Note**. `n` is normalized to an integer >= 1.
|
|
4268
4392
|
*
|
|
4269
|
-
*
|
|
4393
|
+
* **Example** (Generating chunks from indices)
|
|
4394
|
+
*
|
|
4270
4395
|
* ```ts
|
|
4271
4396
|
* import { Chunk } from "effect"
|
|
4272
4397
|
*
|
|
4273
4398
|
* const chunk = Chunk.makeBy(5, (i) => i * 2)
|
|
4274
|
-
* console.log(chunk)
|
|
4275
|
-
* // { _id: 'Chunk', values: [ 0, 2, 4, 6, 8 ] }
|
|
4399
|
+
* console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
|
|
4276
4400
|
* ```
|
|
4277
4401
|
*
|
|
4278
4402
|
* @category constructors
|
|
@@ -4284,13 +4408,13 @@ export const makeBy: {
|
|
|
4284
4408
|
*
|
|
4285
4409
|
* **Note**. `n` is normalized to an integer >= 1.
|
|
4286
4410
|
*
|
|
4287
|
-
*
|
|
4411
|
+
* **Example** (Generating chunks from indices)
|
|
4412
|
+
*
|
|
4288
4413
|
* ```ts
|
|
4289
4414
|
* import { Chunk } from "effect"
|
|
4290
4415
|
*
|
|
4291
4416
|
* const chunk = Chunk.makeBy(5, (i) => i * 2)
|
|
4292
|
-
* console.log(chunk)
|
|
4293
|
-
* // { _id: 'Chunk', values: [ 0, 2, 4, 6, 8 ] }
|
|
4417
|
+
* console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
|
|
4294
4418
|
* ```
|
|
4295
4419
|
*
|
|
4296
4420
|
* @category constructors
|
|
@@ -4300,15 +4424,19 @@ export const makeBy: {
|
|
|
4300
4424
|
} = dual(2, (n, f) => fromIterable(RA.makeBy(n, f)))
|
|
4301
4425
|
|
|
4302
4426
|
/**
|
|
4303
|
-
*
|
|
4427
|
+
* Creates a non-empty `Chunk` of consecutive integers from `start` through
|
|
4428
|
+
* `end`, inclusive.
|
|
4429
|
+
*
|
|
4430
|
+
* If `start` is greater than `end`, returns a single-element chunk containing
|
|
4431
|
+
* `start`.
|
|
4432
|
+
*
|
|
4433
|
+
* **Example** (Creating a range)
|
|
4304
4434
|
*
|
|
4305
|
-
* @example
|
|
4306
4435
|
* ```ts
|
|
4307
4436
|
* import { Chunk } from "effect"
|
|
4308
4437
|
*
|
|
4309
4438
|
* const chunk = Chunk.range(1, 5)
|
|
4310
|
-
* console.log(chunk)
|
|
4311
|
-
* // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
|
|
4439
|
+
* console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4, 5]
|
|
4312
4440
|
* ```
|
|
4313
4441
|
*
|
|
4314
4442
|
* @category constructors
|
|
@@ -4324,7 +4452,8 @@ export const range = (start: number, end: number): NonEmptyChunk<number> =>
|
|
|
4324
4452
|
/**
|
|
4325
4453
|
* Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.
|
|
4326
4454
|
*
|
|
4327
|
-
*
|
|
4455
|
+
* **Example** (Checking membership)
|
|
4456
|
+
*
|
|
4328
4457
|
* ```ts
|
|
4329
4458
|
* import { Chunk } from "effect"
|
|
4330
4459
|
*
|
|
@@ -4353,7 +4482,8 @@ export const contains: {
|
|
|
4353
4482
|
/**
|
|
4354
4483
|
* Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.
|
|
4355
4484
|
*
|
|
4356
|
-
*
|
|
4485
|
+
* **Example** (Checking membership)
|
|
4486
|
+
*
|
|
4357
4487
|
* ```ts
|
|
4358
4488
|
* import { Chunk } from "effect"
|
|
4359
4489
|
*
|
|
@@ -4382,7 +4512,8 @@ export const contains: {
|
|
|
4382
4512
|
/**
|
|
4383
4513
|
* Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.
|
|
4384
4514
|
*
|
|
4385
|
-
*
|
|
4515
|
+
* **Example** (Checking membership)
|
|
4516
|
+
*
|
|
4386
4517
|
* ```ts
|
|
4387
4518
|
* import { Chunk } from "effect"
|
|
4388
4519
|
*
|
|
@@ -4409,7 +4540,8 @@ export const contains: {
|
|
|
4409
4540
|
/**
|
|
4410
4541
|
* Returns a function that checks if a `Chunk` contains a given value using a provided `isEquivalent` function.
|
|
4411
4542
|
*
|
|
4412
|
-
*
|
|
4543
|
+
* **Example** (Checking membership with custom equivalence)
|
|
4544
|
+
*
|
|
4413
4545
|
* ```ts
|
|
4414
4546
|
* import { Chunk } from "effect"
|
|
4415
4547
|
*
|
|
@@ -4445,7 +4577,8 @@ export const containsWith: <A>(
|
|
|
4445
4577
|
* Returns the first element that satisfies the specified
|
|
4446
4578
|
* predicate, or `None` if no such element exists.
|
|
4447
4579
|
*
|
|
4448
|
-
*
|
|
4580
|
+
* **Example** (Finding the first matching element)
|
|
4581
|
+
*
|
|
4449
4582
|
* ```ts
|
|
4450
4583
|
* import { Chunk, Option } from "effect"
|
|
4451
4584
|
*
|
|
@@ -4475,7 +4608,8 @@ export const findFirst: {
|
|
|
4475
4608
|
* Returns the first element that satisfies the specified
|
|
4476
4609
|
* predicate, or `None` if no such element exists.
|
|
4477
4610
|
*
|
|
4478
|
-
*
|
|
4611
|
+
* **Example** (Finding the first matching element)
|
|
4612
|
+
*
|
|
4479
4613
|
* ```ts
|
|
4480
4614
|
* import { Chunk, Option } from "effect"
|
|
4481
4615
|
*
|
|
@@ -4505,7 +4639,8 @@ export const findFirst: {
|
|
|
4505
4639
|
* Returns the first element that satisfies the specified
|
|
4506
4640
|
* predicate, or `None` if no such element exists.
|
|
4507
4641
|
*
|
|
4508
|
-
*
|
|
4642
|
+
* **Example** (Finding the first matching element)
|
|
4643
|
+
*
|
|
4509
4644
|
* ```ts
|
|
4510
4645
|
* import { Chunk, Option } from "effect"
|
|
4511
4646
|
*
|
|
@@ -4535,7 +4670,8 @@ export const findFirst: {
|
|
|
4535
4670
|
* Returns the first element that satisfies the specified
|
|
4536
4671
|
* predicate, or `None` if no such element exists.
|
|
4537
4672
|
*
|
|
4538
|
-
*
|
|
4673
|
+
* **Example** (Finding the first matching element)
|
|
4674
|
+
*
|
|
4539
4675
|
* ```ts
|
|
4540
4676
|
* import { Chunk, Option } from "effect"
|
|
4541
4677
|
*
|
|
@@ -4565,7 +4701,8 @@ export const findFirst: {
|
|
|
4565
4701
|
* Returns the first element that satisfies the specified
|
|
4566
4702
|
* predicate, or `None` if no such element exists.
|
|
4567
4703
|
*
|
|
4568
|
-
*
|
|
4704
|
+
* **Example** (Finding the first matching element)
|
|
4705
|
+
*
|
|
4569
4706
|
* ```ts
|
|
4570
4707
|
* import { Chunk, Option } from "effect"
|
|
4571
4708
|
*
|
|
@@ -4596,7 +4733,8 @@ export const findFirst: {
|
|
|
4596
4733
|
/**
|
|
4597
4734
|
* Return the first index for which a predicate holds.
|
|
4598
4735
|
*
|
|
4599
|
-
*
|
|
4736
|
+
* **Example** (Finding the first matching index)
|
|
4737
|
+
*
|
|
4600
4738
|
* ```ts
|
|
4601
4739
|
* import { Chunk } from "effect"
|
|
4602
4740
|
*
|
|
@@ -4620,7 +4758,8 @@ export const findFirstIndex: {
|
|
|
4620
4758
|
/**
|
|
4621
4759
|
* Return the first index for which a predicate holds.
|
|
4622
4760
|
*
|
|
4623
|
-
*
|
|
4761
|
+
* **Example** (Finding the first matching index)
|
|
4762
|
+
*
|
|
4624
4763
|
* ```ts
|
|
4625
4764
|
* import { Chunk } from "effect"
|
|
4626
4765
|
*
|
|
@@ -4644,7 +4783,8 @@ export const findFirstIndex: {
|
|
|
4644
4783
|
/**
|
|
4645
4784
|
* Return the first index for which a predicate holds.
|
|
4646
4785
|
*
|
|
4647
|
-
*
|
|
4786
|
+
* **Example** (Finding the first matching index)
|
|
4787
|
+
*
|
|
4648
4788
|
* ```ts
|
|
4649
4789
|
* import { Chunk } from "effect"
|
|
4650
4790
|
*
|
|
@@ -4673,7 +4813,8 @@ export const findFirstIndex: {
|
|
|
4673
4813
|
/**
|
|
4674
4814
|
* Find the last element for which a predicate holds.
|
|
4675
4815
|
*
|
|
4676
|
-
*
|
|
4816
|
+
* **Example** (Finding the last matching element)
|
|
4817
|
+
*
|
|
4677
4818
|
* ```ts
|
|
4678
4819
|
* import { Chunk } from "effect"
|
|
4679
4820
|
* import * as Option from "effect/Option"
|
|
@@ -4699,7 +4840,8 @@ export const findLast: {
|
|
|
4699
4840
|
/**
|
|
4700
4841
|
* Find the last element for which a predicate holds.
|
|
4701
4842
|
*
|
|
4702
|
-
*
|
|
4843
|
+
* **Example** (Finding the last matching element)
|
|
4844
|
+
*
|
|
4703
4845
|
* ```ts
|
|
4704
4846
|
* import { Chunk } from "effect"
|
|
4705
4847
|
* import * as Option from "effect/Option"
|
|
@@ -4725,7 +4867,8 @@ export const findLast: {
|
|
|
4725
4867
|
/**
|
|
4726
4868
|
* Find the last element for which a predicate holds.
|
|
4727
4869
|
*
|
|
4728
|
-
*
|
|
4870
|
+
* **Example** (Finding the last matching element)
|
|
4871
|
+
*
|
|
4729
4872
|
* ```ts
|
|
4730
4873
|
* import { Chunk } from "effect"
|
|
4731
4874
|
* import * as Option from "effect/Option"
|
|
@@ -4751,7 +4894,8 @@ export const findLast: {
|
|
|
4751
4894
|
/**
|
|
4752
4895
|
* Find the last element for which a predicate holds.
|
|
4753
4896
|
*
|
|
4754
|
-
*
|
|
4897
|
+
* **Example** (Finding the last matching element)
|
|
4898
|
+
*
|
|
4755
4899
|
* ```ts
|
|
4756
4900
|
* import { Chunk } from "effect"
|
|
4757
4901
|
* import * as Option from "effect/Option"
|
|
@@ -4777,7 +4921,8 @@ export const findLast: {
|
|
|
4777
4921
|
/**
|
|
4778
4922
|
* Find the last element for which a predicate holds.
|
|
4779
4923
|
*
|
|
4780
|
-
*
|
|
4924
|
+
* **Example** (Finding the last matching element)
|
|
4925
|
+
*
|
|
4781
4926
|
* ```ts
|
|
4782
4927
|
* import { Chunk } from "effect"
|
|
4783
4928
|
* import * as Option from "effect/Option"
|
|
@@ -4805,7 +4950,8 @@ export const findLast: {
|
|
|
4805
4950
|
/**
|
|
4806
4951
|
* Return the last index for which a predicate holds.
|
|
4807
4952
|
*
|
|
4808
|
-
*
|
|
4953
|
+
* **Example** (Finding the last matching index)
|
|
4954
|
+
*
|
|
4809
4955
|
* ```ts
|
|
4810
4956
|
* import { Chunk } from "effect"
|
|
4811
4957
|
*
|
|
@@ -4829,7 +4975,8 @@ export const findLastIndex: {
|
|
|
4829
4975
|
/**
|
|
4830
4976
|
* Return the last index for which a predicate holds.
|
|
4831
4977
|
*
|
|
4832
|
-
*
|
|
4978
|
+
* **Example** (Finding the last matching index)
|
|
4979
|
+
*
|
|
4833
4980
|
* ```ts
|
|
4834
4981
|
* import { Chunk } from "effect"
|
|
4835
4982
|
*
|
|
@@ -4853,7 +5000,8 @@ export const findLastIndex: {
|
|
|
4853
5000
|
/**
|
|
4854
5001
|
* Return the last index for which a predicate holds.
|
|
4855
5002
|
*
|
|
4856
|
-
*
|
|
5003
|
+
* **Example** (Finding the last matching index)
|
|
5004
|
+
*
|
|
4857
5005
|
* ```ts
|
|
4858
5006
|
* import { Chunk } from "effect"
|
|
4859
5007
|
*
|
|
@@ -4882,7 +5030,8 @@ export const findLastIndex: {
|
|
|
4882
5030
|
/**
|
|
4883
5031
|
* Check if a predicate holds true for every `Chunk` element.
|
|
4884
5032
|
*
|
|
4885
|
-
*
|
|
5033
|
+
* **Example** (Checking every element)
|
|
5034
|
+
*
|
|
4886
5035
|
* ```ts
|
|
4887
5036
|
* import { Chunk } from "effect"
|
|
4888
5037
|
*
|
|
@@ -4909,7 +5058,8 @@ export const every: {
|
|
|
4909
5058
|
/**
|
|
4910
5059
|
* Check if a predicate holds true for every `Chunk` element.
|
|
4911
5060
|
*
|
|
4912
|
-
*
|
|
5061
|
+
* **Example** (Checking every element)
|
|
5062
|
+
*
|
|
4913
5063
|
* ```ts
|
|
4914
5064
|
* import { Chunk } from "effect"
|
|
4915
5065
|
*
|
|
@@ -4936,7 +5086,8 @@ export const every: {
|
|
|
4936
5086
|
/**
|
|
4937
5087
|
* Check if a predicate holds true for every `Chunk` element.
|
|
4938
5088
|
*
|
|
4939
|
-
*
|
|
5089
|
+
* **Example** (Checking every element)
|
|
5090
|
+
*
|
|
4940
5091
|
* ```ts
|
|
4941
5092
|
* import { Chunk } from "effect"
|
|
4942
5093
|
*
|
|
@@ -4963,7 +5114,8 @@ export const every: {
|
|
|
4963
5114
|
/**
|
|
4964
5115
|
* Check if a predicate holds true for every `Chunk` element.
|
|
4965
5116
|
*
|
|
4966
|
-
*
|
|
5117
|
+
* **Example** (Checking every element)
|
|
5118
|
+
*
|
|
4967
5119
|
* ```ts
|
|
4968
5120
|
* import { Chunk } from "effect"
|
|
4969
5121
|
*
|
|
@@ -4990,7 +5142,8 @@ export const every: {
|
|
|
4990
5142
|
/**
|
|
4991
5143
|
* Check if a predicate holds true for every `Chunk` element.
|
|
4992
5144
|
*
|
|
4993
|
-
*
|
|
5145
|
+
* **Example** (Checking every element)
|
|
5146
|
+
*
|
|
4994
5147
|
* ```ts
|
|
4995
5148
|
* import { Chunk } from "effect"
|
|
4996
5149
|
*
|
|
@@ -5023,7 +5176,8 @@ export const every: {
|
|
|
5023
5176
|
/**
|
|
5024
5177
|
* Check if a predicate holds true for some `Chunk` element.
|
|
5025
5178
|
*
|
|
5026
|
-
*
|
|
5179
|
+
* **Example** (Checking for some matching element)
|
|
5180
|
+
*
|
|
5027
5181
|
* ```ts
|
|
5028
5182
|
* import { Chunk } from "effect"
|
|
5029
5183
|
*
|
|
@@ -5047,7 +5201,8 @@ export const some: {
|
|
|
5047
5201
|
/**
|
|
5048
5202
|
* Check if a predicate holds true for some `Chunk` element.
|
|
5049
5203
|
*
|
|
5050
|
-
*
|
|
5204
|
+
* **Example** (Checking for some matching element)
|
|
5205
|
+
*
|
|
5051
5206
|
* ```ts
|
|
5052
5207
|
* import { Chunk } from "effect"
|
|
5053
5208
|
*
|
|
@@ -5071,7 +5226,8 @@ export const some: {
|
|
|
5071
5226
|
/**
|
|
5072
5227
|
* Check if a predicate holds true for some `Chunk` element.
|
|
5073
5228
|
*
|
|
5074
|
-
*
|
|
5229
|
+
* **Example** (Checking for some matching element)
|
|
5230
|
+
*
|
|
5075
5231
|
* ```ts
|
|
5076
5232
|
* import { Chunk } from "effect"
|
|
5077
5233
|
*
|
|
@@ -5100,7 +5256,8 @@ export const some: {
|
|
|
5100
5256
|
/**
|
|
5101
5257
|
* Joins the elements together with "sep" in the middle.
|
|
5102
5258
|
*
|
|
5103
|
-
*
|
|
5259
|
+
* **Example** (Joining chunks into a string)
|
|
5260
|
+
*
|
|
5104
5261
|
* ```ts
|
|
5105
5262
|
* import { Chunk } from "effect"
|
|
5106
5263
|
*
|
|
@@ -5128,7 +5285,8 @@ export const join: {
|
|
|
5128
5285
|
/**
|
|
5129
5286
|
* Joins the elements together with "sep" in the middle.
|
|
5130
5287
|
*
|
|
5131
|
-
*
|
|
5288
|
+
* **Example** (Joining chunks into a string)
|
|
5289
|
+
*
|
|
5132
5290
|
* ```ts
|
|
5133
5291
|
* import { Chunk } from "effect"
|
|
5134
5292
|
*
|
|
@@ -5156,7 +5314,8 @@ export const join: {
|
|
|
5156
5314
|
/**
|
|
5157
5315
|
* Joins the elements together with "sep" in the middle.
|
|
5158
5316
|
*
|
|
5159
|
-
*
|
|
5317
|
+
* **Example** (Joining chunks into a string)
|
|
5318
|
+
*
|
|
5160
5319
|
* ```ts
|
|
5161
5320
|
* import { Chunk } from "effect"
|
|
5162
5321
|
*
|
|
@@ -5186,7 +5345,8 @@ export const join: {
|
|
|
5186
5345
|
/**
|
|
5187
5346
|
* Reduces the elements of a chunk from left to right.
|
|
5188
5347
|
*
|
|
5189
|
-
*
|
|
5348
|
+
* **Example** (Reducing from the left)
|
|
5349
|
+
*
|
|
5190
5350
|
* ```ts
|
|
5191
5351
|
* import { Chunk } from "effect"
|
|
5192
5352
|
*
|
|
@@ -5211,7 +5371,8 @@ export const reduce: {
|
|
|
5211
5371
|
/**
|
|
5212
5372
|
* Reduces the elements of a chunk from left to right.
|
|
5213
5373
|
*
|
|
5214
|
-
*
|
|
5374
|
+
* **Example** (Reducing from the left)
|
|
5375
|
+
*
|
|
5215
5376
|
* ```ts
|
|
5216
5377
|
* import { Chunk } from "effect"
|
|
5217
5378
|
*
|
|
@@ -5236,7 +5397,8 @@ export const reduce: {
|
|
|
5236
5397
|
/**
|
|
5237
5398
|
* Reduces the elements of a chunk from left to right.
|
|
5238
5399
|
*
|
|
5239
|
-
*
|
|
5400
|
+
* **Example** (Reducing from the left)
|
|
5401
|
+
*
|
|
5240
5402
|
* ```ts
|
|
5241
5403
|
* import { Chunk } from "effect"
|
|
5242
5404
|
*
|
|
@@ -5263,7 +5425,8 @@ export const reduce: {
|
|
|
5263
5425
|
/**
|
|
5264
5426
|
* Reduces the elements of a chunk from right to left.
|
|
5265
5427
|
*
|
|
5266
|
-
*
|
|
5428
|
+
* **Example** (Reducing from the right)
|
|
5429
|
+
*
|
|
5267
5430
|
* ```ts
|
|
5268
5431
|
* import { Chunk } from "effect"
|
|
5269
5432
|
*
|
|
@@ -5292,7 +5455,8 @@ export const reduceRight: {
|
|
|
5292
5455
|
/**
|
|
5293
5456
|
* Reduces the elements of a chunk from right to left.
|
|
5294
5457
|
*
|
|
5295
|
-
*
|
|
5458
|
+
* **Example** (Reducing from the right)
|
|
5459
|
+
*
|
|
5296
5460
|
* ```ts
|
|
5297
5461
|
* import { Chunk } from "effect"
|
|
5298
5462
|
*
|
|
@@ -5321,7 +5485,8 @@ export const reduceRight: {
|
|
|
5321
5485
|
/**
|
|
5322
5486
|
* Reduces the elements of a chunk from right to left.
|
|
5323
5487
|
*
|
|
5324
|
-
*
|
|
5488
|
+
* **Example** (Reducing from the right)
|
|
5489
|
+
*
|
|
5325
5490
|
* ```ts
|
|
5326
5491
|
* import { Chunk } from "effect"
|
|
5327
5492
|
*
|
|
@@ -5353,7 +5518,8 @@ export const reduceRight: {
|
|
|
5353
5518
|
* Creates a `Chunk` of values not included in the other given `Chunk` using the provided `isEquivalent` function.
|
|
5354
5519
|
* The order and references of result values are determined by the first `Chunk`.
|
|
5355
5520
|
*
|
|
5356
|
-
*
|
|
5521
|
+
* **Example** (Computing difference with custom equivalence)
|
|
5522
|
+
*
|
|
5357
5523
|
* ```ts
|
|
5358
5524
|
* import { Chunk } from "effect"
|
|
5359
5525
|
*
|
|
@@ -5394,7 +5560,8 @@ export const differenceWith = <A>(isEquivalent: (self: A, that: A) => boolean):
|
|
|
5394
5560
|
* Creates a `Chunk` of values not included in the other given `Chunk`.
|
|
5395
5561
|
* The order and references of result values are determined by the first `Chunk`.
|
|
5396
5562
|
*
|
|
5397
|
-
*
|
|
5563
|
+
* **Example** (Computing chunk difference)
|
|
5564
|
+
*
|
|
5398
5565
|
* ```ts
|
|
5399
5566
|
* import { Chunk } from "effect"
|
|
5400
5567
|
*
|
|
@@ -5423,7 +5590,8 @@ export const difference: {
|
|
|
5423
5590
|
* Creates a `Chunk` of values not included in the other given `Chunk`.
|
|
5424
5591
|
* The order and references of result values are determined by the first `Chunk`.
|
|
5425
5592
|
*
|
|
5426
|
-
*
|
|
5593
|
+
* **Example** (Computing chunk difference)
|
|
5594
|
+
*
|
|
5427
5595
|
* ```ts
|
|
5428
5596
|
* import { Chunk } from "effect"
|
|
5429
5597
|
*
|
|
@@ -5452,7 +5620,8 @@ export const difference: {
|
|
|
5452
5620
|
* Creates a `Chunk` of values not included in the other given `Chunk`.
|
|
5453
5621
|
* The order and references of result values are determined by the first `Chunk`.
|
|
5454
5622
|
*
|
|
5455
|
-
*
|
|
5623
|
+
* **Example** (Computing chunk difference)
|
|
5624
|
+
*
|
|
5456
5625
|
* ```ts
|
|
5457
5626
|
* import { Chunk } from "effect"
|
|
5458
5627
|
*
|