effect 4.0.0-beta.70 → 4.0.0-beta.71
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 +1428 -138
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +595 -126
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +594 -8
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +307 -8
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +457 -3
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +279 -3
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +229 -7
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +155 -5
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +51 -5
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +80 -8
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +64 -3
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +50 -12
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +475 -183
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +336 -114
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +398 -59
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +166 -47
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +78 -3
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +44 -3
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +112 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +32 -0
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +57 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +30 -0
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +15 -11
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -8
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +126 -40
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +102 -29
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +48 -25
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +17 -17
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +22 -1
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +22 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +491 -36
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +185 -11
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +110 -1
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +86 -1
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +29 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +29 -0
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +77 -26
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +10 -7
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +149 -6
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +81 -2
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +340 -74
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +128 -9
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +5 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +164 -11
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +91 -11
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +1822 -537
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +684 -224
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +14 -0
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +14 -0
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +89 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +131 -1
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +7 -7
- package/dist/Equal.js +5 -5
- package/dist/Equivalence.d.ts +41 -24
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +38 -21
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +123 -5
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +85 -5
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +89 -24
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +21 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +128 -82
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +106 -69
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +317 -68
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +150 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FileSystem.d.ts +69 -10
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +85 -29
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +221 -2
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +155 -2
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +3 -3
- package/dist/Formatter.js +2 -2
- package/dist/Function.d.ts +152 -6
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +104 -3
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +275 -3
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +63 -0
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +55 -23
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +92 -16
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +116 -14
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +2 -2
- package/dist/HashMap.js +2 -2
- package/dist/HashRing.d.ts +203 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +92 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/Inspectable.d.ts +43 -0
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +70 -13
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +179 -25
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +95 -23
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +33 -18
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +51 -43
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +2 -2
- package/dist/JsonPointer.js +2 -2
- package/dist/JsonSchema.d.ts +64 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +32 -8
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +156 -11
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +77 -2
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +250 -74
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +71 -21
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +8 -0
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +93 -18
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +65 -6
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +19 -5
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +24 -11
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +81 -9
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +32 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +185 -7
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +212 -24
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +33 -20
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +26 -13
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +272 -21
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +123 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +107 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +96 -37
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +10 -2
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +10 -2
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +136 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +70 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +20 -11
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -6
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +20 -4
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +5 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +417 -2
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +255 -2
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +17 -17
- package/dist/Optic.js +12 -12
- package/dist/Option.d.ts +168 -129
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +67 -63
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +82 -82
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +138 -109
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +32 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +19 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +238 -11
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +107 -5
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +35 -4
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +21 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +27 -2
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +14 -2
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +53 -4
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +45 -4
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +140 -14
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +63 -8
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +96 -87
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +107 -73
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +74 -8
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +69 -8
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +94 -20
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +94 -20
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +147 -2
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +68 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +127 -35
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +127 -35
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +71 -16
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +168 -6
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +48 -2
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +73 -18
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +23 -3
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +95 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +95 -1
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +20 -16
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +15 -11
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +82 -4
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +64 -4
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +17 -5
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -2
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +156 -20
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +125 -20
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +208 -12
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +144 -5
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +13 -0
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +47 -1
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +215 -32
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +54 -7
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +202 -15
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +94 -5
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +62 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +52 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +328 -23
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +132 -12
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +123 -13
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +149 -24
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +418 -93
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +334 -97
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +50 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +39 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +467 -42
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +248 -48
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +205 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +205 -2
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +123 -123
- package/dist/SchemaGetter.js +111 -111
- package/dist/SchemaIssue.d.ts +25 -24
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +19 -19
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +238 -3
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +279 -21
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +61 -17
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +58 -14
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +76 -38
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +73 -35
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +9 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +38 -11
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +79 -14
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +63 -14
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +352 -7
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +151 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +67 -5
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +47 -3
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +347 -28
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +102 -7
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +307 -4
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +173 -2
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +69 -15
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +60 -15
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +516 -65
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +234 -33
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +173 -2
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +149 -2
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +19 -10
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +13 -4
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +73 -14
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +72 -13
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +24 -6
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +24 -6
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +502 -2
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +184 -2
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +36 -13
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +5 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +68 -17
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +33 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +49 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +49 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +48 -9
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +70 -35
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +32 -21
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +40 -7
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +40 -7
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +85 -2
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +56 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +29 -2
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +29 -2
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +94 -4
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +66 -4
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +48 -7
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +40 -4
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +40 -4
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +112 -7
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +81 -7
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +173 -14
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +130 -14
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +205 -2
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +110 -2
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +60 -6
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +171 -30
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +115 -30
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +120 -12
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +36 -12
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +20 -14
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +13 -4
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -5205
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5205
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/request.js +3 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +11 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/representation.js +21 -12
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +69 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +73 -9
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +81 -24
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +71 -25
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -107
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -107
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +24 -1
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +24 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +9 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +43 -11
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +25 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +53 -28
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +100 -5
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +100 -5
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +1 -1
- package/dist/unstable/ai/IdGenerator.js +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +41 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +40 -1
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +10 -2
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +10 -2
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +59 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +59 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +35 -13
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +34 -12
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +48 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +23 -2
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +22 -1
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +71 -13
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +35 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +34 -12
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +33 -11
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +40 -27
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +34 -26
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +34 -23
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +34 -23
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +82 -21
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +81 -20
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +1 -1
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +0 -560
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +0 -560
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +133 -5
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +49 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +13 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +41 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +15 -3
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +15 -3
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +28 -4
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +28 -4
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +126 -0
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +57 -5
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +2 -2
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +58 -9
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +26 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +25 -0
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +0 -220
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +0 -220
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +61 -22
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +61 -22
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +53 -0
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +53 -0
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +76 -24
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +76 -24
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +18 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +17 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +19 -0
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +19 -0
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +44 -7
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +44 -7
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +19 -0
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +19 -0
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +26 -14
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +26 -14
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +33 -14
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +35 -9
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +35 -9
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +1 -1
- package/dist/unstable/cluster/Message.js +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +31 -17
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +31 -17
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +46 -13
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +46 -13
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +45 -9
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +45 -9
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +30 -13
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +30 -13
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +15 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +15 -1
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +24 -0
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +24 -0
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +22 -0
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +22 -0
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +19 -0
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +55 -17
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +57 -13
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +58 -14
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +26 -12
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +27 -13
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +25 -0
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +25 -0
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +51 -9
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +51 -9
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +27 -13
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +27 -13
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +13 -0
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +13 -0
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +21 -0
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +21 -0
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +38 -0
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +73 -13
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +27 -16
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +27 -16
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +0 -790
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +0 -790
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +41 -11
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +41 -11
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +38 -0
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +68 -11
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +24 -16
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +20 -13
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +20 -13
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +0 -58
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +0 -58
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +30 -15
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +28 -14
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +28 -14
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +35 -14
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +0 -49
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +0 -49
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +28 -13
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +22 -14
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +21 -13
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +31 -14
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +52 -15
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +52 -15
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +21 -12
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +17 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +17 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +45 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +82 -15
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +33 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +21 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +50 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +30 -11
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +0 -240
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +0 -240
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +59 -13
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +59 -13
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +43 -13
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +43 -13
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +53 -16
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +53 -16
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +52 -15
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +52 -15
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +53 -13
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +37 -21
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -2
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +27 -11
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +38 -17
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +38 -17
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +35 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +33 -14
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +30 -15
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +30 -15
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +1 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +40 -17
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +30 -17
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +30 -17
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +32 -19
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +32 -19
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +33 -16
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +28 -14
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +49 -27
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +43 -21
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +30 -13
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +29 -12
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +28 -15
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +28 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +37 -17
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +37 -17
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +27 -14
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +25 -12
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +29 -13
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +29 -13
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +33 -18
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +34 -19
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +0 -452
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +0 -452
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +48 -24
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +37 -23
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +28 -16
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +51 -23
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +36 -16
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +34 -23
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +4 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +28 -16
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +39 -36
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +39 -36
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +28 -16
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +36 -24
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +0 -311
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +0 -311
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +31 -16
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +30 -14
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +33 -15
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +27 -16
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +27 -16
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +1 -1
- package/dist/unstable/observability/index.d.ts +0 -183
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +0 -183
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +4 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +4 -1
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +29 -16
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +27 -14
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +33 -15
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +0 -147
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +0 -147
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +15 -3
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +15 -3
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +0 -45
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +0 -45
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +40 -19
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +40 -19
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +36 -22
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +36 -22
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +32 -16
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +52 -25
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +74 -18
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +74 -18
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +29 -14
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +38 -20
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +38 -20
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +0 -166
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +0 -166
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +29 -18
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +29 -15
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +29 -15
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +29 -18
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +34 -16
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +31 -21
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +31 -21
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +29 -19
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +29 -19
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +33 -23
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +31 -21
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +31 -15
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +31 -15
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +29 -14
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +0 -272
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +0 -272
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +0 -37
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +0 -37
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +0 -44
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +0 -44
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +39 -18
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +31 -15
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +30 -15
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +30 -15
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +34 -14
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +0 -178
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +0 -178
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +29 -15
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +29 -15
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +36 -23
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +34 -21
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +32 -16
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +31 -20
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +31 -20
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +0 -80
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +0 -80
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +23 -11
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +33 -15
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +33 -15
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +0 -160
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +0 -160
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1504 -211
- package/src/BigDecimal.ts +594 -8
- package/src/BigInt.ts +457 -3
- package/src/Boolean.ts +229 -7
- package/src/Brand.ts +100 -8
- package/src/Cache.ts +87 -15
- package/src/Cause.ts +475 -183
- package/src/Channel.ts +498 -84
- package/src/ChannelSchema.ts +96 -3
- package/src/Chunk.ts +120 -0
- package/src/Clock.ts +57 -0
- package/src/Combiner.ts +15 -11
- package/src/Config.ts +126 -40
- package/src/ConfigProvider.ts +48 -25
- package/src/Console.ts +22 -1
- package/src/Context.ts +503 -37
- package/src/Cron.ts +110 -1
- package/src/Crypto.ts +29 -0
- package/src/Data.ts +77 -26
- package/src/DateTime.ts +149 -6
- package/src/Deferred.ts +340 -74
- package/src/Differ.ts +5 -0
- package/src/Duration.ts +164 -11
- package/src/Effect.ts +1860 -543
- package/src/Effectable.ts +14 -0
- package/src/Encoding.ts +135 -1
- package/src/Equal.ts +7 -7
- package/src/Equivalence.ts +44 -27
- package/src/ErrorReporter.ts +123 -5
- package/src/ExecutionPlan.ts +89 -24
- package/src/Exit.ts +128 -82
- package/src/Fiber.ts +317 -68
- package/src/FileSystem.ts +109 -33
- package/src/Filter.ts +221 -2
- package/src/Formatter.ts +3 -3
- package/src/Function.ts +152 -6
- package/src/Graph.ts +275 -3
- package/src/HKT.ts +55 -23
- package/src/Hash.ts +140 -20
- package/src/HashMap.ts +2 -2
- package/src/HashRing.ts +203 -0
- package/src/Inspectable.ts +82 -13
- package/src/Iterable.ts +179 -25
- package/src/JsonPatch.ts +78 -55
- package/src/JsonPointer.ts +2 -2
- package/src/JsonSchema.ts +64 -10
- package/src/Latch.ts +162 -11
- package/src/Layer.ts +250 -74
- package/src/LayerMap.ts +8 -0
- package/src/LogLevel.ts +93 -18
- package/src/Logger.ts +25 -9
- package/src/ManagedRuntime.ts +81 -9
- package/src/Match.ts +220 -24
- package/src/Metric.ts +33 -20
- package/src/MutableHashMap.ts +360 -21
- package/src/MutableHashSet.ts +141 -37
- package/src/MutableList.ts +10 -2
- package/src/MutableRef.ts +136 -0
- package/src/Newtype.ts +20 -11
- package/src/NonEmptyIterable.ts +20 -4
- package/src/Number.ts +417 -2
- package/src/Optic.ts +17 -17
- package/src/Option.ts +168 -129
- package/src/Order.ts +152 -123
- package/src/Ordering.ts +32 -0
- package/src/PartitionedSemaphore.ts +238 -11
- package/src/Path.ts +35 -4
- package/src/Pipeable.ts +27 -2
- package/src/PlatformError.ts +53 -4
- package/src/Pool.ts +174 -32
- package/src/Predicate.ts +149 -115
- package/src/PrimaryKey.ts +74 -8
- package/src/PubSub.ts +94 -20
- package/src/Pull.ts +147 -2
- package/src/Queue.ts +127 -35
- package/src/Random.ts +71 -16
- package/src/RcMap.ts +168 -6
- package/src/RcRef.ts +73 -18
- package/src/Record.ts +95 -1
- package/src/Redactable.ts +20 -16
- package/src/Redacted.ts +82 -4
- package/src/Reducer.ts +17 -5
- package/src/Ref.ts +300 -22
- package/src/References.ts +208 -12
- package/src/RegExp.ts +47 -1
- package/src/Request.ts +215 -32
- package/src/RequestResolver.ts +257 -22
- package/src/Resource.ts +62 -3
- package/src/Result.ts +328 -23
- package/src/Runtime.ts +171 -31
- package/src/Schedule.ts +484 -111
- package/src/Scheduler.ts +50 -1
- package/src/Schema.ts +508 -67
- package/src/SchemaAST.ts +205 -2
- package/src/SchemaGetter.ts +123 -123
- package/src/SchemaIssue.ts +25 -24
- package/src/SchemaParser.ts +279 -21
- package/src/SchemaRepresentation.ts +61 -17
- package/src/SchemaTransformation.ts +76 -38
- package/src/SchemaUtils.ts +38 -11
- package/src/Scope.ts +79 -14
- package/src/ScopedCache.ts +404 -7
- package/src/ScopedRef.ts +67 -5
- package/src/Semaphore.ts +347 -28
- package/src/Sink.ts +307 -4
- package/src/Stdio.ts +69 -15
- package/src/Stream.ts +611 -72
- package/src/String.ts +173 -2
- package/src/Struct.ts +19 -10
- package/src/SubscriptionRef.ts +73 -14
- package/src/Symbol.ts +24 -6
- package/src/SynchronizedRef.ts +502 -2
- package/src/Take.ts +36 -13
- package/src/Terminal.ts +68 -17
- package/src/Tracer.ts +49 -0
- package/src/Trie.ts +48 -9
- package/src/Tuple.ts +70 -35
- package/src/TxChunk.ts +40 -7
- package/src/TxDeferred.ts +85 -2
- package/src/TxPriorityQueue.ts +29 -2
- package/src/TxPubSub.ts +94 -4
- package/src/TxQueue.ts +48 -7
- package/src/TxReentrantLock.ts +40 -4
- package/src/TxRef.ts +112 -7
- package/src/TxSemaphore.ts +173 -14
- package/src/TxSubscriptionRef.ts +205 -2
- package/src/Types.ts +60 -6
- package/src/UndefinedOr.ts +171 -30
- package/src/Unify.ts +120 -12
- package/src/Utils.ts +20 -14
- package/src/index.ts +0 -5205
- package/src/internal/effect.ts +59 -29
- package/src/internal/request.ts +3 -1
- package/src/internal/schema/arbitrary.ts +14 -1
- package/src/internal/schema/representation.ts +37 -14
- package/src/testing/TestConsole.ts +105 -9
- package/src/testing/TestSchema.ts +83 -25
- package/src/testing/index.ts +0 -107
- package/src/unstable/ai/AiError.ts +24 -1
- package/src/unstable/ai/AnthropicStructuredOutput.ts +43 -11
- package/src/unstable/ai/Chat.ts +62 -28
- package/src/unstable/ai/EmbeddingModel.ts +100 -5
- package/src/unstable/ai/IdGenerator.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +41 -2
- package/src/unstable/ai/McpSchema.ts +10 -2
- package/src/unstable/ai/McpServer.ts +59 -1
- package/src/unstable/ai/Model.ts +35 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +48 -1
- package/src/unstable/ai/Prompt.ts +23 -2
- package/src/unstable/ai/Response.ts +71 -13
- package/src/unstable/ai/ResponseIdTracker.ts +34 -12
- package/src/unstable/ai/Telemetry.ts +40 -27
- package/src/unstable/ai/Tokenizer.ts +34 -23
- package/src/unstable/ai/Tool.ts +82 -21
- package/src/unstable/ai/Toolkit.ts +32 -4
- package/src/unstable/ai/index.ts +0 -560
- package/src/unstable/cli/Argument.ts +1 -1
- package/src/unstable/cli/Command.ts +133 -5
- package/src/unstable/cli/Completions.ts +41 -1
- package/src/unstable/cli/Flag.ts +15 -3
- package/src/unstable/cli/GlobalFlag.ts +28 -4
- package/src/unstable/cli/Param.ts +135 -9
- package/src/unstable/cli/Primitive.ts +58 -9
- package/src/unstable/cli/Prompt.ts +26 -1
- package/src/unstable/cli/index.ts +0 -220
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterError.ts +61 -22
- package/src/unstable/cluster/ClusterMetrics.ts +53 -0
- package/src/unstable/cluster/ClusterSchema.ts +76 -24
- package/src/unstable/cluster/Entity.ts +18 -1
- package/src/unstable/cluster/EntityAddress.ts +19 -0
- package/src/unstable/cluster/EntityId.ts +44 -7
- package/src/unstable/cluster/EntityType.ts +19 -0
- package/src/unstable/cluster/HttpRunner.ts +26 -14
- package/src/unstable/cluster/K8sHttpClient.ts +32 -13
- package/src/unstable/cluster/MachineId.ts +35 -9
- package/src/unstable/cluster/Message.ts +1 -1
- package/src/unstable/cluster/MessageStorage.ts +31 -17
- package/src/unstable/cluster/Runner.ts +46 -13
- package/src/unstable/cluster/RunnerAddress.ts +45 -9
- package/src/unstable/cluster/RunnerHealth.ts +30 -13
- package/src/unstable/cluster/RunnerServer.ts +15 -1
- package/src/unstable/cluster/Runners.ts +24 -0
- package/src/unstable/cluster/ShardId.ts +22 -0
- package/src/unstable/cluster/Sharding.ts +55 -17
- package/src/unstable/cluster/ShardingConfig.ts +57 -13
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +26 -12
- package/src/unstable/cluster/SingleRunner.ts +25 -0
- package/src/unstable/cluster/Singleton.ts +51 -9
- package/src/unstable/cluster/SingletonAddress.ts +27 -13
- package/src/unstable/cluster/Snowflake.ts +13 -0
- package/src/unstable/cluster/SocketRunner.ts +21 -0
- package/src/unstable/cluster/SqlMessageStorage.ts +73 -13
- package/src/unstable/cluster/SqlRunnerStorage.ts +20 -0
- package/src/unstable/cluster/TestRunner.ts +27 -16
- package/src/unstable/cluster/index.ts +0 -790
- package/src/unstable/devtools/DevTools.ts +41 -11
- package/src/unstable/devtools/DevToolsClient.ts +68 -11
- package/src/unstable/devtools/DevToolsSchema.ts +24 -16
- package/src/unstable/devtools/DevToolsServer.ts +18 -11
- package/src/unstable/devtools/index.ts +0 -58
- package/src/unstable/encoding/Msgpack.ts +30 -15
- package/src/unstable/encoding/Ndjson.ts +28 -14
- package/src/unstable/encoding/Sse.ts +35 -14
- package/src/unstable/encoding/index.ts +0 -49
- package/src/unstable/eventlog/Event.ts +30 -15
- package/src/unstable/eventlog/EventGroup.ts +22 -14
- package/src/unstable/eventlog/EventJournal.ts +31 -14
- package/src/unstable/eventlog/EventLog.ts +52 -15
- package/src/unstable/eventlog/EventLogMessage.ts +21 -12
- package/src/unstable/eventlog/EventLogServer.ts +27 -13
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +17 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +82 -15
- package/src/unstable/eventlog/EventLogSessionAuth.ts +35 -17
- package/src/unstable/eventlog/SqlEventJournal.ts +50 -14
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +39 -15
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +30 -11
- package/src/unstable/eventlog/index.ts +0 -240
- package/src/unstable/http/Cookies.ts +59 -13
- package/src/unstable/http/Etag.ts +43 -13
- package/src/unstable/http/FetchHttpClient.ts +53 -16
- package/src/unstable/http/Headers.ts +52 -15
- package/src/unstable/http/HttpBody.ts +53 -13
- package/src/unstable/http/HttpClient.ts +88 -22
- package/src/unstable/http/HttpClientError.ts +26 -10
- package/src/unstable/http/HttpClientRequest.ts +36 -15
- package/src/unstable/http/HttpClientResponse.ts +33 -14
- package/src/unstable/http/HttpEffect.ts +32 -15
- package/src/unstable/http/HttpMethod.ts +30 -15
- package/src/unstable/http/HttpRouter.ts +40 -17
- package/src/unstable/http/HttpServer.ts +30 -17
- package/src/unstable/http/HttpServerError.ts +32 -19
- package/src/unstable/http/HttpServerRequest.ts +31 -14
- package/src/unstable/http/HttpServerRespondable.ts +28 -14
- package/src/unstable/http/HttpServerResponse.ts +51 -29
- package/src/unstable/http/HttpStaticServer.ts +29 -12
- package/src/unstable/http/HttpTraceContext.ts +28 -15
- package/src/unstable/http/Multipart.ts +37 -17
- package/src/unstable/http/Template.ts +25 -12
- package/src/unstable/http/Url.ts +29 -13
- package/src/unstable/http/UrlParams.ts +33 -18
- package/src/unstable/http/index.ts +0 -452
- package/src/unstable/httpapi/HttpApi.ts +46 -22
- package/src/unstable/httpapi/HttpApiBuilder.ts +37 -23
- package/src/unstable/httpapi/HttpApiClient.ts +28 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +51 -23
- package/src/unstable/httpapi/HttpApiError.ts +36 -16
- package/src/unstable/httpapi/HttpApiGroup.ts +34 -23
- package/src/unstable/httpapi/HttpApiMiddleware.ts +49 -25
- package/src/unstable/httpapi/HttpApiScalar.ts +32 -17
- package/src/unstable/httpapi/HttpApiSchema.ts +39 -36
- package/src/unstable/httpapi/HttpApiSecurity.ts +54 -24
- package/src/unstable/httpapi/HttpApiSwagger.ts +28 -16
- package/src/unstable/httpapi/OpenApi.ts +38 -26
- package/src/unstable/httpapi/index.ts +0 -311
- package/src/unstable/observability/Otlp.ts +31 -16
- package/src/unstable/observability/OtlpLogger.ts +30 -14
- package/src/unstable/observability/OtlpResource.ts +33 -15
- package/src/unstable/observability/OtlpSerialization.ts +25 -14
- package/src/unstable/observability/PrometheusMetrics.ts +1 -1
- package/src/unstable/observability/index.ts +0 -183
- package/src/unstable/persistence/KeyValueStore.ts +4 -1
- package/src/unstable/persistence/PersistedCache.ts +27 -14
- package/src/unstable/persistence/Redis.ts +33 -15
- package/src/unstable/persistence/index.ts +0 -147
- package/src/unstable/process/ChildProcessSpawner.ts +15 -3
- package/src/unstable/process/index.ts +0 -45
- package/src/unstable/reactivity/AsyncResult.ts +38 -17
- package/src/unstable/reactivity/Atom.ts +36 -22
- package/src/unstable/reactivity/AtomRef.ts +58 -25
- package/src/unstable/reactivity/AtomRegistry.ts +72 -16
- package/src/unstable/reactivity/Hydration.ts +31 -16
- package/src/unstable/reactivity/Reactivity.ts +36 -18
- package/src/unstable/reactivity/index.ts +0 -166
- package/src/unstable/rpc/Rpc.ts +29 -18
- package/src/unstable/rpc/RpcClient.ts +31 -22
- package/src/unstable/rpc/RpcClientError.ts +27 -13
- package/src/unstable/rpc/RpcGroup.ts +28 -17
- package/src/unstable/rpc/RpcMessage.ts +34 -16
- package/src/unstable/rpc/RpcMiddleware.ts +31 -21
- package/src/unstable/rpc/RpcSchema.ts +29 -19
- package/src/unstable/rpc/RpcSerialization.ts +31 -21
- package/src/unstable/rpc/RpcServer.ts +31 -23
- package/src/unstable/rpc/RpcTest.ts +29 -13
- package/src/unstable/rpc/RpcWorker.ts +29 -14
- package/src/unstable/rpc/index.ts +0 -272
- package/src/unstable/schema/index.ts +0 -37
- package/src/unstable/socket/index.ts +0 -44
- package/src/unstable/sql/Migrator.ts +39 -18
- package/src/unstable/sql/SqlError.ts +31 -15
- package/src/unstable/sql/SqlSchema.ts +30 -15
- package/src/unstable/sql/Statement.ts +35 -15
- package/src/unstable/sql/index.ts +0 -178
- package/src/unstable/workers/Transferable.ts +29 -15
- package/src/unstable/workers/Worker.ts +34 -21
- package/src/unstable/workers/WorkerError.ts +34 -18
- package/src/unstable/workers/WorkerRunner.ts +29 -18
- package/src/unstable/workers/index.ts +0 -80
- package/src/unstable/workflow/DurableClock.ts +23 -11
- package/src/unstable/workflow/DurableQueue.ts +31 -13
- package/src/unstable/workflow/index.ts +0 -160
package/dist/Array.js
CHANGED
|
@@ -1,79 +1,82 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* {@link
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* -
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* -
|
|
37
|
-
*
|
|
38
|
-
* -
|
|
39
|
-
*
|
|
40
|
-
* -
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* - {@link
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
2
|
+
* The `Array` module provides functional operations for JavaScript arrays,
|
|
3
|
+
* readonly arrays, and arrays that are known to contain at least one element.
|
|
4
|
+
* Operations that transform, reorder, or update collections allocate new arrays
|
|
5
|
+
* instead of mutating their inputs, while preserving useful type information
|
|
6
|
+
* such as non-emptiness when the operation can prove it.
|
|
7
|
+
*
|
|
8
|
+
* **Mental model**
|
|
9
|
+
*
|
|
10
|
+
* - A regular `Array<A>` is still the built-in JavaScript array type; this
|
|
11
|
+
* module supplies functional constructors, combinators, searches, folds,
|
|
12
|
+
* grouping, sorting, and set-like operations around it.
|
|
13
|
+
* - {@link NonEmptyReadonlyArray} and {@link NonEmptyArray} encode
|
|
14
|
+
* non-emptiness at the type level. APIs with `NonEmpty` in the name can avoid
|
|
15
|
+
* `Option` because an element is guaranteed to exist.
|
|
16
|
+
* - Most functions are dual. You can call them data-first, such as
|
|
17
|
+
* `Array.map(values, f)`, or data-last in a pipeline, such as
|
|
18
|
+
* `pipe(values, Array.map(f))`.
|
|
19
|
+
* - Safe element access returns {@link Option}; unsafe or `NonEmpty` variants
|
|
20
|
+
* are for code that already has a proof an index or element exists.
|
|
21
|
+
* - Set-like operations such as {@link union}, {@link intersection}, and
|
|
22
|
+
* {@link difference} use the {@link Equal} protocol by default. Use the
|
|
23
|
+
* `*With` variants when equality is domain-specific.
|
|
24
|
+
*
|
|
25
|
+
* **Common tasks**
|
|
26
|
+
*
|
|
27
|
+
* - Create arrays with {@link make}, {@link of}, {@link empty},
|
|
28
|
+
* {@link fromIterable}, {@link range}, {@link makeBy}, {@link replicate}, and
|
|
29
|
+
* {@link unfold}.
|
|
30
|
+
* - Access edges or indexes with {@link head}, {@link last}, {@link get},
|
|
31
|
+
* {@link tail}, and {@link init}.
|
|
32
|
+
* - Transform and flatten with {@link map}, {@link flatMap}, and
|
|
33
|
+
* {@link flatten}.
|
|
34
|
+
* - Keep, split, or deduplicate values with {@link filter}, {@link partition},
|
|
35
|
+
* {@link dedupe}, and {@link dedupeAdjacent}.
|
|
36
|
+
* - Combine collections with {@link append}, {@link prepend}, {@link appendAll},
|
|
37
|
+
* {@link prependAll}, {@link zip}, and {@link cartesian}.
|
|
38
|
+
* - Chunk, window, and slice with {@link splitAt}, {@link chunksOf},
|
|
39
|
+
* {@link span}, and {@link window}.
|
|
40
|
+
* - Sort with {@link sort}, {@link sortWith}, and {@link sortBy}.
|
|
41
|
+
* - Fold or aggregate with {@link reduce}, {@link scan}, {@link join}, and
|
|
42
|
+
* {@link countBy}.
|
|
43
|
+
* - Match empty and non-empty cases with {@link match}, {@link matchLeft}, and
|
|
44
|
+
* {@link matchRight}.
|
|
45
|
+
*
|
|
46
|
+
* **Gotchas**
|
|
47
|
+
*
|
|
48
|
+
* - {@link fromIterable} returns the original array reference when the input is
|
|
49
|
+
* already an array. Use {@link copy} when you need a fresh shallow copy.
|
|
50
|
+
* - {@link sort}, {@link reverse}, {@link rotate}, and update operations
|
|
51
|
+
* allocate new arrays; they do not mutate the input.
|
|
52
|
+
* - {@link makeBy}, {@link range}, and {@link replicate} always return
|
|
53
|
+
* non-empty arrays. `range(start, end)` is inclusive and returns `[start]`
|
|
54
|
+
* when `start > end`.
|
|
55
|
+
* - Functions returning {@link Option}, such as {@link head} and
|
|
56
|
+
* {@link findFirst}, return `Option.none()` for empty inputs instead of
|
|
57
|
+
* throwing.
|
|
58
|
+
* - `NonEmpty` return types describe what the function can prove, not what may
|
|
59
|
+
* happen for a particular runtime value after filtering.
|
|
60
|
+
*
|
|
61
|
+
* **Example** (Filtering and transforming)
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { Array, Option, pipe } from "effect"
|
|
65
|
+
*
|
|
66
|
+
* const numbers = [1, 2, 3, 4, 5]
|
|
67
|
+
*
|
|
68
|
+
* const doubledEvens = pipe(
|
|
69
|
+
* numbers,
|
|
70
|
+
* Array.filter((n) => n % 2 === 0),
|
|
71
|
+
* Array.map((n) => n * 2)
|
|
72
|
+
* )
|
|
73
|
+
*
|
|
74
|
+
* console.log(doubledEvens)
|
|
75
|
+
* // [4, 8]
|
|
76
|
+
*
|
|
77
|
+
* const first = Array.head(doubledEvens)
|
|
78
|
+
* console.log(Option.getOrElse(first, () => 0))
|
|
79
|
+
* // 4
|
|
77
80
|
* ```
|
|
78
81
|
*
|
|
79
82
|
* @see {@link make} — create a non-empty array from elements
|
|
@@ -100,7 +103,7 @@ import * as Tuple from "./Tuple.js";
|
|
|
100
103
|
*
|
|
101
104
|
* **When to use**
|
|
102
105
|
*
|
|
103
|
-
* Use
|
|
106
|
+
* Use when you need the native `Array` constructor while the `Array`
|
|
104
107
|
* namespace is in scope (e.g. `Array.Array.isArray`, `Array.Array.from`).
|
|
105
108
|
*
|
|
106
109
|
* **Example** (Using the Array constructor)
|
|
@@ -121,7 +124,7 @@ export const Array = globalThis.Array;
|
|
|
121
124
|
*
|
|
122
125
|
* **When to use**
|
|
123
126
|
*
|
|
124
|
-
*
|
|
127
|
+
* Use when you have literal values and want a typed non-empty array.
|
|
125
128
|
* - The element type is inferred as the union of all arguments.
|
|
126
129
|
* - Always returns a `NonEmptyArray` since at least one argument is required.
|
|
127
130
|
*
|
|
@@ -146,7 +149,7 @@ export const make = (...elements) => elements;
|
|
|
146
149
|
*
|
|
147
150
|
* **When to use**
|
|
148
151
|
*
|
|
149
|
-
*
|
|
152
|
+
* Use when you need a pre-sized array and will fill it imperatively.
|
|
150
153
|
* - Elements are typed as `A | undefined` since slots are empty.
|
|
151
154
|
* - Prefer {@link makeBy} when you can compute each element from its index.
|
|
152
155
|
*
|
|
@@ -170,7 +173,7 @@ export const allocate = n => new Array(n);
|
|
|
170
173
|
*
|
|
171
174
|
* **When to use**
|
|
172
175
|
*
|
|
173
|
-
*
|
|
176
|
+
* Use when you need an array whose values depend on the index.
|
|
174
177
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
175
178
|
* - Dual: `Array.makeBy(5, f)` or `pipe(5, Array.makeBy(f))`.
|
|
176
179
|
*
|
|
@@ -203,7 +206,7 @@ export const makeBy = /*#__PURE__*/dual(2, (n, f) => {
|
|
|
203
206
|
*
|
|
204
207
|
* **When to use**
|
|
205
208
|
*
|
|
206
|
-
*
|
|
209
|
+
* Use when you need a sequence of consecutive integers.
|
|
207
210
|
* - If `start > end`, returns `[start]`.
|
|
208
211
|
* - Always returns a `NonEmptyArray`.
|
|
209
212
|
*
|
|
@@ -227,7 +230,7 @@ export const range = (start, end) => start <= end ? makeBy(end - start + 1, i =>
|
|
|
227
230
|
*
|
|
228
231
|
* **When to use**
|
|
229
232
|
*
|
|
230
|
-
*
|
|
233
|
+
* Use when you need multiple copies of the same value.
|
|
231
234
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
232
235
|
* - Dual: `Array.replicate("a", 3)` or `pipe("a", Array.replicate(3))`.
|
|
233
236
|
*
|
|
@@ -249,6 +252,10 @@ export const replicate = /*#__PURE__*/dual(2, (a, n) => makeBy(n, () => a));
|
|
|
249
252
|
/**
|
|
250
253
|
* Converts an `Iterable` to an `Array`.
|
|
251
254
|
*
|
|
255
|
+
* **When to use**
|
|
256
|
+
*
|
|
257
|
+
* Use to convert any `Iterable` (Set, Generator, etc.) into an array.
|
|
258
|
+
*
|
|
252
259
|
* **Details**
|
|
253
260
|
*
|
|
254
261
|
* - If the input is already an array, returns it **by reference** (no copy).
|
|
@@ -275,6 +282,11 @@ export const fromIterable = collection => Array.isArray(collection) ? collection
|
|
|
275
282
|
/**
|
|
276
283
|
* Normalizes a value that is either a single element or an array into an array.
|
|
277
284
|
*
|
|
285
|
+
* **When to use**
|
|
286
|
+
*
|
|
287
|
+
* Use to normalize input that may be a single value or an array into a consistent
|
|
288
|
+
* array.
|
|
289
|
+
*
|
|
278
290
|
* **Details**
|
|
279
291
|
*
|
|
280
292
|
* - If the input is already an array, returns it by reference.
|
|
@@ -300,6 +312,11 @@ export const ensure = self => Array.isArray(self) ? self : [self];
|
|
|
300
312
|
/**
|
|
301
313
|
* Converts a record into an array of `[key, value]` tuples.
|
|
302
314
|
*
|
|
315
|
+
* **When to use**
|
|
316
|
+
*
|
|
317
|
+
* Use to convert a record into an array of key-value tuples for iteration or
|
|
318
|
+
* transformation.
|
|
319
|
+
*
|
|
303
320
|
* **Details**
|
|
304
321
|
*
|
|
305
322
|
* - Key order follows `Object.entries` semantics.
|
|
@@ -314,6 +331,9 @@ export const ensure = self => Array.isArray(self) ? self : [self];
|
|
|
314
331
|
* console.log(result) // [["a", 1], ["b", 2], ["c", 3]]
|
|
315
332
|
* ```
|
|
316
333
|
*
|
|
334
|
+
* @see {@link Record.toEntries} the equivalent function from the Record module
|
|
335
|
+
* @see {@link Record.fromEntries} to build a record from an array of tuples
|
|
336
|
+
*
|
|
317
337
|
* @category converting
|
|
318
338
|
* @since 2.0.0
|
|
319
339
|
*/
|
|
@@ -321,6 +341,10 @@ export const fromRecord = Record.toEntries;
|
|
|
321
341
|
/**
|
|
322
342
|
* Converts an `Option` to an array: `Some(a)` becomes `[a]`, `None` becomes `[]`.
|
|
323
343
|
*
|
|
344
|
+
* **When to use**
|
|
345
|
+
*
|
|
346
|
+
* Use to convert a single `Option` into an array for downstream array operations.
|
|
347
|
+
*
|
|
324
348
|
* **Example** (Option to array)
|
|
325
349
|
*
|
|
326
350
|
* ```ts
|
|
@@ -341,7 +365,7 @@ export const fromOption = Option.toArray;
|
|
|
341
365
|
*
|
|
342
366
|
* **When to use**
|
|
343
367
|
*
|
|
344
|
-
*
|
|
368
|
+
* Use when you need to branch on whether an array has elements.
|
|
345
369
|
* - `onNonEmpty` receives a `NonEmptyReadonlyArray`.
|
|
346
370
|
* - Dual: data-first or data-last.
|
|
347
371
|
*
|
|
@@ -372,10 +396,14 @@ export const match = /*#__PURE__*/dual(2, (self, {
|
|
|
372
396
|
* Pattern-matches on an array from the left, providing the first element and
|
|
373
397
|
* the remaining elements separately.
|
|
374
398
|
*
|
|
399
|
+
* **When to use**
|
|
400
|
+
*
|
|
401
|
+
* Use to pattern-match when you need the first element and remaining elements as
|
|
402
|
+
* separate values.
|
|
403
|
+
*
|
|
375
404
|
* **Details**
|
|
376
405
|
*
|
|
377
|
-
*
|
|
378
|
-
* - Use when you want to process the first element differently from the rest.
|
|
406
|
+
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
379
407
|
*
|
|
380
408
|
* **Example** (Head and tail destructuring)
|
|
381
409
|
*
|
|
@@ -404,10 +432,14 @@ export const matchLeft = /*#__PURE__*/dual(2, (self, {
|
|
|
404
432
|
* Pattern-matches on an array from the right, providing all elements except the
|
|
405
433
|
* last and the last element separately.
|
|
406
434
|
*
|
|
435
|
+
* **When to use**
|
|
436
|
+
*
|
|
437
|
+
* Use to pattern-match when you need all but the last element and the last element
|
|
438
|
+
* as separate values.
|
|
439
|
+
*
|
|
407
440
|
* **Details**
|
|
408
441
|
*
|
|
409
|
-
*
|
|
410
|
-
* - Use when you want to process the last element differently from the rest.
|
|
442
|
+
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
411
443
|
*
|
|
412
444
|
* **Example** (Init and last destructuring)
|
|
413
445
|
*
|
|
@@ -435,6 +467,10 @@ export const matchRight = /*#__PURE__*/dual(2, (self, {
|
|
|
435
467
|
/**
|
|
436
468
|
* Adds a single element to the front of an iterable, returning a `NonEmptyArray`.
|
|
437
469
|
*
|
|
470
|
+
* **When to use**
|
|
471
|
+
*
|
|
472
|
+
* Use to add a single element at the start of an iterable and get a `NonEmptyArray`.
|
|
473
|
+
*
|
|
438
474
|
* **Details**
|
|
439
475
|
*
|
|
440
476
|
* - Always returns a non-empty array.
|
|
@@ -459,6 +495,10 @@ export const prepend = /*#__PURE__*/dual(2, (self, head) => [head, ...self]);
|
|
|
459
495
|
/**
|
|
460
496
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
461
497
|
*
|
|
498
|
+
* **When to use**
|
|
499
|
+
*
|
|
500
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
501
|
+
*
|
|
462
502
|
* **Details**
|
|
463
503
|
*
|
|
464
504
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -483,6 +523,11 @@ export const prependAll = /*#__PURE__*/dual(2, (self, that) => fromIterable(that
|
|
|
483
523
|
/**
|
|
484
524
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
485
525
|
*
|
|
526
|
+
* **When to use**
|
|
527
|
+
*
|
|
528
|
+
* Use to add one element to the end of an iterable and get a new
|
|
529
|
+
* `NonEmptyArray`.
|
|
530
|
+
*
|
|
486
531
|
* **Details**
|
|
487
532
|
*
|
|
488
533
|
* - Always returns a non-empty array.
|
|
@@ -507,6 +552,11 @@ export const append = /*#__PURE__*/dual(2, (self, last) => [...self, last]);
|
|
|
507
552
|
/**
|
|
508
553
|
* Concatenates two iterables into a single array.
|
|
509
554
|
*
|
|
555
|
+
* **When to use**
|
|
556
|
+
*
|
|
557
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
558
|
+
* elements after the first.
|
|
559
|
+
*
|
|
510
560
|
* **Details**
|
|
511
561
|
*
|
|
512
562
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -531,6 +581,10 @@ export const appendAll = /*#__PURE__*/dual(2, (self, that) => fromIterable(self)
|
|
|
531
581
|
/**
|
|
532
582
|
* Left-to-right fold that keeps every intermediate accumulator value.
|
|
533
583
|
*
|
|
584
|
+
* **When to use**
|
|
585
|
+
*
|
|
586
|
+
* Use to compute a running accumulator where each intermediate value is needed.
|
|
587
|
+
*
|
|
534
588
|
* **Details**
|
|
535
589
|
*
|
|
536
590
|
* - The output length is `input.length + 1` (starts with the initial value).
|
|
@@ -564,6 +618,11 @@ export const scan = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
|
564
618
|
/**
|
|
565
619
|
* Right-to-left fold that keeps every intermediate accumulator value.
|
|
566
620
|
*
|
|
621
|
+
* **When to use**
|
|
622
|
+
*
|
|
623
|
+
* Use to compute a running accumulator from right to left where each intermediate
|
|
624
|
+
* value is needed.
|
|
625
|
+
*
|
|
567
626
|
* **Details**
|
|
568
627
|
*
|
|
569
628
|
* - The output length is `input.length + 1` (ends with the initial value).
|
|
@@ -596,6 +655,10 @@ export const scanRight = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
|
596
655
|
/**
|
|
597
656
|
* Tests whether a value is an `Array`.
|
|
598
657
|
*
|
|
658
|
+
* **When to use**
|
|
659
|
+
*
|
|
660
|
+
* Use to verify a value is a mutable array, narrowing its type to `Array<unknown>`.
|
|
661
|
+
*
|
|
599
662
|
* **Details**
|
|
600
663
|
*
|
|
601
664
|
* - Acts as a type guard narrowing the input to `Array<unknown>`.
|
|
@@ -698,6 +761,10 @@ export const isReadonlyArrayNonEmpty = internalArray.isArrayNonEmpty;
|
|
|
698
761
|
/**
|
|
699
762
|
* Returns the number of elements in a `ReadonlyArray`.
|
|
700
763
|
*
|
|
764
|
+
* **When to use**
|
|
765
|
+
*
|
|
766
|
+
* Use when you need length as a composable function rather than a property access.
|
|
767
|
+
*
|
|
701
768
|
* **Example** (Getting the length)
|
|
702
769
|
*
|
|
703
770
|
* ```ts
|
|
@@ -719,6 +786,11 @@ const clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));
|
|
|
719
786
|
* Safely reads an element at the given index, returning `Option.some` or
|
|
720
787
|
* `Option.none` if the index is out of bounds.
|
|
721
788
|
*
|
|
789
|
+
* **When to use**
|
|
790
|
+
*
|
|
791
|
+
* Use when you need to read an array element by index and handle an
|
|
792
|
+
* out-of-bounds index as `Option.none`.
|
|
793
|
+
*
|
|
722
794
|
* **Details**
|
|
723
795
|
*
|
|
724
796
|
* - The index is floored to an integer.
|
|
@@ -733,9 +805,9 @@ const clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));
|
|
|
733
805
|
* console.log(Array.get([1, 2, 3], 10)) // None
|
|
734
806
|
* ```
|
|
735
807
|
*
|
|
736
|
-
* @see {@link getUnsafe}
|
|
737
|
-
* @see {@link head}
|
|
738
|
-
* @see {@link last}
|
|
808
|
+
* @see {@link getUnsafe} for indexed access that throws when the index is out of bounds
|
|
809
|
+
* @see {@link head} for reading the first element as an `Option`
|
|
810
|
+
* @see {@link last} for reading the last element as an `Option`
|
|
739
811
|
*
|
|
740
812
|
* @category getters
|
|
741
813
|
* @since 2.0.0
|
|
@@ -747,6 +819,11 @@ export const get = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
747
819
|
/**
|
|
748
820
|
* Reads an element at the given index, throwing if the index is out of bounds.
|
|
749
821
|
*
|
|
822
|
+
* **When to use**
|
|
823
|
+
*
|
|
824
|
+
* Use to read an element at a known valid index when out-of-bounds would be a
|
|
825
|
+
* programming error.
|
|
826
|
+
*
|
|
750
827
|
* **Details**
|
|
751
828
|
*
|
|
752
829
|
* - Throws an `Error` with the message `"Index out of bounds: <i>"`.
|
|
@@ -776,6 +853,11 @@ export const getUnsafe = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
776
853
|
/**
|
|
777
854
|
* Splits a non-empty array into its first element and the remaining elements.
|
|
778
855
|
*
|
|
856
|
+
* **When to use**
|
|
857
|
+
*
|
|
858
|
+
* Use when you have a `NonEmptyReadonlyArray` and need both its first element
|
|
859
|
+
* and the remaining elements as separate values.
|
|
860
|
+
*
|
|
779
861
|
* **Details**
|
|
780
862
|
*
|
|
781
863
|
* - Returns a tuple `[head, tail]`.
|
|
@@ -790,9 +872,9 @@ export const getUnsafe = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
790
872
|
* console.log(result) // [1, [2, 3, 4]]
|
|
791
873
|
* ```
|
|
792
874
|
*
|
|
793
|
-
* @see {@link unappend}
|
|
794
|
-
* @see {@link headNonEmpty}
|
|
795
|
-
* @see {@link tailNonEmpty}
|
|
875
|
+
* @see {@link unappend} for splitting a non-empty array into init and last
|
|
876
|
+
* @see {@link headNonEmpty} for getting only the first element
|
|
877
|
+
* @see {@link tailNonEmpty} for getting only the elements after the first
|
|
796
878
|
*
|
|
797
879
|
* @category splitting
|
|
798
880
|
* @since 2.0.0
|
|
@@ -802,6 +884,11 @@ export const unprepend = self => [headNonEmpty(self), tailNonEmpty(self)];
|
|
|
802
884
|
* Splits a non-empty array into all elements except the last, and the last
|
|
803
885
|
* element.
|
|
804
886
|
*
|
|
887
|
+
* **When to use**
|
|
888
|
+
*
|
|
889
|
+
* Use to split a non-empty array from the end when you need both the elements
|
|
890
|
+
* before the last element and the last element.
|
|
891
|
+
*
|
|
805
892
|
* **Details**
|
|
806
893
|
*
|
|
807
894
|
* - Returns a tuple `[init, last]`.
|
|
@@ -816,9 +903,9 @@ export const unprepend = self => [headNonEmpty(self), tailNonEmpty(self)];
|
|
|
816
903
|
* console.log(result) // [[1, 2, 3], 4]
|
|
817
904
|
* ```
|
|
818
905
|
*
|
|
819
|
-
* @see {@link unprepend}
|
|
820
|
-
* @see {@link initNonEmpty}
|
|
821
|
-
* @see {@link lastNonEmpty}
|
|
906
|
+
* @see {@link unprepend} for splitting a non-empty array into head and tail
|
|
907
|
+
* @see {@link initNonEmpty} for getting only the elements before the last
|
|
908
|
+
* @see {@link lastNonEmpty} for getting only the last element
|
|
822
909
|
*
|
|
823
910
|
* @category splitting
|
|
824
911
|
* @since 2.0.0
|
|
@@ -828,6 +915,10 @@ export const unappend = self => [initNonEmpty(self), lastNonEmpty(self)];
|
|
|
828
915
|
* Returns the first element of an array wrapped in `Option.some`, or
|
|
829
916
|
* `Option.none` if the array is empty.
|
|
830
917
|
*
|
|
918
|
+
* **When to use**
|
|
919
|
+
*
|
|
920
|
+
* Use to safely get the first element of an array that may be empty.
|
|
921
|
+
*
|
|
831
922
|
* **Example** (Getting the first element)
|
|
832
923
|
*
|
|
833
924
|
* ```ts
|
|
@@ -848,6 +939,11 @@ export const head = /*#__PURE__*/get(0);
|
|
|
848
939
|
* Returns the first element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
849
940
|
* wrapper).
|
|
850
941
|
*
|
|
942
|
+
* **When to use**
|
|
943
|
+
*
|
|
944
|
+
* Use to get the first element without `Option` wrapping when the array is known
|
|
945
|
+
* to be non-empty.
|
|
946
|
+
*
|
|
851
947
|
* **Example** (Getting the head of a non-empty array)
|
|
852
948
|
*
|
|
853
949
|
* ```ts
|
|
@@ -866,6 +962,10 @@ export const headNonEmpty = /*#__PURE__*/getUnsafe(0);
|
|
|
866
962
|
* Returns the last element of an array wrapped in `Option.some`, or
|
|
867
963
|
* `Option.none` if the array is empty.
|
|
868
964
|
*
|
|
965
|
+
* **When to use**
|
|
966
|
+
*
|
|
967
|
+
* Use to safely get the last element of an array that may be empty.
|
|
968
|
+
*
|
|
869
969
|
* **Example** (Getting the last element)
|
|
870
970
|
*
|
|
871
971
|
* ```ts
|
|
@@ -886,6 +986,11 @@ export const last = self => isReadonlyArrayNonEmpty(self) ? Option.some(lastNonE
|
|
|
886
986
|
* Returns the last element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
887
987
|
* wrapper).
|
|
888
988
|
*
|
|
989
|
+
* **When to use**
|
|
990
|
+
*
|
|
991
|
+
* Use to get the last element without `Option` wrapping when the array is known
|
|
992
|
+
* to be non-empty.
|
|
993
|
+
*
|
|
889
994
|
* **Example** (Getting the last of a non-empty array)
|
|
890
995
|
*
|
|
891
996
|
* ```ts
|
|
@@ -903,6 +1008,10 @@ export const lastNonEmpty = self => self[self.length - 1];
|
|
|
903
1008
|
/**
|
|
904
1009
|
* Returns all elements except the first, wrapped in an `Option`.
|
|
905
1010
|
*
|
|
1011
|
+
* **When to use**
|
|
1012
|
+
*
|
|
1013
|
+
* Use to safely get all elements after the first when the iterable may be empty.
|
|
1014
|
+
*
|
|
906
1015
|
* **Details**
|
|
907
1016
|
*
|
|
908
1017
|
* - Allocates a new array via `slice(1)`.
|
|
@@ -930,6 +1039,10 @@ export function tail(self) {
|
|
|
930
1039
|
/**
|
|
931
1040
|
* Returns all elements except the first of a `NonEmptyReadonlyArray`.
|
|
932
1041
|
*
|
|
1042
|
+
* **When to use**
|
|
1043
|
+
*
|
|
1044
|
+
* Use to get all elements after the first when the array is known to be non-empty.
|
|
1045
|
+
*
|
|
933
1046
|
* **Example** (Getting the tail of a non-empty array)
|
|
934
1047
|
*
|
|
935
1048
|
* ```ts
|
|
@@ -948,6 +1061,10 @@ export const tailNonEmpty = self => self.slice(1);
|
|
|
948
1061
|
/**
|
|
949
1062
|
* Returns all elements except the last, wrapped in an `Option`.
|
|
950
1063
|
*
|
|
1064
|
+
* **When to use**
|
|
1065
|
+
*
|
|
1066
|
+
* Use to safely get all elements before the last when the iterable may be empty.
|
|
1067
|
+
*
|
|
951
1068
|
* **Details**
|
|
952
1069
|
*
|
|
953
1070
|
* - Allocates a new array via `slice(0, -1)`.
|
|
@@ -975,6 +1092,10 @@ export function init(self) {
|
|
|
975
1092
|
/**
|
|
976
1093
|
* Returns all elements except the last of a `NonEmptyReadonlyArray`.
|
|
977
1094
|
*
|
|
1095
|
+
* **When to use**
|
|
1096
|
+
*
|
|
1097
|
+
* Use to get all elements before the last when the array is known to be non-empty.
|
|
1098
|
+
*
|
|
978
1099
|
* **Example** (Getting init of a non-empty array)
|
|
979
1100
|
*
|
|
980
1101
|
* ```ts
|
|
@@ -993,6 +1114,10 @@ export const initNonEmpty = self => self.slice(0, -1);
|
|
|
993
1114
|
/**
|
|
994
1115
|
* Keeps the first `n` elements, creating a new array.
|
|
995
1116
|
*
|
|
1117
|
+
* **When to use**
|
|
1118
|
+
*
|
|
1119
|
+
* Use to keep up to the first `n` elements from an iterable as a new array.
|
|
1120
|
+
*
|
|
996
1121
|
* **Details**
|
|
997
1122
|
*
|
|
998
1123
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1006,9 +1131,9 @@ export const initNonEmpty = self => self.slice(0, -1);
|
|
|
1006
1131
|
* console.log(Array.take([1, 2, 3, 4, 5], 3)) // [1, 2, 3]
|
|
1007
1132
|
* ```
|
|
1008
1133
|
*
|
|
1009
|
-
* @see {@link takeRight}
|
|
1010
|
-
* @see {@link takeWhile}
|
|
1011
|
-
* @see {@link drop}
|
|
1134
|
+
* @see {@link takeRight} for keeping elements from the end
|
|
1135
|
+
* @see {@link takeWhile} for keeping an initial prefix while a predicate holds
|
|
1136
|
+
* @see {@link drop} for removing elements from the start
|
|
1012
1137
|
*
|
|
1013
1138
|
* @category getters
|
|
1014
1139
|
* @since 2.0.0
|
|
@@ -1020,6 +1145,10 @@ export const take = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1020
1145
|
/**
|
|
1021
1146
|
* Keeps the last `n` elements, creating a new array.
|
|
1022
1147
|
*
|
|
1148
|
+
* **When to use**
|
|
1149
|
+
*
|
|
1150
|
+
* Use to keep the last `n` elements of an iterable.
|
|
1151
|
+
*
|
|
1023
1152
|
* **Details**
|
|
1024
1153
|
*
|
|
1025
1154
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1048,6 +1177,11 @@ export const takeRight = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1048
1177
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1049
1178
|
* first element that fails.
|
|
1050
1179
|
*
|
|
1180
|
+
* **When to use**
|
|
1181
|
+
*
|
|
1182
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
1183
|
+
* a predicate, returning the retained prefix as an array.
|
|
1184
|
+
*
|
|
1051
1185
|
* **Details**
|
|
1052
1186
|
*
|
|
1053
1187
|
* - Supports refinements for type narrowing.
|
|
@@ -1061,9 +1195,9 @@ export const takeRight = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1061
1195
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
1062
1196
|
* ```
|
|
1063
1197
|
*
|
|
1064
|
-
* @see {@link take}
|
|
1065
|
-
* @see {@link dropWhile}
|
|
1066
|
-
* @see {@link span}
|
|
1198
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
1199
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
1200
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
1067
1201
|
*
|
|
1068
1202
|
* @category getters
|
|
1069
1203
|
* @since 2.0.0
|
|
@@ -1083,11 +1217,19 @@ export const takeWhile = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1083
1217
|
/**
|
|
1084
1218
|
* Takes elements from the start while a `Filter` succeeds, collecting transformed values.
|
|
1085
1219
|
*
|
|
1220
|
+
* **When to use**
|
|
1221
|
+
*
|
|
1222
|
+
* Use when you need to take a prefix of elements while a function can
|
|
1223
|
+
* successfully extract or transform them, stopping at the first element
|
|
1224
|
+
* that produces a failure result.
|
|
1225
|
+
*
|
|
1086
1226
|
* **Details**
|
|
1087
1227
|
*
|
|
1088
1228
|
* - The filter receives `(element, index)`.
|
|
1089
1229
|
* - Stops at the first filter failure.
|
|
1090
1230
|
*
|
|
1231
|
+
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
1232
|
+
*
|
|
1091
1233
|
* @category getters
|
|
1092
1234
|
* @since 4.0.0
|
|
1093
1235
|
*/
|
|
@@ -1118,6 +1260,11 @@ const spanIndex = (self, predicate) => {
|
|
|
1118
1260
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
1119
1261
|
* holds, and the remaining elements.
|
|
1120
1262
|
*
|
|
1263
|
+
* **When to use**
|
|
1264
|
+
*
|
|
1265
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
1266
|
+
* and the elements after that prefix when you need both parts.
|
|
1267
|
+
*
|
|
1121
1268
|
* **Details**
|
|
1122
1269
|
*
|
|
1123
1270
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -1132,9 +1279,9 @@ const spanIndex = (self, predicate) => {
|
|
|
1132
1279
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
1133
1280
|
* ```
|
|
1134
1281
|
*
|
|
1135
|
-
* @see {@link takeWhile}
|
|
1136
|
-
* @see {@link dropWhile}
|
|
1137
|
-
* @see {@link splitWhere}
|
|
1282
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
1283
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
1284
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
1138
1285
|
*
|
|
1139
1286
|
* @category splitting
|
|
1140
1287
|
* @since 2.0.0
|
|
@@ -1146,6 +1293,11 @@ export const span = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1146
1293
|
/**
|
|
1147
1294
|
* Removes the first `n` elements, creating a new array.
|
|
1148
1295
|
*
|
|
1296
|
+
* **When to use**
|
|
1297
|
+
*
|
|
1298
|
+
* Use to keep the suffix of an iterable after skipping a fixed number of
|
|
1299
|
+
* leading elements.
|
|
1300
|
+
*
|
|
1149
1301
|
* **Details**
|
|
1150
1302
|
*
|
|
1151
1303
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1159,9 +1311,9 @@ export const span = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1159
1311
|
* console.log(Array.drop([1, 2, 3, 4, 5], 2)) // [3, 4, 5]
|
|
1160
1312
|
* ```
|
|
1161
1313
|
*
|
|
1162
|
-
* @see {@link dropRight}
|
|
1163
|
-
* @see {@link dropWhile}
|
|
1164
|
-
* @see {@link take}
|
|
1314
|
+
* @see {@link dropRight} for removing a fixed number of elements from the end
|
|
1315
|
+
* @see {@link dropWhile} for removing a prefix based on a predicate instead of a fixed count
|
|
1316
|
+
* @see {@link take} for keeping a fixed number of elements from the start
|
|
1165
1317
|
*
|
|
1166
1318
|
* @category getters
|
|
1167
1319
|
* @since 2.0.0
|
|
@@ -1173,9 +1325,13 @@ export const drop = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1173
1325
|
/**
|
|
1174
1326
|
* Removes the last `n` elements, creating a new array.
|
|
1175
1327
|
*
|
|
1328
|
+
* **When to use**
|
|
1329
|
+
*
|
|
1330
|
+
* Use to remove the last `n` elements from an iterable.
|
|
1331
|
+
*
|
|
1176
1332
|
* **Details**
|
|
1177
1333
|
*
|
|
1178
|
-
*
|
|
1334
|
+
* `n` is clamped to `[0, length]`.
|
|
1179
1335
|
*
|
|
1180
1336
|
* **Example** (Dropping from the end)
|
|
1181
1337
|
*
|
|
@@ -1198,9 +1354,13 @@ export const dropRight = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1198
1354
|
/**
|
|
1199
1355
|
* Drops elements from the start while the predicate holds, returning the rest.
|
|
1200
1356
|
*
|
|
1357
|
+
* **When to use**
|
|
1358
|
+
*
|
|
1359
|
+
* Use to remove a leading prefix of elements that satisfy a predicate.
|
|
1360
|
+
*
|
|
1201
1361
|
* **Details**
|
|
1202
1362
|
*
|
|
1203
|
-
*
|
|
1363
|
+
* The predicate receives `(element, index)`.
|
|
1204
1364
|
*
|
|
1205
1365
|
* **Example** (Dropping while condition holds)
|
|
1206
1366
|
*
|
|
@@ -1230,11 +1390,19 @@ export const dropWhile = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1230
1390
|
/**
|
|
1231
1391
|
* Drops elements from the start while a `Filter` succeeds.
|
|
1232
1392
|
*
|
|
1393
|
+
* **When to use**
|
|
1394
|
+
*
|
|
1395
|
+
* Use when dropping a prefix requires computing a `Result` per element instead
|
|
1396
|
+
* of a simple boolean predicate.
|
|
1397
|
+
*
|
|
1233
1398
|
* **Details**
|
|
1234
1399
|
*
|
|
1235
1400
|
* - The filter receives `(element, index)`.
|
|
1236
1401
|
* - Returns the remaining original elements after the first filter failure.
|
|
1237
1402
|
*
|
|
1403
|
+
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
1404
|
+
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
1405
|
+
*
|
|
1238
1406
|
* @category getters
|
|
1239
1407
|
* @since 4.0.0
|
|
1240
1408
|
*/
|
|
@@ -1253,6 +1421,11 @@ export const dropWhileFilter = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1253
1421
|
* Returns the index of the first element matching the predicate, wrapped in an
|
|
1254
1422
|
* `Option`.
|
|
1255
1423
|
*
|
|
1424
|
+
* **When to use**
|
|
1425
|
+
*
|
|
1426
|
+
* Use to find the index of the first matching element from the start of an
|
|
1427
|
+
* iterable.
|
|
1428
|
+
*
|
|
1256
1429
|
* **Example** (Finding an index)
|
|
1257
1430
|
*
|
|
1258
1431
|
* ```ts
|
|
@@ -1281,6 +1454,10 @@ export const findFirstIndex = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1281
1454
|
* Returns the index of the last element matching the predicate, wrapped in an
|
|
1282
1455
|
* `Option`.
|
|
1283
1456
|
*
|
|
1457
|
+
* **When to use**
|
|
1458
|
+
*
|
|
1459
|
+
* Use to find the index of the last matching element from the end of an array.
|
|
1460
|
+
*
|
|
1284
1461
|
* **Example** (Finding the last matching index)
|
|
1285
1462
|
*
|
|
1286
1463
|
* ```ts
|
|
@@ -1308,6 +1485,11 @@ export const findLastIndex = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1308
1485
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
1309
1486
|
* function, wrapped in `Option`.
|
|
1310
1487
|
*
|
|
1488
|
+
* **When to use**
|
|
1489
|
+
*
|
|
1490
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
1491
|
+
* element or mapped value as an `Option`.
|
|
1492
|
+
*
|
|
1311
1493
|
* **Details**
|
|
1312
1494
|
*
|
|
1313
1495
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -1334,6 +1516,10 @@ export const findFirst = moduleIterable.findFirst;
|
|
|
1334
1516
|
* Returns the first selected value together with its index, wrapped in an
|
|
1335
1517
|
* `Option`.
|
|
1336
1518
|
*
|
|
1519
|
+
* **When to use**
|
|
1520
|
+
*
|
|
1521
|
+
* Use to find both the first matching element and its index in one pass.
|
|
1522
|
+
*
|
|
1337
1523
|
* **Details**
|
|
1338
1524
|
*
|
|
1339
1525
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -1375,6 +1561,10 @@ export const findFirstWithIndex = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1375
1561
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
1376
1562
|
* function, wrapped in `Option`.
|
|
1377
1563
|
*
|
|
1564
|
+
* **When to use**
|
|
1565
|
+
*
|
|
1566
|
+
* Use to find the last matching element from the end of an array.
|
|
1567
|
+
*
|
|
1378
1568
|
* **Details**
|
|
1379
1569
|
*
|
|
1380
1570
|
* - Searches from the end of the array.
|
|
@@ -1415,6 +1605,10 @@ export const findLast = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1415
1605
|
* Inserts an element at the specified index, returning a new `NonEmptyArray`
|
|
1416
1606
|
* wrapped in an `Option`.
|
|
1417
1607
|
*
|
|
1608
|
+
* **When to use**
|
|
1609
|
+
*
|
|
1610
|
+
* Use to insert a single element at a specific position in an array.
|
|
1611
|
+
*
|
|
1418
1612
|
* **Details**
|
|
1419
1613
|
*
|
|
1420
1614
|
* - Valid indices: `0` to `length` (inclusive — inserting at `length` appends).
|
|
@@ -1446,6 +1640,10 @@ export const insertAt = /*#__PURE__*/dual(3, (self, i, b) => {
|
|
|
1446
1640
|
* Replaces the element at the specified index with a new value, returning the
|
|
1447
1641
|
* updated array in `Option.some`.
|
|
1448
1642
|
*
|
|
1643
|
+
* **When to use**
|
|
1644
|
+
*
|
|
1645
|
+
* Use to set a fixed replacement value at a specific index.
|
|
1646
|
+
*
|
|
1449
1647
|
* **Details**
|
|
1450
1648
|
*
|
|
1451
1649
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -1470,6 +1668,11 @@ export const replace = /*#__PURE__*/dual(3, (self, i, b) => modify(self, i, () =
|
|
|
1470
1668
|
* Applies a function to the element at the specified index, returning the
|
|
1471
1669
|
* updated array in `Option.some`.
|
|
1472
1670
|
*
|
|
1671
|
+
* **When to use**
|
|
1672
|
+
*
|
|
1673
|
+
* Use to derive a replacement value from the current element at a specific
|
|
1674
|
+
* index while leaving the other elements unchanged.
|
|
1675
|
+
*
|
|
1473
1676
|
* **Details**
|
|
1474
1677
|
*
|
|
1475
1678
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -1505,9 +1708,13 @@ export const modify = /*#__PURE__*/dual(3, (self, i, f) => {
|
|
|
1505
1708
|
* Removes the element at the specified index, returning a new array. If the
|
|
1506
1709
|
* index is out of bounds, returns a copy of the original.
|
|
1507
1710
|
*
|
|
1711
|
+
* **When to use**
|
|
1712
|
+
*
|
|
1713
|
+
* Use to remove a single element at a known index.
|
|
1714
|
+
*
|
|
1508
1715
|
* **Details**
|
|
1509
1716
|
*
|
|
1510
|
-
*
|
|
1717
|
+
* Does not mutate the input.
|
|
1511
1718
|
*
|
|
1512
1719
|
* **Example** (Removing an element)
|
|
1513
1720
|
*
|
|
@@ -1535,6 +1742,10 @@ export const remove = /*#__PURE__*/dual(2, (self, i) => {
|
|
|
1535
1742
|
/**
|
|
1536
1743
|
* Reverses an iterable into a new array.
|
|
1537
1744
|
*
|
|
1745
|
+
* **When to use**
|
|
1746
|
+
*
|
|
1747
|
+
* Use to reverse the order of elements without mutating the original input.
|
|
1748
|
+
*
|
|
1538
1749
|
* **Details**
|
|
1539
1750
|
*
|
|
1540
1751
|
* - Does not mutate the input.
|
|
@@ -1555,6 +1766,10 @@ export const reverse = self => Array.from(self).reverse();
|
|
|
1555
1766
|
/**
|
|
1556
1767
|
* Sorts an array by the given `Order`, returning a new array.
|
|
1557
1768
|
*
|
|
1769
|
+
* **When to use**
|
|
1770
|
+
*
|
|
1771
|
+
* Use to sort an array using a single `Order` comparator.
|
|
1772
|
+
*
|
|
1558
1773
|
* **Details**
|
|
1559
1774
|
*
|
|
1560
1775
|
* - Does not mutate the input.
|
|
@@ -1585,6 +1800,11 @@ export const sort = /*#__PURE__*/dual(2, (self, O) => {
|
|
|
1585
1800
|
* Sorts an array by a derived key using a mapping function and an `Order` for
|
|
1586
1801
|
* that key.
|
|
1587
1802
|
*
|
|
1803
|
+
* **When to use**
|
|
1804
|
+
*
|
|
1805
|
+
* Use when values need to be sorted by a derived key, such as a string length
|
|
1806
|
+
* or object field, while the output should keep the original values.
|
|
1807
|
+
*
|
|
1588
1808
|
* **Details**
|
|
1589
1809
|
*
|
|
1590
1810
|
* - Equivalent to `sort(Order.mapInput(order, f))` but more convenient.
|
|
@@ -1599,8 +1819,8 @@ export const sort = /*#__PURE__*/dual(2, (self, O) => {
|
|
|
1599
1819
|
* // ["b", "cc", "aaa"]
|
|
1600
1820
|
* ```
|
|
1601
1821
|
*
|
|
1602
|
-
* @see {@link sort}
|
|
1603
|
-
* @see {@link sortBy}
|
|
1822
|
+
* @see {@link sort} for sorting with an `Order` that compares the elements directly
|
|
1823
|
+
* @see {@link sortBy} for sorting with multiple `Order`s applied in sequence
|
|
1604
1824
|
*
|
|
1605
1825
|
* @category elements
|
|
1606
1826
|
* @since 2.0.0
|
|
@@ -1610,6 +1830,11 @@ export const sortWith = /*#__PURE__*/dual(3, (self, f, order) => Array.from(self
|
|
|
1610
1830
|
* Sorts an array by multiple `Order`s applied in sequence: the first order is
|
|
1611
1831
|
* used first; ties are broken by the second order, and so on.
|
|
1612
1832
|
*
|
|
1833
|
+
* **When to use**
|
|
1834
|
+
*
|
|
1835
|
+
* Use to sort by multiple criteria where later orders break ties from earlier
|
|
1836
|
+
* ones.
|
|
1837
|
+
*
|
|
1613
1838
|
* **Details**
|
|
1614
1839
|
*
|
|
1615
1840
|
* - Data-last only (returns a function).
|
|
@@ -1657,6 +1882,10 @@ export const sortBy = (...orders) => {
|
|
|
1657
1882
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
1658
1883
|
* length, the extra elements from the longer one are discarded.
|
|
1659
1884
|
*
|
|
1885
|
+
* **When to use**
|
|
1886
|
+
*
|
|
1887
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
1888
|
+
*
|
|
1660
1889
|
* **Details**
|
|
1661
1890
|
*
|
|
1662
1891
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -1738,6 +1967,10 @@ export const unzip = self => {
|
|
|
1738
1967
|
/**
|
|
1739
1968
|
* Places a separator element between every pair of elements.
|
|
1740
1969
|
*
|
|
1970
|
+
* **When to use**
|
|
1971
|
+
*
|
|
1972
|
+
* Use to insert a separator between elements, for example when preparing data for display or concatenation.
|
|
1973
|
+
*
|
|
1741
1974
|
* **Details**
|
|
1742
1975
|
*
|
|
1743
1976
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -1775,6 +2008,10 @@ export const intersperse = /*#__PURE__*/dual(2, (self, middle) => {
|
|
|
1775
2008
|
* Applies a function to the first element of a non-empty array, returning a
|
|
1776
2009
|
* new array.
|
|
1777
2010
|
*
|
|
2011
|
+
* **When to use**
|
|
2012
|
+
*
|
|
2013
|
+
* Use to transform the first element of a non-empty array while preserving the rest.
|
|
2014
|
+
*
|
|
1778
2015
|
* **Example** (Modifying the head)
|
|
1779
2016
|
*
|
|
1780
2017
|
* ```ts
|
|
@@ -1849,6 +2086,11 @@ export const setLastNonEmpty = /*#__PURE__*/dual(2, (self, b) => modifyLastNonEm
|
|
|
1849
2086
|
* Rotates an array by `n` steps. Positive `n` rotates right; negative `n`
|
|
1850
2087
|
* rotates left.
|
|
1851
2088
|
*
|
|
2089
|
+
* **When to use**
|
|
2090
|
+
*
|
|
2091
|
+
* Use when elements should wrap around the end of the array rather than being
|
|
2092
|
+
* dropped.
|
|
2093
|
+
*
|
|
1852
2094
|
* **Details**
|
|
1853
2095
|
*
|
|
1854
2096
|
* - `n` is rounded to the nearest integer before rotating.
|
|
@@ -1863,6 +2105,9 @@ export const setLastNonEmpty = /*#__PURE__*/dual(2, (self, b) => modifyLastNonEm
|
|
|
1863
2105
|
* console.log(Array.rotate(["a", "b", "c", "d"], 2)) // ["c", "d", "a", "b"]
|
|
1864
2106
|
* ```
|
|
1865
2107
|
*
|
|
2108
|
+
* @see {@link take} for taking a fixed number of elements from the start
|
|
2109
|
+
* @see {@link drop} for dropping a fixed number of elements from the start
|
|
2110
|
+
*
|
|
1866
2111
|
* @category elements
|
|
1867
2112
|
* @since 2.0.0
|
|
1868
2113
|
*/
|
|
@@ -1886,6 +2131,11 @@ export const rotate = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1886
2131
|
/**
|
|
1887
2132
|
* Returns a membership-test function using a custom equivalence.
|
|
1888
2133
|
*
|
|
2134
|
+
* **When to use**
|
|
2135
|
+
*
|
|
2136
|
+
* Use when checking membership with caller-provided equality instead of
|
|
2137
|
+
* `Equal.equivalence()`.
|
|
2138
|
+
*
|
|
1889
2139
|
* **Example** (Custom equality check)
|
|
1890
2140
|
*
|
|
1891
2141
|
* ```ts
|
|
@@ -1895,7 +2145,7 @@ export const rotate = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1895
2145
|
* console.log(pipe([1, 2, 3, 4], containsNumber(3))) // true
|
|
1896
2146
|
* ```
|
|
1897
2147
|
*
|
|
1898
|
-
* @see {@link contains}
|
|
2148
|
+
* @see {@link contains} for the `Equal.equivalence()` variant
|
|
1899
2149
|
*
|
|
1900
2150
|
* @category elements
|
|
1901
2151
|
* @since 2.0.0
|
|
@@ -1912,6 +2162,11 @@ export const containsWith = isEquivalent => dual(2, (self, a) => {
|
|
|
1912
2162
|
* Tests whether an array contains a value, using `Equal.equivalence()` for
|
|
1913
2163
|
* comparison.
|
|
1914
2164
|
*
|
|
2165
|
+
* **When to use**
|
|
2166
|
+
*
|
|
2167
|
+
* Use to check membership with Effect's default equality instead of providing a
|
|
2168
|
+
* comparison function.
|
|
2169
|
+
*
|
|
1915
2170
|
* **Example** (Checking membership)
|
|
1916
2171
|
*
|
|
1917
2172
|
* ```ts
|
|
@@ -1930,6 +2185,11 @@ export const contains = /*#__PURE__*/containsWith(/*#__PURE__*/Equal.asEquivalen
|
|
|
1930
2185
|
* Repeatedly applies a function that consumes a prefix of the array and
|
|
1931
2186
|
* produces a value plus the remaining elements, collecting the values.
|
|
1932
2187
|
*
|
|
2188
|
+
* **When to use**
|
|
2189
|
+
*
|
|
2190
|
+
* Use when the grouping logic is custom and each step needs to return both a
|
|
2191
|
+
* value and the remaining input.
|
|
2192
|
+
*
|
|
1933
2193
|
* **Details**
|
|
1934
2194
|
*
|
|
1935
2195
|
* - The function receives a `NonEmptyReadonlyArray` and returns
|
|
@@ -1973,6 +2233,10 @@ export const chop = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1973
2233
|
/**
|
|
1974
2234
|
* Splits an iterable into two arrays at the given index.
|
|
1975
2235
|
*
|
|
2236
|
+
* **When to use**
|
|
2237
|
+
*
|
|
2238
|
+
* Use to divide an array into a prefix and suffix at a specific position.
|
|
2239
|
+
*
|
|
1976
2240
|
* **Details**
|
|
1977
2241
|
*
|
|
1978
2242
|
* - `n` can be `0` (all elements in the second array).
|
|
@@ -2028,6 +2292,10 @@ export const splitAtNonEmpty = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2028
2292
|
/**
|
|
2029
2293
|
* Splits an iterable into `n` roughly equal-sized chunks.
|
|
2030
2294
|
*
|
|
2295
|
+
* **When to use**
|
|
2296
|
+
*
|
|
2297
|
+
* Use to distribute elements across a fixed number of groups, such as when splitting work across threads.
|
|
2298
|
+
*
|
|
2031
2299
|
* **Details**
|
|
2032
2300
|
*
|
|
2033
2301
|
* - Uses `chunksOf(ceil(length / n))` internally.
|
|
@@ -2054,6 +2322,10 @@ export const split = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2054
2322
|
* Splits an iterable at the first element matching the predicate. The matching
|
|
2055
2323
|
* element is included in the second array.
|
|
2056
2324
|
*
|
|
2325
|
+
* **When to use**
|
|
2326
|
+
*
|
|
2327
|
+
* Use to split an array at a condition boundary when you know which element marks the transition point.
|
|
2328
|
+
*
|
|
2057
2329
|
* **Example** (Splitting at a condition)
|
|
2058
2330
|
*
|
|
2059
2331
|
* ```ts
|
|
@@ -2072,6 +2344,11 @@ export const splitWhere = /*#__PURE__*/dual(2, (self, predicate) => span(self, (
|
|
|
2072
2344
|
/**
|
|
2073
2345
|
* Creates a shallow copy of an array.
|
|
2074
2346
|
*
|
|
2347
|
+
* **When to use**
|
|
2348
|
+
*
|
|
2349
|
+
* Use to create a distinct array reference for an existing array, for example
|
|
2350
|
+
* before mutating the returned array.
|
|
2351
|
+
*
|
|
2075
2352
|
* **Details**
|
|
2076
2353
|
*
|
|
2077
2354
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -2098,6 +2375,10 @@ export const copy = self => self.slice();
|
|
|
2098
2375
|
* Pads or truncates an array to exactly `n` elements, filling with `fill`
|
|
2099
2376
|
* if the array is shorter, or slicing if longer.
|
|
2100
2377
|
*
|
|
2378
|
+
* **When to use**
|
|
2379
|
+
*
|
|
2380
|
+
* Use to ensure an array has a specific length, padding with a fill value or truncating as needed.
|
|
2381
|
+
*
|
|
2101
2382
|
* **Details**
|
|
2102
2383
|
*
|
|
2103
2384
|
* - Returns an empty array when `n <= 0`.
|
|
@@ -2126,6 +2407,11 @@ export const pad = /*#__PURE__*/dual(3, (self, n, fill) => {
|
|
|
2126
2407
|
* Splits an iterable into chunks of length `n`. The last chunk may be shorter
|
|
2127
2408
|
* if `n` does not evenly divide the length.
|
|
2128
2409
|
*
|
|
2410
|
+
* **When to use**
|
|
2411
|
+
*
|
|
2412
|
+
* Use to divide an iterable into non-overlapping chunks with a maximum chunk
|
|
2413
|
+
* size.
|
|
2414
|
+
*
|
|
2129
2415
|
* **Details**
|
|
2130
2416
|
*
|
|
2131
2417
|
* - `chunksOf(n)([])` is `[]`, not `[[]]`.
|
|
@@ -2156,6 +2442,10 @@ export const chunksOf = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2156
2442
|
/**
|
|
2157
2443
|
* Creates overlapping sliding windows of size `n`.
|
|
2158
2444
|
*
|
|
2445
|
+
* **When to use**
|
|
2446
|
+
*
|
|
2447
|
+
* Use to process sequences with a moving window, such as for computing running averages or detecting patterns.
|
|
2448
|
+
*
|
|
2159
2449
|
* **Details**
|
|
2160
2450
|
*
|
|
2161
2451
|
* - Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
@@ -2187,6 +2477,11 @@ export const window = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2187
2477
|
/**
|
|
2188
2478
|
* Groups consecutive equal elements using a custom equivalence function.
|
|
2189
2479
|
*
|
|
2480
|
+
* **When to use**
|
|
2481
|
+
*
|
|
2482
|
+
* Use when a non-empty array is already arranged so matching elements are
|
|
2483
|
+
* adjacent and you need a custom equivalence function.
|
|
2484
|
+
*
|
|
2190
2485
|
* **Details**
|
|
2191
2486
|
*
|
|
2192
2487
|
* - Only groups **adjacent** elements — non-adjacent duplicates stay separate.
|
|
@@ -2201,8 +2496,8 @@ export const window = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2201
2496
|
* // [["a", "a"], ["b", "b", "b"], ["c"], ["a"]]
|
|
2202
2497
|
* ```
|
|
2203
2498
|
*
|
|
2204
|
-
* @see {@link group}
|
|
2205
|
-
* @see {@link groupBy}
|
|
2499
|
+
* @see {@link group} for grouping adjacent elements with `Equal.equivalence()`
|
|
2500
|
+
* @see {@link groupBy} for grouping all elements into a record by key, regardless of adjacency
|
|
2206
2501
|
*
|
|
2207
2502
|
* @category grouping
|
|
2208
2503
|
* @since 2.0.0
|
|
@@ -2224,6 +2519,11 @@ export const groupWith = /*#__PURE__*/dual(2, (self, isEquivalent) => chop(self,
|
|
|
2224
2519
|
/**
|
|
2225
2520
|
* Groups consecutive equal elements using `Equal.equivalence()`.
|
|
2226
2521
|
*
|
|
2522
|
+
* **When to use**
|
|
2523
|
+
*
|
|
2524
|
+
* Use when equal values are already adjacent and Effect's default equality is
|
|
2525
|
+
* the right comparison.
|
|
2526
|
+
*
|
|
2227
2527
|
* **Details**
|
|
2228
2528
|
*
|
|
2229
2529
|
* - Only groups **adjacent** elements.
|
|
@@ -2247,6 +2547,10 @@ export const group = /*#__PURE__*/groupWith(/*#__PURE__*/Equal.asEquivalence());
|
|
|
2247
2547
|
* Groups elements into a record by a key-returning function. Each key maps
|
|
2248
2548
|
* to a `NonEmptyArray` of elements that produced that key.
|
|
2249
2549
|
*
|
|
2550
|
+
* **When to use**
|
|
2551
|
+
*
|
|
2552
|
+
* Use to build buckets of elements indexed by a computed string or symbol key.
|
|
2553
|
+
*
|
|
2250
2554
|
* **Details**
|
|
2251
2555
|
*
|
|
2252
2556
|
* - Unlike {@link group}/{@link groupWith}, elements do not need to be
|
|
@@ -2291,6 +2595,11 @@ export const groupBy = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2291
2595
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
2292
2596
|
* duplicates.
|
|
2293
2597
|
*
|
|
2598
|
+
* **When to use**
|
|
2599
|
+
*
|
|
2600
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
2601
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
2602
|
+
*
|
|
2294
2603
|
* **Example** (Union with custom equality)
|
|
2295
2604
|
*
|
|
2296
2605
|
* ```ts
|
|
@@ -2299,9 +2608,9 @@ export const groupBy = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2299
2608
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
2300
2609
|
* ```
|
|
2301
2610
|
*
|
|
2302
|
-
* @see {@link union}
|
|
2303
|
-
* @see {@link
|
|
2304
|
-
* @see {@link
|
|
2611
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
2612
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
2613
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
2305
2614
|
*
|
|
2306
2615
|
* @category elements
|
|
2307
2616
|
* @since 2.0.0
|
|
@@ -2342,6 +2651,11 @@ export const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that,
|
|
|
2342
2651
|
* Computes the intersection of two arrays using a custom equivalence. Order is
|
|
2343
2652
|
* determined by the first array.
|
|
2344
2653
|
*
|
|
2654
|
+
* **When to use**
|
|
2655
|
+
*
|
|
2656
|
+
* Use when keeping only values present in both arrays and equality must be
|
|
2657
|
+
* defined by a custom comparator, such as matching objects by id.
|
|
2658
|
+
*
|
|
2345
2659
|
* **Example** (Intersection with custom equality)
|
|
2346
2660
|
*
|
|
2347
2661
|
* ```ts
|
|
@@ -2353,9 +2667,9 @@ export const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that,
|
|
|
2353
2667
|
* console.log(Array.intersectionWith(isEquivalent)(array2)(array1)) // [{ id: 1 }, { id: 3 }]
|
|
2354
2668
|
* ```
|
|
2355
2669
|
*
|
|
2356
|
-
* @see {@link intersection}
|
|
2357
|
-
* @see {@link
|
|
2358
|
-
* @see {@link
|
|
2670
|
+
* @see {@link intersection} for the `Equal.equivalence()` variant
|
|
2671
|
+
* @see {@link unionWith} for keeping values from either array with custom equality
|
|
2672
|
+
* @see {@link differenceWith} for keeping values only from the first array with custom equality
|
|
2359
2673
|
*
|
|
2360
2674
|
* @category elements
|
|
2361
2675
|
* @since 2.0.0
|
|
@@ -2391,6 +2705,11 @@ export const intersection = /*#__PURE__*/intersectionWith(/*#__PURE__*/Equal.asE
|
|
|
2391
2705
|
* Computes elements in the first array that are not in the second, using a
|
|
2392
2706
|
* custom equivalence.
|
|
2393
2707
|
*
|
|
2708
|
+
* **When to use**
|
|
2709
|
+
*
|
|
2710
|
+
* Use when keeping only values from the first array and equality must be
|
|
2711
|
+
* defined by a custom comparator, such as matching objects by id.
|
|
2712
|
+
*
|
|
2394
2713
|
* **Example** (Difference with custom equality)
|
|
2395
2714
|
*
|
|
2396
2715
|
* ```ts
|
|
@@ -2400,9 +2719,9 @@ export const intersection = /*#__PURE__*/intersectionWith(/*#__PURE__*/Equal.asE
|
|
|
2400
2719
|
* console.log(diff) // [1]
|
|
2401
2720
|
* ```
|
|
2402
2721
|
*
|
|
2403
|
-
* @see {@link difference}
|
|
2404
|
-
* @see {@link
|
|
2405
|
-
* @see {@link
|
|
2722
|
+
* @see {@link difference} for the `Equal.equivalence()` variant
|
|
2723
|
+
* @see {@link unionWith} for keeping values from either array with custom equality
|
|
2724
|
+
* @see {@link intersectionWith} for keeping values present in both arrays with custom equality
|
|
2406
2725
|
*
|
|
2407
2726
|
* @category elements
|
|
2408
2727
|
* @since 2.0.0
|
|
@@ -2418,6 +2737,11 @@ export const differenceWith = isEquivalent => {
|
|
|
2418
2737
|
* Computes elements in the first array that are not in the second, using
|
|
2419
2738
|
* `Equal.equivalence()`.
|
|
2420
2739
|
*
|
|
2740
|
+
* **When to use**
|
|
2741
|
+
*
|
|
2742
|
+
* Use when you need to keep values from the first array that are absent from
|
|
2743
|
+
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
2744
|
+
*
|
|
2421
2745
|
* **Example** (Array difference)
|
|
2422
2746
|
*
|
|
2423
2747
|
* ```ts
|
|
@@ -2437,6 +2761,10 @@ export const difference = /*#__PURE__*/differenceWith(/*#__PURE__*/Equal.asEquiv
|
|
|
2437
2761
|
/**
|
|
2438
2762
|
* Creates an empty array.
|
|
2439
2763
|
*
|
|
2764
|
+
* **When to use**
|
|
2765
|
+
*
|
|
2766
|
+
* Use to create a typed empty array without allocating placeholder elements.
|
|
2767
|
+
*
|
|
2440
2768
|
* **Example** (Creating an empty array)
|
|
2441
2769
|
*
|
|
2442
2770
|
* ```ts
|
|
@@ -2474,6 +2802,10 @@ export const of = a => [a];
|
|
|
2474
2802
|
/**
|
|
2475
2803
|
* Transforms each element using a function, returning a new array.
|
|
2476
2804
|
*
|
|
2805
|
+
* **When to use**
|
|
2806
|
+
*
|
|
2807
|
+
* Use to transform each element independently while preserving the array shape.
|
|
2808
|
+
*
|
|
2477
2809
|
* **Details**
|
|
2478
2810
|
*
|
|
2479
2811
|
* - The function receives `(element, index)`.
|
|
@@ -2496,6 +2828,11 @@ export const map = /*#__PURE__*/dual(2, (self, f) => self.map(f));
|
|
|
2496
2828
|
/**
|
|
2497
2829
|
* Maps each element to an array and flattens the results into a single array.
|
|
2498
2830
|
*
|
|
2831
|
+
* **When to use**
|
|
2832
|
+
*
|
|
2833
|
+
* Use to map each element to zero or more values and concatenate the results in
|
|
2834
|
+
* one pass.
|
|
2835
|
+
*
|
|
2499
2836
|
* **Details**
|
|
2500
2837
|
*
|
|
2501
2838
|
* - The function receives `(element, index)`.
|
|
@@ -2531,6 +2868,11 @@ export const flatMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2531
2868
|
/**
|
|
2532
2869
|
* Flattens a nested array of arrays into a single array.
|
|
2533
2870
|
*
|
|
2871
|
+
* **When to use**
|
|
2872
|
+
*
|
|
2873
|
+
* Use to collapse one level of nested arrays when no per-element mapping is
|
|
2874
|
+
* needed.
|
|
2875
|
+
*
|
|
2534
2876
|
* **Example** (Flattening nested arrays)
|
|
2535
2877
|
*
|
|
2536
2878
|
* ```ts
|
|
@@ -2548,6 +2890,11 @@ export const flatten = /*#__PURE__*/flatMap(identity);
|
|
|
2548
2890
|
/**
|
|
2549
2891
|
* Extracts all `Some` values from an iterable of `Option`s, discarding `None`s.
|
|
2550
2892
|
*
|
|
2893
|
+
* **When to use**
|
|
2894
|
+
*
|
|
2895
|
+
* Use to collect only present values from `Option` values while discarding
|
|
2896
|
+
* `None` values.
|
|
2897
|
+
*
|
|
2551
2898
|
* **Example** (Extracting Some values)
|
|
2552
2899
|
*
|
|
2553
2900
|
* ```ts
|
|
@@ -2575,6 +2922,11 @@ export const getSomes = self => {
|
|
|
2575
2922
|
* Extracts all failure values from an iterable of `Result`s, discarding
|
|
2576
2923
|
* successes.
|
|
2577
2924
|
*
|
|
2925
|
+
* **When to use**
|
|
2926
|
+
*
|
|
2927
|
+
* Use to collect only failure values from `Result` values while discarding
|
|
2928
|
+
* successes.
|
|
2929
|
+
*
|
|
2578
2930
|
* **Example** (Extracting failures)
|
|
2579
2931
|
*
|
|
2580
2932
|
* ```ts
|
|
@@ -2603,6 +2955,11 @@ export const getFailures = self => {
|
|
|
2603
2955
|
* Extracts all success values from an iterable of `Result`s, discarding
|
|
2604
2956
|
* failures.
|
|
2605
2957
|
*
|
|
2958
|
+
* **When to use**
|
|
2959
|
+
*
|
|
2960
|
+
* Use to collect only success values from `Result` values while discarding
|
|
2961
|
+
* failures.
|
|
2962
|
+
*
|
|
2606
2963
|
* **Example** (Extracting successes)
|
|
2607
2964
|
*
|
|
2608
2965
|
* ```ts
|
|
@@ -2630,6 +2987,11 @@ export const getSuccesses = self => {
|
|
|
2630
2987
|
/**
|
|
2631
2988
|
* Keeps transformed values for elements where a `Filter` succeeds.
|
|
2632
2989
|
*
|
|
2990
|
+
* **When to use**
|
|
2991
|
+
*
|
|
2992
|
+
* Use to transform elements with a `Result`-returning filter while discarding
|
|
2993
|
+
* failures.
|
|
2994
|
+
*
|
|
2633
2995
|
* **Details**
|
|
2634
2996
|
*
|
|
2635
2997
|
* - The filter receives `(element, index)`.
|
|
@@ -2645,6 +3007,7 @@ export const getSuccesses = self => {
|
|
|
2645
3007
|
* ```
|
|
2646
3008
|
*
|
|
2647
3009
|
* @see {@link filter} — keep original elements matching a predicate
|
|
3010
|
+
* @see {@link partition} for keeping both failures and successes
|
|
2648
3011
|
*
|
|
2649
3012
|
* @category filtering
|
|
2650
3013
|
* @since 2.0.0
|
|
@@ -2663,6 +3026,10 @@ export const filterMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2663
3026
|
/**
|
|
2664
3027
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
2665
3028
|
*
|
|
3029
|
+
* **When to use**
|
|
3030
|
+
*
|
|
3031
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
3032
|
+
*
|
|
2666
3033
|
* **Details**
|
|
2667
3034
|
*
|
|
2668
3035
|
* - The predicate receives `(element, index)`.
|
|
@@ -2677,6 +3044,7 @@ export const filterMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2677
3044
|
* ```
|
|
2678
3045
|
*
|
|
2679
3046
|
* @see {@link partition} — split into matching and non-matching
|
|
3047
|
+
* @see {@link filterMap} for transforming while filtering
|
|
2680
3048
|
*
|
|
2681
3049
|
* @category filtering
|
|
2682
3050
|
* @since 2.0.0
|
|
@@ -2694,6 +3062,11 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
2694
3062
|
/**
|
|
2695
3063
|
* Splits an iterable using a `Filter` into failures and successes.
|
|
2696
3064
|
*
|
|
3065
|
+
* **When to use**
|
|
3066
|
+
*
|
|
3067
|
+
* Use to evaluate each element with a `Result`-returning filter and keep both
|
|
3068
|
+
* failure and success values.
|
|
3069
|
+
*
|
|
2697
3070
|
* **Details**
|
|
2698
3071
|
*
|
|
2699
3072
|
* - Returns `[excluded, satisfying]`.
|
|
@@ -2711,6 +3084,7 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
2711
3084
|
* ```
|
|
2712
3085
|
*
|
|
2713
3086
|
* @see {@link filter} — keep only matching elements
|
|
3087
|
+
* @see {@link filterMap} for discarding failures
|
|
2714
3088
|
* @see {@link separate} — split an iterable of `Result` values
|
|
2715
3089
|
*
|
|
2716
3090
|
* @category filtering
|
|
@@ -2733,6 +3107,10 @@ export const partition = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2733
3107
|
/**
|
|
2734
3108
|
* Separates an iterable of `Result`s into failure values and success values.
|
|
2735
3109
|
*
|
|
3110
|
+
* **When to use**
|
|
3111
|
+
*
|
|
3112
|
+
* Use to split existing `Result` values into failure and success arrays.
|
|
3113
|
+
*
|
|
2736
3114
|
* **Details**
|
|
2737
3115
|
*
|
|
2738
3116
|
* - Returns `[failures, successes]`.
|
|
@@ -2752,6 +3130,7 @@ export const partition = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2752
3130
|
*
|
|
2753
3131
|
* @see {@link getFailures} — extract only failures
|
|
2754
3132
|
* @see {@link getSuccesses} — extract only successes
|
|
3133
|
+
* @see {@link partition} for computing `Result` values while splitting
|
|
2755
3134
|
*
|
|
2756
3135
|
* @category filtering
|
|
2757
3136
|
* @since 2.0.0
|
|
@@ -2760,6 +3139,10 @@ export const separate = /*#__PURE__*/partition(identity);
|
|
|
2760
3139
|
/**
|
|
2761
3140
|
* Folds an iterable from left to right into a single value.
|
|
2762
3141
|
*
|
|
3142
|
+
* **When to use**
|
|
3143
|
+
*
|
|
3144
|
+
* Use to combine all elements into one accumulated value from left to right.
|
|
3145
|
+
*
|
|
2763
3146
|
* **Details**
|
|
2764
3147
|
*
|
|
2765
3148
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -2782,6 +3165,11 @@ export const reduce = /*#__PURE__*/dual(3, (self, b, f) => fromIterable(self).re
|
|
|
2782
3165
|
/**
|
|
2783
3166
|
* Folds an iterable from right to left into a single value.
|
|
2784
3167
|
*
|
|
3168
|
+
* **When to use**
|
|
3169
|
+
*
|
|
3170
|
+
* Use when folding order matters and values must be combined from right to
|
|
3171
|
+
* left.
|
|
3172
|
+
*
|
|
2785
3173
|
* **Details**
|
|
2786
3174
|
*
|
|
2787
3175
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -2850,6 +3238,10 @@ export const liftOption = f => (...a) => fromOption(f(...a));
|
|
|
2850
3238
|
* Converts a nullable value to an array: `null`/`undefined` becomes `[]`,
|
|
2851
3239
|
* anything else becomes `[value]`.
|
|
2852
3240
|
*
|
|
3241
|
+
* **When to use**
|
|
3242
|
+
*
|
|
3243
|
+
* Use to treat a nullable single value as zero or one array element.
|
|
3244
|
+
*
|
|
2853
3245
|
* **Example** (Nullable to array)
|
|
2854
3246
|
*
|
|
2855
3247
|
* ```ts
|
|
@@ -2895,6 +3287,11 @@ export const liftNullishOr = f => (...a) => fromNullishOr(f(...a));
|
|
|
2895
3287
|
* Maps each element with a nullable-returning function, keeping only non-null /
|
|
2896
3288
|
* non-undefined results.
|
|
2897
3289
|
*
|
|
3290
|
+
* **When to use**
|
|
3291
|
+
*
|
|
3292
|
+
* Use when mapping and filtering in one step, where the mapper can return
|
|
3293
|
+
* `null` or `undefined` to skip elements.
|
|
3294
|
+
*
|
|
2898
3295
|
* **Example** (FlatMapping with nullable)
|
|
2899
3296
|
*
|
|
2900
3297
|
* ```ts
|
|
@@ -2904,6 +3301,9 @@ export const liftNullishOr = f => (...a) => fromNullishOr(f(...a));
|
|
|
2904
3301
|
* // [1, 3]
|
|
2905
3302
|
* ```
|
|
2906
3303
|
*
|
|
3304
|
+
* @see {@link flatMap} for mapping each element to an array and flattening
|
|
3305
|
+
* @see {@link fromNullishOr} for converting a single nullable value to an array
|
|
3306
|
+
*
|
|
2907
3307
|
* @category sequencing
|
|
2908
3308
|
* @since 4.0.0
|
|
2909
3309
|
*/
|
|
@@ -2941,6 +3341,11 @@ export const liftResult = f => (...a) => {
|
|
|
2941
3341
|
* Tests whether all elements satisfy the predicate. Supports refinements for
|
|
2942
3342
|
* type narrowing.
|
|
2943
3343
|
*
|
|
3344
|
+
* **When to use**
|
|
3345
|
+
*
|
|
3346
|
+
* Use to check that all elements satisfy a predicate, including
|
|
3347
|
+
* refinement-based type narrowing.
|
|
3348
|
+
*
|
|
2944
3349
|
* **Example** (Testing all elements)
|
|
2945
3350
|
*
|
|
2946
3351
|
* ```ts
|
|
@@ -2980,6 +3385,11 @@ export const some = /*#__PURE__*/dual(2, (self, predicate) => self.some(predicat
|
|
|
2980
3385
|
* Applies a function to each suffix of the array (starting from each index),
|
|
2981
3386
|
* collecting the results.
|
|
2982
3387
|
*
|
|
3388
|
+
* **When to use**
|
|
3389
|
+
*
|
|
3390
|
+
* Use when a computation depends on every suffix of an array, such as
|
|
3391
|
+
* cumulative aggregations from each position.
|
|
3392
|
+
*
|
|
2983
3393
|
* **Details**
|
|
2984
3394
|
*
|
|
2985
3395
|
* - For index `i`, the function receives `self.slice(i)`.
|
|
@@ -2992,6 +3402,8 @@ export const some = /*#__PURE__*/dual(2, (self, predicate) => self.some(predicat
|
|
|
2992
3402
|
* console.log(Array.extend([1, 2, 3], (as) => as.length)) // [3, 2, 1]
|
|
2993
3403
|
* ```
|
|
2994
3404
|
*
|
|
3405
|
+
* @see {@link scan} for keeping intermediate accumulator values during a fold
|
|
3406
|
+
*
|
|
2995
3407
|
* @category mapping
|
|
2996
3408
|
* @since 2.0.0
|
|
2997
3409
|
*/
|
|
@@ -3111,6 +3523,11 @@ export const makeEquivalence = Equivalence.Array;
|
|
|
3111
3523
|
/**
|
|
3112
3524
|
* Runs a side-effect for each element. The callback receives `(element, index)`.
|
|
3113
3525
|
*
|
|
3526
|
+
* **When to use**
|
|
3527
|
+
*
|
|
3528
|
+
* Use to iterate over an array for side-effects only, when no transformed
|
|
3529
|
+
* result is needed.
|
|
3530
|
+
*
|
|
3114
3531
|
* **Example** (Iterating with side-effects)
|
|
3115
3532
|
*
|
|
3116
3533
|
* ```ts
|
|
@@ -3119,6 +3536,8 @@ export const makeEquivalence = Equivalence.Array;
|
|
|
3119
3536
|
* Array.forEach([1, 2, 3], (n) => console.log(n)) // 1, 2, 3
|
|
3120
3537
|
* ```
|
|
3121
3538
|
*
|
|
3539
|
+
* @see {@link map} for transforming each element into a new array
|
|
3540
|
+
*
|
|
3122
3541
|
* @category elements
|
|
3123
3542
|
* @since 2.0.0
|
|
3124
3543
|
*/
|
|
@@ -3127,6 +3546,11 @@ export const forEach = /*#__PURE__*/dual(2, (self, f) => fromIterable(self).forE
|
|
|
3127
3546
|
* Removes duplicates using a custom equivalence, preserving the order of the
|
|
3128
3547
|
* first occurrence.
|
|
3129
3548
|
*
|
|
3549
|
+
* **When to use**
|
|
3550
|
+
*
|
|
3551
|
+
* Use to remove all duplicate elements with a custom equivalence when default
|
|
3552
|
+
* equality is not appropriate.
|
|
3553
|
+
*
|
|
3130
3554
|
* **Example** (Deduplicating with custom equality)
|
|
3131
3555
|
*
|
|
3132
3556
|
* ```ts
|
|
@@ -3159,6 +3583,11 @@ export const dedupeWith = /*#__PURE__*/dual(2, (self, isEquivalent) => {
|
|
|
3159
3583
|
* Removes duplicates using `Equal.equivalence()`, preserving the order of the
|
|
3160
3584
|
* first occurrence.
|
|
3161
3585
|
*
|
|
3586
|
+
* **When to use**
|
|
3587
|
+
*
|
|
3588
|
+
* Use to remove repeated values from an iterable when Effect's default equality
|
|
3589
|
+
* is the right comparison, preserving the first occurrence.
|
|
3590
|
+
*
|
|
3162
3591
|
* **Example** (Removing duplicates)
|
|
3163
3592
|
*
|
|
3164
3593
|
* ```ts
|
|
@@ -3177,6 +3606,12 @@ export const dedupe = self => dedupeWith(self, Equal.asEquivalence());
|
|
|
3177
3606
|
/**
|
|
3178
3607
|
* Removes consecutive duplicate elements using a custom equivalence.
|
|
3179
3608
|
*
|
|
3609
|
+
* **When to use**
|
|
3610
|
+
*
|
|
3611
|
+
* Use when consecutive duplicates should be collapsed using a custom
|
|
3612
|
+
* equivalence, while equivalent values that appear later should remain in the
|
|
3613
|
+
* result.
|
|
3614
|
+
*
|
|
3180
3615
|
* **Details**
|
|
3181
3616
|
*
|
|
3182
3617
|
* - Non-adjacent duplicates are preserved.
|
|
@@ -3210,6 +3645,11 @@ export const dedupeAdjacentWith = /*#__PURE__*/dual(2, (self, isEquivalent) => {
|
|
|
3210
3645
|
/**
|
|
3211
3646
|
* Removes consecutive duplicate elements using `Equal.equivalence()`.
|
|
3212
3647
|
*
|
|
3648
|
+
* **When to use**
|
|
3649
|
+
*
|
|
3650
|
+
* Use when you need to collapse consecutive duplicates while preserving later
|
|
3651
|
+
* non-consecutive repeats, and the default equality is sufficient.
|
|
3652
|
+
*
|
|
3213
3653
|
* **Example** (Removing adjacent duplicates)
|
|
3214
3654
|
*
|
|
3215
3655
|
* ```ts
|
|
@@ -3245,6 +3685,11 @@ export const join = /*#__PURE__*/dual(2, (self, sep) => fromIterable(self).join(
|
|
|
3245
3685
|
/**
|
|
3246
3686
|
* Maps over an array while threading an accumulator through each step, returning both the final state and the mapped array.
|
|
3247
3687
|
*
|
|
3688
|
+
* **When to use**
|
|
3689
|
+
*
|
|
3690
|
+
* Use when mapping needs state threaded through each element and the final state
|
|
3691
|
+
* is also needed.
|
|
3692
|
+
*
|
|
3248
3693
|
* **Details**
|
|
3249
3694
|
*
|
|
3250
3695
|
* - Combines `map` and `reduce` in a single pass.
|
|
@@ -3282,6 +3727,11 @@ export const mapAccum = /*#__PURE__*/dual(3, (self, s, f) => {
|
|
|
3282
3727
|
/**
|
|
3283
3728
|
* Computes the cartesian product of two arrays, applying a combiner to each pair.
|
|
3284
3729
|
*
|
|
3730
|
+
* **When to use**
|
|
3731
|
+
*
|
|
3732
|
+
* Use to compute every combination from two arrays and immediately transform
|
|
3733
|
+
* each pair into a custom result.
|
|
3734
|
+
*
|
|
3285
3735
|
* **Details**
|
|
3286
3736
|
*
|
|
3287
3737
|
* - Produces every combination of an element from `self` with an element from `that`.
|
|
@@ -3297,7 +3747,7 @@ export const mapAccum = /*#__PURE__*/dual(3, (self, s, f) => {
|
|
|
3297
3747
|
* console.log(result) // ["1-a", "1-b", "2-a", "2-b"]
|
|
3298
3748
|
* ```
|
|
3299
3749
|
*
|
|
3300
|
-
* @see {@link cartesian}
|
|
3750
|
+
* @see {@link cartesian} for returning tuples instead of applying a combiner
|
|
3301
3751
|
*
|
|
3302
3752
|
* @category elements
|
|
3303
3753
|
* @since 2.0.0
|
|
@@ -3306,6 +3756,10 @@ export const cartesianWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(sel
|
|
|
3306
3756
|
/**
|
|
3307
3757
|
* Computes the cartesian product of two arrays, returning all pairs as tuples.
|
|
3308
3758
|
*
|
|
3759
|
+
* **When to use**
|
|
3760
|
+
*
|
|
3761
|
+
* Use when you need every `[a, b]` pair from two arrays as tuples.
|
|
3762
|
+
*
|
|
3309
3763
|
* **Details**
|
|
3310
3764
|
*
|
|
3311
3765
|
* - Produces every `[a, b]` combination of an element from `self` with an element from `that`.
|
|
@@ -3334,7 +3788,7 @@ export const cartesian = /*#__PURE__*/dual(2, (self, that) => cartesianWith(self
|
|
|
3334
3788
|
*
|
|
3335
3789
|
* **When to use**
|
|
3336
3790
|
*
|
|
3337
|
-
*
|
|
3791
|
+
* Use when begin a pipeline with `Do`, then use {@link bind} to introduce array variables and {@link let_ let} for plain values.
|
|
3338
3792
|
* - Each `bind` produces the cartesian product of all bound variables (like nested loops).
|
|
3339
3793
|
* - Use `filter` and `map` in the pipeline to add conditions and transformations.
|
|
3340
3794
|
*
|
|
@@ -3364,6 +3818,11 @@ export const Do = /*#__PURE__*/of({});
|
|
|
3364
3818
|
/**
|
|
3365
3819
|
* Introduces a new array variable into a do-notation scope, producing the cartesian product with all previous bindings.
|
|
3366
3820
|
*
|
|
3821
|
+
* **When to use**
|
|
3822
|
+
*
|
|
3823
|
+
* Use to add another array-producing binding to an `Array.Do` pipeline, pairing
|
|
3824
|
+
* each existing scope with every value returned by the callback.
|
|
3825
|
+
*
|
|
3367
3826
|
* **Details**
|
|
3368
3827
|
*
|
|
3369
3828
|
* - Each `bind` call adds a named property to the accumulated object.
|
|
@@ -3395,6 +3854,11 @@ export const bind = /*#__PURE__*/internalDoNotation.bind(map, flatMap);
|
|
|
3395
3854
|
/**
|
|
3396
3855
|
* Names the elements of an array by wrapping each in an object with the given key, starting a do-notation scope.
|
|
3397
3856
|
*
|
|
3857
|
+
* **When to use**
|
|
3858
|
+
*
|
|
3859
|
+
* Use when you already have an array and want to start a do-notation pipeline
|
|
3860
|
+
* by naming each element.
|
|
3861
|
+
*
|
|
3398
3862
|
* **Details**
|
|
3399
3863
|
*
|
|
3400
3864
|
* - Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`.
|
|
@@ -3476,6 +3940,11 @@ export function makeReducerConcat() {
|
|
|
3476
3940
|
/**
|
|
3477
3941
|
* Counts the elements in an iterable that satisfy a predicate.
|
|
3478
3942
|
*
|
|
3943
|
+
* **When to use**
|
|
3944
|
+
*
|
|
3945
|
+
* Use to count how many elements satisfy a predicate when you only need the
|
|
3946
|
+
* number of matches instead of the matching elements.
|
|
3947
|
+
*
|
|
3479
3948
|
* **Details**
|
|
3480
3949
|
*
|
|
3481
3950
|
* - The predicate receives both the element and its index.
|