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.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { NoInfer, TupleOf } from "./Types.ts";
|
|
|
13
13
|
*
|
|
14
14
|
* **When to use**
|
|
15
15
|
*
|
|
16
|
-
* Use
|
|
16
|
+
* Use when you need the native `Array` constructor while the `Array`
|
|
17
17
|
* namespace is in scope (e.g. `Array.Array.isArray`, `Array.Array.from`).
|
|
18
18
|
*
|
|
19
19
|
* **Example** (Using the Array constructor)
|
|
@@ -43,7 +43,7 @@ export interface ReadonlyArrayTypeLambda extends TypeLambda {
|
|
|
43
43
|
*
|
|
44
44
|
* **When to use**
|
|
45
45
|
*
|
|
46
|
-
* Use this type when you need to ensure non-emptiness at the type level while
|
|
46
|
+
* Use when you use this type when you need to ensure non-emptiness at the type level while
|
|
47
47
|
* preventing mutation. Many Array module functions accept or return this type.
|
|
48
48
|
*
|
|
49
49
|
* **Example** (Typing a non-empty array)
|
|
@@ -65,6 +65,11 @@ export type NonEmptyReadonlyArray<A> = readonly [A, ...Array<A>];
|
|
|
65
65
|
/**
|
|
66
66
|
* A mutable array guaranteed to have at least one element.
|
|
67
67
|
*
|
|
68
|
+
* **When to use**
|
|
69
|
+
*
|
|
70
|
+
* Use when mutation is acceptable and non-emptiness must be tracked at the type
|
|
71
|
+
* level.
|
|
72
|
+
*
|
|
68
73
|
* **Details**
|
|
69
74
|
*
|
|
70
75
|
* This is the mutable counterpart of {@link NonEmptyReadonlyArray}. Most Array
|
|
@@ -92,7 +97,7 @@ export type NonEmptyArray<A> = [A, ...Array<A>];
|
|
|
92
97
|
*
|
|
93
98
|
* **When to use**
|
|
94
99
|
*
|
|
95
|
-
*
|
|
100
|
+
* Use when you have literal values and want a typed non-empty array.
|
|
96
101
|
* - The element type is inferred as the union of all arguments.
|
|
97
102
|
* - Always returns a `NonEmptyArray` since at least one argument is required.
|
|
98
103
|
*
|
|
@@ -117,7 +122,7 @@ export declare const make: <Elements extends NonEmptyArray<unknown>>(...elements
|
|
|
117
122
|
*
|
|
118
123
|
* **When to use**
|
|
119
124
|
*
|
|
120
|
-
*
|
|
125
|
+
* Use when you need a pre-sized array and will fill it imperatively.
|
|
121
126
|
* - Elements are typed as `A | undefined` since slots are empty.
|
|
122
127
|
* - Prefer {@link makeBy} when you can compute each element from its index.
|
|
123
128
|
*
|
|
@@ -141,7 +146,7 @@ export declare const allocate: <A = never>(n: number) => Array<A | undefined>;
|
|
|
141
146
|
*
|
|
142
147
|
* **When to use**
|
|
143
148
|
*
|
|
144
|
-
*
|
|
149
|
+
* Use when you need an array whose values depend on the index.
|
|
145
150
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
146
151
|
* - Dual: `Array.makeBy(5, f)` or `pipe(5, Array.makeBy(f))`.
|
|
147
152
|
*
|
|
@@ -166,7 +171,7 @@ export declare const makeBy: {
|
|
|
166
171
|
*
|
|
167
172
|
* **When to use**
|
|
168
173
|
*
|
|
169
|
-
*
|
|
174
|
+
* Use when you need an array whose values depend on the index.
|
|
170
175
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
171
176
|
* - Dual: `Array.makeBy(5, f)` or `pipe(5, Array.makeBy(f))`.
|
|
172
177
|
*
|
|
@@ -191,7 +196,7 @@ export declare const makeBy: {
|
|
|
191
196
|
*
|
|
192
197
|
* **When to use**
|
|
193
198
|
*
|
|
194
|
-
*
|
|
199
|
+
* Use when you need an array whose values depend on the index.
|
|
195
200
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
196
201
|
* - Dual: `Array.makeBy(5, f)` or `pipe(5, Array.makeBy(f))`.
|
|
197
202
|
*
|
|
@@ -218,7 +223,7 @@ export declare const makeBy: {
|
|
|
218
223
|
*
|
|
219
224
|
* **When to use**
|
|
220
225
|
*
|
|
221
|
-
*
|
|
226
|
+
* Use when you need a sequence of consecutive integers.
|
|
222
227
|
* - If `start > end`, returns `[start]`.
|
|
223
228
|
* - Always returns a `NonEmptyArray`.
|
|
224
229
|
*
|
|
@@ -242,7 +247,7 @@ export declare const range: (start: number, end: number) => NonEmptyArray<number
|
|
|
242
247
|
*
|
|
243
248
|
* **When to use**
|
|
244
249
|
*
|
|
245
|
-
*
|
|
250
|
+
* Use when you need multiple copies of the same value.
|
|
246
251
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
247
252
|
* - Dual: `Array.replicate("a", 3)` or `pipe("a", Array.replicate(3))`.
|
|
248
253
|
*
|
|
@@ -266,7 +271,7 @@ export declare const replicate: {
|
|
|
266
271
|
*
|
|
267
272
|
* **When to use**
|
|
268
273
|
*
|
|
269
|
-
*
|
|
274
|
+
* Use when you need multiple copies of the same value.
|
|
270
275
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
271
276
|
* - Dual: `Array.replicate("a", 3)` or `pipe("a", Array.replicate(3))`.
|
|
272
277
|
*
|
|
@@ -290,7 +295,7 @@ export declare const replicate: {
|
|
|
290
295
|
*
|
|
291
296
|
* **When to use**
|
|
292
297
|
*
|
|
293
|
-
*
|
|
298
|
+
* Use when you need multiple copies of the same value.
|
|
294
299
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
295
300
|
* - Dual: `Array.replicate("a", 3)` or `pipe("a", Array.replicate(3))`.
|
|
296
301
|
*
|
|
@@ -313,6 +318,10 @@ export declare const replicate: {
|
|
|
313
318
|
/**
|
|
314
319
|
* Converts an `Iterable` to an `Array`.
|
|
315
320
|
*
|
|
321
|
+
* **When to use**
|
|
322
|
+
*
|
|
323
|
+
* Use to convert any `Iterable` (Set, Generator, etc.) into an array.
|
|
324
|
+
*
|
|
316
325
|
* **Details**
|
|
317
326
|
*
|
|
318
327
|
* - If the input is already an array, returns it **by reference** (no copy).
|
|
@@ -339,6 +348,11 @@ export declare const fromIterable: <A>(collection: Iterable<A>) => Array<A>;
|
|
|
339
348
|
/**
|
|
340
349
|
* Normalizes a value that is either a single element or an array into an array.
|
|
341
350
|
*
|
|
351
|
+
* **When to use**
|
|
352
|
+
*
|
|
353
|
+
* Use to normalize input that may be a single value or an array into a consistent
|
|
354
|
+
* array.
|
|
355
|
+
*
|
|
342
356
|
* **Details**
|
|
343
357
|
*
|
|
344
358
|
* - If the input is already an array, returns it by reference.
|
|
@@ -364,6 +378,11 @@ export declare const ensure: <A>(self: ReadonlyArray<A> | A) => Array<A>;
|
|
|
364
378
|
/**
|
|
365
379
|
* Converts a record into an array of `[key, value]` tuples.
|
|
366
380
|
*
|
|
381
|
+
* **When to use**
|
|
382
|
+
*
|
|
383
|
+
* Use to convert a record into an array of key-value tuples for iteration or
|
|
384
|
+
* transformation.
|
|
385
|
+
*
|
|
367
386
|
* **Details**
|
|
368
387
|
*
|
|
369
388
|
* - Key order follows `Object.entries` semantics.
|
|
@@ -378,6 +397,9 @@ export declare const ensure: <A>(self: ReadonlyArray<A> | A) => Array<A>;
|
|
|
378
397
|
* console.log(result) // [["a", 1], ["b", 2], ["c", 3]]
|
|
379
398
|
* ```
|
|
380
399
|
*
|
|
400
|
+
* @see {@link Record.toEntries} the equivalent function from the Record module
|
|
401
|
+
* @see {@link Record.fromEntries} to build a record from an array of tuples
|
|
402
|
+
*
|
|
381
403
|
* @category converting
|
|
382
404
|
* @since 2.0.0
|
|
383
405
|
*/
|
|
@@ -385,6 +407,10 @@ export declare const fromRecord: <K extends string, A>(self: Readonly<Record<K,
|
|
|
385
407
|
/**
|
|
386
408
|
* Converts an `Option` to an array: `Some(a)` becomes `[a]`, `None` becomes `[]`.
|
|
387
409
|
*
|
|
410
|
+
* **When to use**
|
|
411
|
+
*
|
|
412
|
+
* Use to convert a single `Option` into an array for downstream array operations.
|
|
413
|
+
*
|
|
388
414
|
* **Example** (Option to array)
|
|
389
415
|
*
|
|
390
416
|
* ```ts
|
|
@@ -405,7 +431,7 @@ export declare const fromOption: <A>(self: Option.Option<A>) => Array<A>;
|
|
|
405
431
|
*
|
|
406
432
|
* **When to use**
|
|
407
433
|
*
|
|
408
|
-
*
|
|
434
|
+
* Use when you need to branch on whether an array has elements.
|
|
409
435
|
* - `onNonEmpty` receives a `NonEmptyReadonlyArray`.
|
|
410
436
|
* - Dual: data-first or data-last.
|
|
411
437
|
*
|
|
@@ -434,7 +460,7 @@ export declare const match: {
|
|
|
434
460
|
*
|
|
435
461
|
* **When to use**
|
|
436
462
|
*
|
|
437
|
-
*
|
|
463
|
+
* Use when you need to branch on whether an array has elements.
|
|
438
464
|
* - `onNonEmpty` receives a `NonEmptyReadonlyArray`.
|
|
439
465
|
* - Dual: data-first or data-last.
|
|
440
466
|
*
|
|
@@ -466,7 +492,7 @@ export declare const match: {
|
|
|
466
492
|
*
|
|
467
493
|
* **When to use**
|
|
468
494
|
*
|
|
469
|
-
*
|
|
495
|
+
* Use when you need to branch on whether an array has elements.
|
|
470
496
|
* - `onNonEmpty` receives a `NonEmptyReadonlyArray`.
|
|
471
497
|
* - Dual: data-first or data-last.
|
|
472
498
|
*
|
|
@@ -498,10 +524,14 @@ export declare const match: {
|
|
|
498
524
|
* Pattern-matches on an array from the left, providing the first element and
|
|
499
525
|
* the remaining elements separately.
|
|
500
526
|
*
|
|
527
|
+
* **When to use**
|
|
528
|
+
*
|
|
529
|
+
* Use to pattern-match when you need the first element and remaining elements as
|
|
530
|
+
* separate values.
|
|
531
|
+
*
|
|
501
532
|
* **Details**
|
|
502
533
|
*
|
|
503
|
-
*
|
|
504
|
-
* - Use when you want to process the first element differently from the rest.
|
|
534
|
+
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
505
535
|
*
|
|
506
536
|
* **Example** (Head and tail destructuring)
|
|
507
537
|
*
|
|
@@ -527,10 +557,14 @@ export declare const matchLeft: {
|
|
|
527
557
|
* Pattern-matches on an array from the left, providing the first element and
|
|
528
558
|
* the remaining elements separately.
|
|
529
559
|
*
|
|
560
|
+
* **When to use**
|
|
561
|
+
*
|
|
562
|
+
* Use to pattern-match when you need the first element and remaining elements as
|
|
563
|
+
* separate values.
|
|
564
|
+
*
|
|
530
565
|
* **Details**
|
|
531
566
|
*
|
|
532
|
-
*
|
|
533
|
-
* - Use when you want to process the first element differently from the rest.
|
|
567
|
+
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
534
568
|
*
|
|
535
569
|
* **Example** (Head and tail destructuring)
|
|
536
570
|
*
|
|
@@ -559,10 +593,14 @@ export declare const matchLeft: {
|
|
|
559
593
|
* Pattern-matches on an array from the left, providing the first element and
|
|
560
594
|
* the remaining elements separately.
|
|
561
595
|
*
|
|
596
|
+
* **When to use**
|
|
597
|
+
*
|
|
598
|
+
* Use to pattern-match when you need the first element and remaining elements as
|
|
599
|
+
* separate values.
|
|
600
|
+
*
|
|
562
601
|
* **Details**
|
|
563
602
|
*
|
|
564
|
-
*
|
|
565
|
-
* - Use when you want to process the first element differently from the rest.
|
|
603
|
+
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
566
604
|
*
|
|
567
605
|
* **Example** (Head and tail destructuring)
|
|
568
606
|
*
|
|
@@ -592,10 +630,14 @@ export declare const matchLeft: {
|
|
|
592
630
|
* Pattern-matches on an array from the right, providing all elements except the
|
|
593
631
|
* last and the last element separately.
|
|
594
632
|
*
|
|
633
|
+
* **When to use**
|
|
634
|
+
*
|
|
635
|
+
* Use to pattern-match when you need all but the last element and the last element
|
|
636
|
+
* as separate values.
|
|
637
|
+
*
|
|
595
638
|
* **Details**
|
|
596
639
|
*
|
|
597
|
-
*
|
|
598
|
-
* - Use when you want to process the last element differently from the rest.
|
|
640
|
+
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
599
641
|
*
|
|
600
642
|
* **Example** (Init and last destructuring)
|
|
601
643
|
*
|
|
@@ -621,10 +663,14 @@ export declare const matchRight: {
|
|
|
621
663
|
* Pattern-matches on an array from the right, providing all elements except the
|
|
622
664
|
* last and the last element separately.
|
|
623
665
|
*
|
|
666
|
+
* **When to use**
|
|
667
|
+
*
|
|
668
|
+
* Use to pattern-match when you need all but the last element and the last element
|
|
669
|
+
* as separate values.
|
|
670
|
+
*
|
|
624
671
|
* **Details**
|
|
625
672
|
*
|
|
626
|
-
*
|
|
627
|
-
* - Use when you want to process the last element differently from the rest.
|
|
673
|
+
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
628
674
|
*
|
|
629
675
|
* **Example** (Init and last destructuring)
|
|
630
676
|
*
|
|
@@ -653,10 +699,14 @@ export declare const matchRight: {
|
|
|
653
699
|
* Pattern-matches on an array from the right, providing all elements except the
|
|
654
700
|
* last and the last element separately.
|
|
655
701
|
*
|
|
702
|
+
* **When to use**
|
|
703
|
+
*
|
|
704
|
+
* Use to pattern-match when you need all but the last element and the last element
|
|
705
|
+
* as separate values.
|
|
706
|
+
*
|
|
656
707
|
* **Details**
|
|
657
708
|
*
|
|
658
|
-
*
|
|
659
|
-
* - Use when you want to process the last element differently from the rest.
|
|
709
|
+
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
660
710
|
*
|
|
661
711
|
* **Example** (Init and last destructuring)
|
|
662
712
|
*
|
|
@@ -685,6 +735,10 @@ export declare const matchRight: {
|
|
|
685
735
|
/**
|
|
686
736
|
* Adds a single element to the front of an iterable, returning a `NonEmptyArray`.
|
|
687
737
|
*
|
|
738
|
+
* **When to use**
|
|
739
|
+
*
|
|
740
|
+
* Use to add a single element at the start of an iterable and get a `NonEmptyArray`.
|
|
741
|
+
*
|
|
688
742
|
* **Details**
|
|
689
743
|
*
|
|
690
744
|
* - Always returns a non-empty array.
|
|
@@ -709,6 +763,10 @@ export declare const prepend: {
|
|
|
709
763
|
/**
|
|
710
764
|
* Adds a single element to the front of an iterable, returning a `NonEmptyArray`.
|
|
711
765
|
*
|
|
766
|
+
* **When to use**
|
|
767
|
+
*
|
|
768
|
+
* Use to add a single element at the start of an iterable and get a `NonEmptyArray`.
|
|
769
|
+
*
|
|
712
770
|
* **Details**
|
|
713
771
|
*
|
|
714
772
|
* - Always returns a non-empty array.
|
|
@@ -733,6 +791,10 @@ export declare const prepend: {
|
|
|
733
791
|
/**
|
|
734
792
|
* Adds a single element to the front of an iterable, returning a `NonEmptyArray`.
|
|
735
793
|
*
|
|
794
|
+
* **When to use**
|
|
795
|
+
*
|
|
796
|
+
* Use to add a single element at the start of an iterable and get a `NonEmptyArray`.
|
|
797
|
+
*
|
|
736
798
|
* **Details**
|
|
737
799
|
*
|
|
738
800
|
* - Always returns a non-empty array.
|
|
@@ -758,6 +820,10 @@ export declare const prepend: {
|
|
|
758
820
|
/**
|
|
759
821
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
760
822
|
*
|
|
823
|
+
* **When to use**
|
|
824
|
+
*
|
|
825
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
826
|
+
*
|
|
761
827
|
* **Details**
|
|
762
828
|
*
|
|
763
829
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -782,6 +848,10 @@ export declare const prependAll: {
|
|
|
782
848
|
/**
|
|
783
849
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
784
850
|
*
|
|
851
|
+
* **When to use**
|
|
852
|
+
*
|
|
853
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
854
|
+
*
|
|
785
855
|
* **Details**
|
|
786
856
|
*
|
|
787
857
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -806,6 +876,10 @@ export declare const prependAll: {
|
|
|
806
876
|
/**
|
|
807
877
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
808
878
|
*
|
|
879
|
+
* **When to use**
|
|
880
|
+
*
|
|
881
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
882
|
+
*
|
|
809
883
|
* **Details**
|
|
810
884
|
*
|
|
811
885
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -830,6 +904,10 @@ export declare const prependAll: {
|
|
|
830
904
|
/**
|
|
831
905
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
832
906
|
*
|
|
907
|
+
* **When to use**
|
|
908
|
+
*
|
|
909
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
910
|
+
*
|
|
833
911
|
* **Details**
|
|
834
912
|
*
|
|
835
913
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -854,6 +932,10 @@ export declare const prependAll: {
|
|
|
854
932
|
/**
|
|
855
933
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
856
934
|
*
|
|
935
|
+
* **When to use**
|
|
936
|
+
*
|
|
937
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
938
|
+
*
|
|
857
939
|
* **Details**
|
|
858
940
|
*
|
|
859
941
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -879,6 +961,11 @@ export declare const prependAll: {
|
|
|
879
961
|
/**
|
|
880
962
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
881
963
|
*
|
|
964
|
+
* **When to use**
|
|
965
|
+
*
|
|
966
|
+
* Use to add one element to the end of an iterable and get a new
|
|
967
|
+
* `NonEmptyArray`.
|
|
968
|
+
*
|
|
882
969
|
* **Details**
|
|
883
970
|
*
|
|
884
971
|
* - Always returns a non-empty array.
|
|
@@ -903,6 +990,11 @@ export declare const append: {
|
|
|
903
990
|
/**
|
|
904
991
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
905
992
|
*
|
|
993
|
+
* **When to use**
|
|
994
|
+
*
|
|
995
|
+
* Use to add one element to the end of an iterable and get a new
|
|
996
|
+
* `NonEmptyArray`.
|
|
997
|
+
*
|
|
906
998
|
* **Details**
|
|
907
999
|
*
|
|
908
1000
|
* - Always returns a non-empty array.
|
|
@@ -927,6 +1019,11 @@ export declare const append: {
|
|
|
927
1019
|
/**
|
|
928
1020
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
929
1021
|
*
|
|
1022
|
+
* **When to use**
|
|
1023
|
+
*
|
|
1024
|
+
* Use to add one element to the end of an iterable and get a new
|
|
1025
|
+
* `NonEmptyArray`.
|
|
1026
|
+
*
|
|
930
1027
|
* **Details**
|
|
931
1028
|
*
|
|
932
1029
|
* - Always returns a non-empty array.
|
|
@@ -952,6 +1049,11 @@ export declare const append: {
|
|
|
952
1049
|
/**
|
|
953
1050
|
* Concatenates two iterables into a single array.
|
|
954
1051
|
*
|
|
1052
|
+
* **When to use**
|
|
1053
|
+
*
|
|
1054
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
1055
|
+
* elements after the first.
|
|
1056
|
+
*
|
|
955
1057
|
* **Details**
|
|
956
1058
|
*
|
|
957
1059
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -976,6 +1078,11 @@ export declare const appendAll: {
|
|
|
976
1078
|
/**
|
|
977
1079
|
* Concatenates two iterables into a single array.
|
|
978
1080
|
*
|
|
1081
|
+
* **When to use**
|
|
1082
|
+
*
|
|
1083
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
1084
|
+
* elements after the first.
|
|
1085
|
+
*
|
|
979
1086
|
* **Details**
|
|
980
1087
|
*
|
|
981
1088
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -1000,6 +1107,11 @@ export declare const appendAll: {
|
|
|
1000
1107
|
/**
|
|
1001
1108
|
* Concatenates two iterables into a single array.
|
|
1002
1109
|
*
|
|
1110
|
+
* **When to use**
|
|
1111
|
+
*
|
|
1112
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
1113
|
+
* elements after the first.
|
|
1114
|
+
*
|
|
1003
1115
|
* **Details**
|
|
1004
1116
|
*
|
|
1005
1117
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -1024,6 +1136,11 @@ export declare const appendAll: {
|
|
|
1024
1136
|
/**
|
|
1025
1137
|
* Concatenates two iterables into a single array.
|
|
1026
1138
|
*
|
|
1139
|
+
* **When to use**
|
|
1140
|
+
*
|
|
1141
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
1142
|
+
* elements after the first.
|
|
1143
|
+
*
|
|
1027
1144
|
* **Details**
|
|
1028
1145
|
*
|
|
1029
1146
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -1048,6 +1165,11 @@ export declare const appendAll: {
|
|
|
1048
1165
|
/**
|
|
1049
1166
|
* Concatenates two iterables into a single array.
|
|
1050
1167
|
*
|
|
1168
|
+
* **When to use**
|
|
1169
|
+
*
|
|
1170
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
1171
|
+
* elements after the first.
|
|
1172
|
+
*
|
|
1051
1173
|
* **Details**
|
|
1052
1174
|
*
|
|
1053
1175
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
@@ -1073,6 +1195,10 @@ export declare const appendAll: {
|
|
|
1073
1195
|
/**
|
|
1074
1196
|
* Left-to-right fold that keeps every intermediate accumulator value.
|
|
1075
1197
|
*
|
|
1198
|
+
* **When to use**
|
|
1199
|
+
*
|
|
1200
|
+
* Use to compute a running accumulator where each intermediate value is needed.
|
|
1201
|
+
*
|
|
1076
1202
|
* **Details**
|
|
1077
1203
|
*
|
|
1078
1204
|
* - The output length is `input.length + 1` (starts with the initial value).
|
|
@@ -1098,6 +1224,10 @@ export declare const scan: {
|
|
|
1098
1224
|
/**
|
|
1099
1225
|
* Left-to-right fold that keeps every intermediate accumulator value.
|
|
1100
1226
|
*
|
|
1227
|
+
* **When to use**
|
|
1228
|
+
*
|
|
1229
|
+
* Use to compute a running accumulator where each intermediate value is needed.
|
|
1230
|
+
*
|
|
1101
1231
|
* **Details**
|
|
1102
1232
|
*
|
|
1103
1233
|
* - The output length is `input.length + 1` (starts with the initial value).
|
|
@@ -1123,6 +1253,10 @@ export declare const scan: {
|
|
|
1123
1253
|
/**
|
|
1124
1254
|
* Left-to-right fold that keeps every intermediate accumulator value.
|
|
1125
1255
|
*
|
|
1256
|
+
* **When to use**
|
|
1257
|
+
*
|
|
1258
|
+
* Use to compute a running accumulator where each intermediate value is needed.
|
|
1259
|
+
*
|
|
1126
1260
|
* **Details**
|
|
1127
1261
|
*
|
|
1128
1262
|
* - The output length is `input.length + 1` (starts with the initial value).
|
|
@@ -1149,6 +1283,11 @@ export declare const scan: {
|
|
|
1149
1283
|
/**
|
|
1150
1284
|
* Right-to-left fold that keeps every intermediate accumulator value.
|
|
1151
1285
|
*
|
|
1286
|
+
* **When to use**
|
|
1287
|
+
*
|
|
1288
|
+
* Use to compute a running accumulator from right to left where each intermediate
|
|
1289
|
+
* value is needed.
|
|
1290
|
+
*
|
|
1152
1291
|
* **Details**
|
|
1153
1292
|
*
|
|
1154
1293
|
* - The output length is `input.length + 1` (ends with the initial value).
|
|
@@ -1173,6 +1312,11 @@ export declare const scanRight: {
|
|
|
1173
1312
|
/**
|
|
1174
1313
|
* Right-to-left fold that keeps every intermediate accumulator value.
|
|
1175
1314
|
*
|
|
1315
|
+
* **When to use**
|
|
1316
|
+
*
|
|
1317
|
+
* Use to compute a running accumulator from right to left where each intermediate
|
|
1318
|
+
* value is needed.
|
|
1319
|
+
*
|
|
1176
1320
|
* **Details**
|
|
1177
1321
|
*
|
|
1178
1322
|
* - The output length is `input.length + 1` (ends with the initial value).
|
|
@@ -1197,6 +1341,11 @@ export declare const scanRight: {
|
|
|
1197
1341
|
/**
|
|
1198
1342
|
* Right-to-left fold that keeps every intermediate accumulator value.
|
|
1199
1343
|
*
|
|
1344
|
+
* **When to use**
|
|
1345
|
+
*
|
|
1346
|
+
* Use to compute a running accumulator from right to left where each intermediate
|
|
1347
|
+
* value is needed.
|
|
1348
|
+
*
|
|
1200
1349
|
* **Details**
|
|
1201
1350
|
*
|
|
1202
1351
|
* - The output length is `input.length + 1` (ends with the initial value).
|
|
@@ -1222,6 +1371,10 @@ export declare const scanRight: {
|
|
|
1222
1371
|
/**
|
|
1223
1372
|
* Tests whether a value is an `Array`.
|
|
1224
1373
|
*
|
|
1374
|
+
* **When to use**
|
|
1375
|
+
*
|
|
1376
|
+
* Use to verify a value is a mutable array, narrowing its type to `Array<unknown>`.
|
|
1377
|
+
*
|
|
1225
1378
|
* **Details**
|
|
1226
1379
|
*
|
|
1227
1380
|
* - Acts as a type guard narrowing the input to `Array<unknown>`.
|
|
@@ -1246,6 +1399,10 @@ export declare const isArray: {
|
|
|
1246
1399
|
/**
|
|
1247
1400
|
* Tests whether a value is an `Array`.
|
|
1248
1401
|
*
|
|
1402
|
+
* **When to use**
|
|
1403
|
+
*
|
|
1404
|
+
* Use to verify a value is a mutable array, narrowing its type to `Array<unknown>`.
|
|
1405
|
+
*
|
|
1249
1406
|
* **Details**
|
|
1250
1407
|
*
|
|
1251
1408
|
* - Acts as a type guard narrowing the input to `Array<unknown>`.
|
|
@@ -1270,6 +1427,10 @@ export declare const isArray: {
|
|
|
1270
1427
|
/**
|
|
1271
1428
|
* Tests whether a value is an `Array`.
|
|
1272
1429
|
*
|
|
1430
|
+
* **When to use**
|
|
1431
|
+
*
|
|
1432
|
+
* Use to verify a value is a mutable array, narrowing its type to `Array<unknown>`.
|
|
1433
|
+
*
|
|
1273
1434
|
* **Details**
|
|
1274
1435
|
*
|
|
1275
1436
|
* - Acts as a type guard narrowing the input to `Array<unknown>`.
|
|
@@ -1373,6 +1534,10 @@ export declare const isReadonlyArrayNonEmpty: <A>(self: ReadonlyArray<A>) => sel
|
|
|
1373
1534
|
/**
|
|
1374
1535
|
* Returns the number of elements in a `ReadonlyArray`.
|
|
1375
1536
|
*
|
|
1537
|
+
* **When to use**
|
|
1538
|
+
*
|
|
1539
|
+
* Use when you need length as a composable function rather than a property access.
|
|
1540
|
+
*
|
|
1376
1541
|
* **Example** (Getting the length)
|
|
1377
1542
|
*
|
|
1378
1543
|
* ```ts
|
|
@@ -1389,6 +1554,11 @@ export declare const length: <A>(self: ReadonlyArray<A>) => number;
|
|
|
1389
1554
|
* Safely reads an element at the given index, returning `Option.some` or
|
|
1390
1555
|
* `Option.none` if the index is out of bounds.
|
|
1391
1556
|
*
|
|
1557
|
+
* **When to use**
|
|
1558
|
+
*
|
|
1559
|
+
* Use when you need to read an array element by index and handle an
|
|
1560
|
+
* out-of-bounds index as `Option.none`.
|
|
1561
|
+
*
|
|
1392
1562
|
* **Details**
|
|
1393
1563
|
*
|
|
1394
1564
|
* - The index is floored to an integer.
|
|
@@ -1403,9 +1573,9 @@ export declare const length: <A>(self: ReadonlyArray<A>) => number;
|
|
|
1403
1573
|
* console.log(Array.get([1, 2, 3], 10)) // None
|
|
1404
1574
|
* ```
|
|
1405
1575
|
*
|
|
1406
|
-
* @see {@link getUnsafe}
|
|
1407
|
-
* @see {@link head}
|
|
1408
|
-
* @see {@link last}
|
|
1576
|
+
* @see {@link getUnsafe} for indexed access that throws when the index is out of bounds
|
|
1577
|
+
* @see {@link head} for reading the first element as an `Option`
|
|
1578
|
+
* @see {@link last} for reading the last element as an `Option`
|
|
1409
1579
|
*
|
|
1410
1580
|
* @category getters
|
|
1411
1581
|
* @since 2.0.0
|
|
@@ -1415,6 +1585,11 @@ export declare const get: {
|
|
|
1415
1585
|
* Safely reads an element at the given index, returning `Option.some` or
|
|
1416
1586
|
* `Option.none` if the index is out of bounds.
|
|
1417
1587
|
*
|
|
1588
|
+
* **When to use**
|
|
1589
|
+
*
|
|
1590
|
+
* Use when you need to read an array element by index and handle an
|
|
1591
|
+
* out-of-bounds index as `Option.none`.
|
|
1592
|
+
*
|
|
1418
1593
|
* **Details**
|
|
1419
1594
|
*
|
|
1420
1595
|
* - The index is floored to an integer.
|
|
@@ -1429,9 +1604,9 @@ export declare const get: {
|
|
|
1429
1604
|
* console.log(Array.get([1, 2, 3], 10)) // None
|
|
1430
1605
|
* ```
|
|
1431
1606
|
*
|
|
1432
|
-
* @see {@link getUnsafe}
|
|
1433
|
-
* @see {@link head}
|
|
1434
|
-
* @see {@link last}
|
|
1607
|
+
* @see {@link getUnsafe} for indexed access that throws when the index is out of bounds
|
|
1608
|
+
* @see {@link head} for reading the first element as an `Option`
|
|
1609
|
+
* @see {@link last} for reading the last element as an `Option`
|
|
1435
1610
|
*
|
|
1436
1611
|
* @category getters
|
|
1437
1612
|
* @since 2.0.0
|
|
@@ -1441,6 +1616,11 @@ export declare const get: {
|
|
|
1441
1616
|
* Safely reads an element at the given index, returning `Option.some` or
|
|
1442
1617
|
* `Option.none` if the index is out of bounds.
|
|
1443
1618
|
*
|
|
1619
|
+
* **When to use**
|
|
1620
|
+
*
|
|
1621
|
+
* Use when you need to read an array element by index and handle an
|
|
1622
|
+
* out-of-bounds index as `Option.none`.
|
|
1623
|
+
*
|
|
1444
1624
|
* **Details**
|
|
1445
1625
|
*
|
|
1446
1626
|
* - The index is floored to an integer.
|
|
@@ -1455,9 +1635,9 @@ export declare const get: {
|
|
|
1455
1635
|
* console.log(Array.get([1, 2, 3], 10)) // None
|
|
1456
1636
|
* ```
|
|
1457
1637
|
*
|
|
1458
|
-
* @see {@link getUnsafe}
|
|
1459
|
-
* @see {@link head}
|
|
1460
|
-
* @see {@link last}
|
|
1638
|
+
* @see {@link getUnsafe} for indexed access that throws when the index is out of bounds
|
|
1639
|
+
* @see {@link head} for reading the first element as an `Option`
|
|
1640
|
+
* @see {@link last} for reading the last element as an `Option`
|
|
1461
1641
|
*
|
|
1462
1642
|
* @category getters
|
|
1463
1643
|
* @since 2.0.0
|
|
@@ -1467,6 +1647,11 @@ export declare const get: {
|
|
|
1467
1647
|
/**
|
|
1468
1648
|
* Reads an element at the given index, throwing if the index is out of bounds.
|
|
1469
1649
|
*
|
|
1650
|
+
* **When to use**
|
|
1651
|
+
*
|
|
1652
|
+
* Use to read an element at a known valid index when out-of-bounds would be a
|
|
1653
|
+
* programming error.
|
|
1654
|
+
*
|
|
1470
1655
|
* **Details**
|
|
1471
1656
|
*
|
|
1472
1657
|
* - Throws an `Error` with the message `"Index out of bounds: <i>"`.
|
|
@@ -1490,6 +1675,11 @@ export declare const getUnsafe: {
|
|
|
1490
1675
|
/**
|
|
1491
1676
|
* Reads an element at the given index, throwing if the index is out of bounds.
|
|
1492
1677
|
*
|
|
1678
|
+
* **When to use**
|
|
1679
|
+
*
|
|
1680
|
+
* Use to read an element at a known valid index when out-of-bounds would be a
|
|
1681
|
+
* programming error.
|
|
1682
|
+
*
|
|
1493
1683
|
* **Details**
|
|
1494
1684
|
*
|
|
1495
1685
|
* - Throws an `Error` with the message `"Index out of bounds: <i>"`.
|
|
@@ -1513,6 +1703,11 @@ export declare const getUnsafe: {
|
|
|
1513
1703
|
/**
|
|
1514
1704
|
* Reads an element at the given index, throwing if the index is out of bounds.
|
|
1515
1705
|
*
|
|
1706
|
+
* **When to use**
|
|
1707
|
+
*
|
|
1708
|
+
* Use to read an element at a known valid index when out-of-bounds would be a
|
|
1709
|
+
* programming error.
|
|
1710
|
+
*
|
|
1516
1711
|
* **Details**
|
|
1517
1712
|
*
|
|
1518
1713
|
* - Throws an `Error` with the message `"Index out of bounds: <i>"`.
|
|
@@ -1537,6 +1732,11 @@ export declare const getUnsafe: {
|
|
|
1537
1732
|
/**
|
|
1538
1733
|
* Splits a non-empty array into its first element and the remaining elements.
|
|
1539
1734
|
*
|
|
1735
|
+
* **When to use**
|
|
1736
|
+
*
|
|
1737
|
+
* Use when you have a `NonEmptyReadonlyArray` and need both its first element
|
|
1738
|
+
* and the remaining elements as separate values.
|
|
1739
|
+
*
|
|
1540
1740
|
* **Details**
|
|
1541
1741
|
*
|
|
1542
1742
|
* - Returns a tuple `[head, tail]`.
|
|
@@ -1551,9 +1751,9 @@ export declare const getUnsafe: {
|
|
|
1551
1751
|
* console.log(result) // [1, [2, 3, 4]]
|
|
1552
1752
|
* ```
|
|
1553
1753
|
*
|
|
1554
|
-
* @see {@link unappend}
|
|
1555
|
-
* @see {@link headNonEmpty}
|
|
1556
|
-
* @see {@link tailNonEmpty}
|
|
1754
|
+
* @see {@link unappend} for splitting a non-empty array into init and last
|
|
1755
|
+
* @see {@link headNonEmpty} for getting only the first element
|
|
1756
|
+
* @see {@link tailNonEmpty} for getting only the elements after the first
|
|
1557
1757
|
*
|
|
1558
1758
|
* @category splitting
|
|
1559
1759
|
* @since 2.0.0
|
|
@@ -1563,6 +1763,11 @@ export declare const unprepend: <A>(self: NonEmptyReadonlyArray<A>) => [firstEle
|
|
|
1563
1763
|
* Splits a non-empty array into all elements except the last, and the last
|
|
1564
1764
|
* element.
|
|
1565
1765
|
*
|
|
1766
|
+
* **When to use**
|
|
1767
|
+
*
|
|
1768
|
+
* Use to split a non-empty array from the end when you need both the elements
|
|
1769
|
+
* before the last element and the last element.
|
|
1770
|
+
*
|
|
1566
1771
|
* **Details**
|
|
1567
1772
|
*
|
|
1568
1773
|
* - Returns a tuple `[init, last]`.
|
|
@@ -1577,9 +1782,9 @@ export declare const unprepend: <A>(self: NonEmptyReadonlyArray<A>) => [firstEle
|
|
|
1577
1782
|
* console.log(result) // [[1, 2, 3], 4]
|
|
1578
1783
|
* ```
|
|
1579
1784
|
*
|
|
1580
|
-
* @see {@link unprepend}
|
|
1581
|
-
* @see {@link initNonEmpty}
|
|
1582
|
-
* @see {@link lastNonEmpty}
|
|
1785
|
+
* @see {@link unprepend} for splitting a non-empty array into head and tail
|
|
1786
|
+
* @see {@link initNonEmpty} for getting only the elements before the last
|
|
1787
|
+
* @see {@link lastNonEmpty} for getting only the last element
|
|
1583
1788
|
*
|
|
1584
1789
|
* @category splitting
|
|
1585
1790
|
* @since 2.0.0
|
|
@@ -1589,6 +1794,10 @@ export declare const unappend: <A>(self: NonEmptyReadonlyArray<A>) => [arrayWith
|
|
|
1589
1794
|
* Returns the first element of an array wrapped in `Option.some`, or
|
|
1590
1795
|
* `Option.none` if the array is empty.
|
|
1591
1796
|
*
|
|
1797
|
+
* **When to use**
|
|
1798
|
+
*
|
|
1799
|
+
* Use to safely get the first element of an array that may be empty.
|
|
1800
|
+
*
|
|
1592
1801
|
* **Example** (Getting the first element)
|
|
1593
1802
|
*
|
|
1594
1803
|
* ```ts
|
|
@@ -1609,6 +1818,11 @@ export declare const head: <A>(self: ReadonlyArray<A>) => Option.Option<A>;
|
|
|
1609
1818
|
* Returns the first element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
1610
1819
|
* wrapper).
|
|
1611
1820
|
*
|
|
1821
|
+
* **When to use**
|
|
1822
|
+
*
|
|
1823
|
+
* Use to get the first element without `Option` wrapping when the array is known
|
|
1824
|
+
* to be non-empty.
|
|
1825
|
+
*
|
|
1612
1826
|
* **Example** (Getting the head of a non-empty array)
|
|
1613
1827
|
*
|
|
1614
1828
|
* ```ts
|
|
@@ -1627,6 +1841,10 @@ export declare const headNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => A;
|
|
|
1627
1841
|
* Returns the last element of an array wrapped in `Option.some`, or
|
|
1628
1842
|
* `Option.none` if the array is empty.
|
|
1629
1843
|
*
|
|
1844
|
+
* **When to use**
|
|
1845
|
+
*
|
|
1846
|
+
* Use to safely get the last element of an array that may be empty.
|
|
1847
|
+
*
|
|
1630
1848
|
* **Example** (Getting the last element)
|
|
1631
1849
|
*
|
|
1632
1850
|
* ```ts
|
|
@@ -1647,6 +1865,11 @@ export declare const last: <A>(self: ReadonlyArray<A>) => Option.Option<A>;
|
|
|
1647
1865
|
* Returns the last element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
1648
1866
|
* wrapper).
|
|
1649
1867
|
*
|
|
1868
|
+
* **When to use**
|
|
1869
|
+
*
|
|
1870
|
+
* Use to get the last element without `Option` wrapping when the array is known
|
|
1871
|
+
* to be non-empty.
|
|
1872
|
+
*
|
|
1650
1873
|
* **Example** (Getting the last of a non-empty array)
|
|
1651
1874
|
*
|
|
1652
1875
|
* ```ts
|
|
@@ -1664,6 +1887,10 @@ export declare const lastNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => A;
|
|
|
1664
1887
|
/**
|
|
1665
1888
|
* Returns all elements except the first, wrapped in an `Option`.
|
|
1666
1889
|
*
|
|
1890
|
+
* **When to use**
|
|
1891
|
+
*
|
|
1892
|
+
* Use to safely get all elements after the first when the iterable may be empty.
|
|
1893
|
+
*
|
|
1667
1894
|
* **Details**
|
|
1668
1895
|
*
|
|
1669
1896
|
* - Allocates a new array via `slice(1)`.
|
|
@@ -1688,6 +1915,10 @@ export declare function tail<A>(self: Iterable<A>): Option.Option<Array<A>>;
|
|
|
1688
1915
|
/**
|
|
1689
1916
|
* Returns all elements except the first of a `NonEmptyReadonlyArray`.
|
|
1690
1917
|
*
|
|
1918
|
+
* **When to use**
|
|
1919
|
+
*
|
|
1920
|
+
* Use to get all elements after the first when the array is known to be non-empty.
|
|
1921
|
+
*
|
|
1691
1922
|
* **Example** (Getting the tail of a non-empty array)
|
|
1692
1923
|
*
|
|
1693
1924
|
* ```ts
|
|
@@ -1706,6 +1937,10 @@ export declare const tailNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => Array<
|
|
|
1706
1937
|
/**
|
|
1707
1938
|
* Returns all elements except the last, wrapped in an `Option`.
|
|
1708
1939
|
*
|
|
1940
|
+
* **When to use**
|
|
1941
|
+
*
|
|
1942
|
+
* Use to safely get all elements before the last when the iterable may be empty.
|
|
1943
|
+
*
|
|
1709
1944
|
* **Details**
|
|
1710
1945
|
*
|
|
1711
1946
|
* - Allocates a new array via `slice(0, -1)`.
|
|
@@ -1730,6 +1965,10 @@ export declare function init<A>(self: Iterable<A>): Option.Option<Array<A>>;
|
|
|
1730
1965
|
/**
|
|
1731
1966
|
* Returns all elements except the last of a `NonEmptyReadonlyArray`.
|
|
1732
1967
|
*
|
|
1968
|
+
* **When to use**
|
|
1969
|
+
*
|
|
1970
|
+
* Use to get all elements before the last when the array is known to be non-empty.
|
|
1971
|
+
*
|
|
1733
1972
|
* **Example** (Getting init of a non-empty array)
|
|
1734
1973
|
*
|
|
1735
1974
|
* ```ts
|
|
@@ -1748,6 +1987,10 @@ export declare const initNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => Array<
|
|
|
1748
1987
|
/**
|
|
1749
1988
|
* Keeps the first `n` elements, creating a new array.
|
|
1750
1989
|
*
|
|
1990
|
+
* **When to use**
|
|
1991
|
+
*
|
|
1992
|
+
* Use to keep up to the first `n` elements from an iterable as a new array.
|
|
1993
|
+
*
|
|
1751
1994
|
* **Details**
|
|
1752
1995
|
*
|
|
1753
1996
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1761,9 +2004,9 @@ export declare const initNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => Array<
|
|
|
1761
2004
|
* console.log(Array.take([1, 2, 3, 4, 5], 3)) // [1, 2, 3]
|
|
1762
2005
|
* ```
|
|
1763
2006
|
*
|
|
1764
|
-
* @see {@link takeRight}
|
|
1765
|
-
* @see {@link takeWhile}
|
|
1766
|
-
* @see {@link drop}
|
|
2007
|
+
* @see {@link takeRight} for keeping elements from the end
|
|
2008
|
+
* @see {@link takeWhile} for keeping an initial prefix while a predicate holds
|
|
2009
|
+
* @see {@link drop} for removing elements from the start
|
|
1767
2010
|
*
|
|
1768
2011
|
* @category getters
|
|
1769
2012
|
* @since 2.0.0
|
|
@@ -1772,6 +2015,10 @@ export declare const take: {
|
|
|
1772
2015
|
/**
|
|
1773
2016
|
* Keeps the first `n` elements, creating a new array.
|
|
1774
2017
|
*
|
|
2018
|
+
* **When to use**
|
|
2019
|
+
*
|
|
2020
|
+
* Use to keep up to the first `n` elements from an iterable as a new array.
|
|
2021
|
+
*
|
|
1775
2022
|
* **Details**
|
|
1776
2023
|
*
|
|
1777
2024
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1785,9 +2032,9 @@ export declare const take: {
|
|
|
1785
2032
|
* console.log(Array.take([1, 2, 3, 4, 5], 3)) // [1, 2, 3]
|
|
1786
2033
|
* ```
|
|
1787
2034
|
*
|
|
1788
|
-
* @see {@link takeRight}
|
|
1789
|
-
* @see {@link takeWhile}
|
|
1790
|
-
* @see {@link drop}
|
|
2035
|
+
* @see {@link takeRight} for keeping elements from the end
|
|
2036
|
+
* @see {@link takeWhile} for keeping an initial prefix while a predicate holds
|
|
2037
|
+
* @see {@link drop} for removing elements from the start
|
|
1791
2038
|
*
|
|
1792
2039
|
* @category getters
|
|
1793
2040
|
* @since 2.0.0
|
|
@@ -1796,6 +2043,10 @@ export declare const take: {
|
|
|
1796
2043
|
/**
|
|
1797
2044
|
* Keeps the first `n` elements, creating a new array.
|
|
1798
2045
|
*
|
|
2046
|
+
* **When to use**
|
|
2047
|
+
*
|
|
2048
|
+
* Use to keep up to the first `n` elements from an iterable as a new array.
|
|
2049
|
+
*
|
|
1799
2050
|
* **Details**
|
|
1800
2051
|
*
|
|
1801
2052
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1809,9 +2060,9 @@ export declare const take: {
|
|
|
1809
2060
|
* console.log(Array.take([1, 2, 3, 4, 5], 3)) // [1, 2, 3]
|
|
1810
2061
|
* ```
|
|
1811
2062
|
*
|
|
1812
|
-
* @see {@link takeRight}
|
|
1813
|
-
* @see {@link takeWhile}
|
|
1814
|
-
* @see {@link drop}
|
|
2063
|
+
* @see {@link takeRight} for keeping elements from the end
|
|
2064
|
+
* @see {@link takeWhile} for keeping an initial prefix while a predicate holds
|
|
2065
|
+
* @see {@link drop} for removing elements from the start
|
|
1815
2066
|
*
|
|
1816
2067
|
* @category getters
|
|
1817
2068
|
* @since 2.0.0
|
|
@@ -1821,6 +2072,10 @@ export declare const take: {
|
|
|
1821
2072
|
/**
|
|
1822
2073
|
* Keeps the last `n` elements, creating a new array.
|
|
1823
2074
|
*
|
|
2075
|
+
* **When to use**
|
|
2076
|
+
*
|
|
2077
|
+
* Use to keep the last `n` elements of an iterable.
|
|
2078
|
+
*
|
|
1824
2079
|
* **Details**
|
|
1825
2080
|
*
|
|
1826
2081
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1844,6 +2099,10 @@ export declare const takeRight: {
|
|
|
1844
2099
|
/**
|
|
1845
2100
|
* Keeps the last `n` elements, creating a new array.
|
|
1846
2101
|
*
|
|
2102
|
+
* **When to use**
|
|
2103
|
+
*
|
|
2104
|
+
* Use to keep the last `n` elements of an iterable.
|
|
2105
|
+
*
|
|
1847
2106
|
* **Details**
|
|
1848
2107
|
*
|
|
1849
2108
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1867,6 +2126,10 @@ export declare const takeRight: {
|
|
|
1867
2126
|
/**
|
|
1868
2127
|
* Keeps the last `n` elements, creating a new array.
|
|
1869
2128
|
*
|
|
2129
|
+
* **When to use**
|
|
2130
|
+
*
|
|
2131
|
+
* Use to keep the last `n` elements of an iterable.
|
|
2132
|
+
*
|
|
1870
2133
|
* **Details**
|
|
1871
2134
|
*
|
|
1872
2135
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1892,6 +2155,11 @@ export declare const takeRight: {
|
|
|
1892
2155
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1893
2156
|
* first element that fails.
|
|
1894
2157
|
*
|
|
2158
|
+
* **When to use**
|
|
2159
|
+
*
|
|
2160
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
2161
|
+
* a predicate, returning the retained prefix as an array.
|
|
2162
|
+
*
|
|
1895
2163
|
* **Details**
|
|
1896
2164
|
*
|
|
1897
2165
|
* - Supports refinements for type narrowing.
|
|
@@ -1905,9 +2173,9 @@ export declare const takeRight: {
|
|
|
1905
2173
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
1906
2174
|
* ```
|
|
1907
2175
|
*
|
|
1908
|
-
* @see {@link take}
|
|
1909
|
-
* @see {@link dropWhile}
|
|
1910
|
-
* @see {@link span}
|
|
2176
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
2177
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
2178
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
1911
2179
|
*
|
|
1912
2180
|
* @category getters
|
|
1913
2181
|
* @since 2.0.0
|
|
@@ -1917,6 +2185,11 @@ export declare const takeWhile: {
|
|
|
1917
2185
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1918
2186
|
* first element that fails.
|
|
1919
2187
|
*
|
|
2188
|
+
* **When to use**
|
|
2189
|
+
*
|
|
2190
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
2191
|
+
* a predicate, returning the retained prefix as an array.
|
|
2192
|
+
*
|
|
1920
2193
|
* **Details**
|
|
1921
2194
|
*
|
|
1922
2195
|
* - Supports refinements for type narrowing.
|
|
@@ -1930,9 +2203,9 @@ export declare const takeWhile: {
|
|
|
1930
2203
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
1931
2204
|
* ```
|
|
1932
2205
|
*
|
|
1933
|
-
* @see {@link take}
|
|
1934
|
-
* @see {@link dropWhile}
|
|
1935
|
-
* @see {@link span}
|
|
2206
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
2207
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
2208
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
1936
2209
|
*
|
|
1937
2210
|
* @category getters
|
|
1938
2211
|
* @since 2.0.0
|
|
@@ -1942,6 +2215,11 @@ export declare const takeWhile: {
|
|
|
1942
2215
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1943
2216
|
* first element that fails.
|
|
1944
2217
|
*
|
|
2218
|
+
* **When to use**
|
|
2219
|
+
*
|
|
2220
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
2221
|
+
* a predicate, returning the retained prefix as an array.
|
|
2222
|
+
*
|
|
1945
2223
|
* **Details**
|
|
1946
2224
|
*
|
|
1947
2225
|
* - Supports refinements for type narrowing.
|
|
@@ -1955,9 +2233,9 @@ export declare const takeWhile: {
|
|
|
1955
2233
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
1956
2234
|
* ```
|
|
1957
2235
|
*
|
|
1958
|
-
* @see {@link take}
|
|
1959
|
-
* @see {@link dropWhile}
|
|
1960
|
-
* @see {@link span}
|
|
2236
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
2237
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
2238
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
1961
2239
|
*
|
|
1962
2240
|
* @category getters
|
|
1963
2241
|
* @since 2.0.0
|
|
@@ -1967,6 +2245,11 @@ export declare const takeWhile: {
|
|
|
1967
2245
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1968
2246
|
* first element that fails.
|
|
1969
2247
|
*
|
|
2248
|
+
* **When to use**
|
|
2249
|
+
*
|
|
2250
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
2251
|
+
* a predicate, returning the retained prefix as an array.
|
|
2252
|
+
*
|
|
1970
2253
|
* **Details**
|
|
1971
2254
|
*
|
|
1972
2255
|
* - Supports refinements for type narrowing.
|
|
@@ -1980,9 +2263,9 @@ export declare const takeWhile: {
|
|
|
1980
2263
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
1981
2264
|
* ```
|
|
1982
2265
|
*
|
|
1983
|
-
* @see {@link take}
|
|
1984
|
-
* @see {@link dropWhile}
|
|
1985
|
-
* @see {@link span}
|
|
2266
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
2267
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
2268
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
1986
2269
|
*
|
|
1987
2270
|
* @category getters
|
|
1988
2271
|
* @since 2.0.0
|
|
@@ -1992,6 +2275,11 @@ export declare const takeWhile: {
|
|
|
1992
2275
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1993
2276
|
* first element that fails.
|
|
1994
2277
|
*
|
|
2278
|
+
* **When to use**
|
|
2279
|
+
*
|
|
2280
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
2281
|
+
* a predicate, returning the retained prefix as an array.
|
|
2282
|
+
*
|
|
1995
2283
|
* **Details**
|
|
1996
2284
|
*
|
|
1997
2285
|
* - Supports refinements for type narrowing.
|
|
@@ -2005,9 +2293,9 @@ export declare const takeWhile: {
|
|
|
2005
2293
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
2006
2294
|
* ```
|
|
2007
2295
|
*
|
|
2008
|
-
* @see {@link take}
|
|
2009
|
-
* @see {@link dropWhile}
|
|
2010
|
-
* @see {@link span}
|
|
2296
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
2297
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
2298
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
2011
2299
|
*
|
|
2012
2300
|
* @category getters
|
|
2013
2301
|
* @since 2.0.0
|
|
@@ -2017,11 +2305,19 @@ export declare const takeWhile: {
|
|
|
2017
2305
|
/**
|
|
2018
2306
|
* Takes elements from the start while a `Filter` succeeds, collecting transformed values.
|
|
2019
2307
|
*
|
|
2308
|
+
* **When to use**
|
|
2309
|
+
*
|
|
2310
|
+
* Use when you need to take a prefix of elements while a function can
|
|
2311
|
+
* successfully extract or transform them, stopping at the first element
|
|
2312
|
+
* that produces a failure result.
|
|
2313
|
+
*
|
|
2020
2314
|
* **Details**
|
|
2021
2315
|
*
|
|
2022
2316
|
* - The filter receives `(element, index)`.
|
|
2023
2317
|
* - Stops at the first filter failure.
|
|
2024
2318
|
*
|
|
2319
|
+
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2320
|
+
*
|
|
2025
2321
|
* @category getters
|
|
2026
2322
|
* @since 4.0.0
|
|
2027
2323
|
*/
|
|
@@ -2029,11 +2325,19 @@ export declare const takeWhileFilter: {
|
|
|
2029
2325
|
/**
|
|
2030
2326
|
* Takes elements from the start while a `Filter` succeeds, collecting transformed values.
|
|
2031
2327
|
*
|
|
2328
|
+
* **When to use**
|
|
2329
|
+
*
|
|
2330
|
+
* Use when you need to take a prefix of elements while a function can
|
|
2331
|
+
* successfully extract or transform them, stopping at the first element
|
|
2332
|
+
* that produces a failure result.
|
|
2333
|
+
*
|
|
2032
2334
|
* **Details**
|
|
2033
2335
|
*
|
|
2034
2336
|
* - The filter receives `(element, index)`.
|
|
2035
2337
|
* - Stops at the first filter failure.
|
|
2036
2338
|
*
|
|
2339
|
+
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2340
|
+
*
|
|
2037
2341
|
* @category getters
|
|
2038
2342
|
* @since 4.0.0
|
|
2039
2343
|
*/
|
|
@@ -2041,11 +2345,19 @@ export declare const takeWhileFilter: {
|
|
|
2041
2345
|
/**
|
|
2042
2346
|
* Takes elements from the start while a `Filter` succeeds, collecting transformed values.
|
|
2043
2347
|
*
|
|
2348
|
+
* **When to use**
|
|
2349
|
+
*
|
|
2350
|
+
* Use when you need to take a prefix of elements while a function can
|
|
2351
|
+
* successfully extract or transform them, stopping at the first element
|
|
2352
|
+
* that produces a failure result.
|
|
2353
|
+
*
|
|
2044
2354
|
* **Details**
|
|
2045
2355
|
*
|
|
2046
2356
|
* - The filter receives `(element, index)`.
|
|
2047
2357
|
* - Stops at the first filter failure.
|
|
2048
2358
|
*
|
|
2359
|
+
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2360
|
+
*
|
|
2049
2361
|
* @category getters
|
|
2050
2362
|
* @since 4.0.0
|
|
2051
2363
|
*/
|
|
@@ -2055,6 +2367,11 @@ export declare const takeWhileFilter: {
|
|
|
2055
2367
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
2056
2368
|
* holds, and the remaining elements.
|
|
2057
2369
|
*
|
|
2370
|
+
* **When to use**
|
|
2371
|
+
*
|
|
2372
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
2373
|
+
* and the elements after that prefix when you need both parts.
|
|
2374
|
+
*
|
|
2058
2375
|
* **Details**
|
|
2059
2376
|
*
|
|
2060
2377
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -2069,9 +2386,9 @@ export declare const takeWhileFilter: {
|
|
|
2069
2386
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
2070
2387
|
* ```
|
|
2071
2388
|
*
|
|
2072
|
-
* @see {@link takeWhile}
|
|
2073
|
-
* @see {@link dropWhile}
|
|
2074
|
-
* @see {@link splitWhere}
|
|
2389
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
2390
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
2391
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
2075
2392
|
*
|
|
2076
2393
|
* @category splitting
|
|
2077
2394
|
* @since 2.0.0
|
|
@@ -2081,6 +2398,11 @@ export declare const span: {
|
|
|
2081
2398
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
2082
2399
|
* holds, and the remaining elements.
|
|
2083
2400
|
*
|
|
2401
|
+
* **When to use**
|
|
2402
|
+
*
|
|
2403
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
2404
|
+
* and the elements after that prefix when you need both parts.
|
|
2405
|
+
*
|
|
2084
2406
|
* **Details**
|
|
2085
2407
|
*
|
|
2086
2408
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -2095,9 +2417,9 @@ export declare const span: {
|
|
|
2095
2417
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
2096
2418
|
* ```
|
|
2097
2419
|
*
|
|
2098
|
-
* @see {@link takeWhile}
|
|
2099
|
-
* @see {@link dropWhile}
|
|
2100
|
-
* @see {@link splitWhere}
|
|
2420
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
2421
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
2422
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
2101
2423
|
*
|
|
2102
2424
|
* @category splitting
|
|
2103
2425
|
* @since 2.0.0
|
|
@@ -2107,6 +2429,11 @@ export declare const span: {
|
|
|
2107
2429
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
2108
2430
|
* holds, and the remaining elements.
|
|
2109
2431
|
*
|
|
2432
|
+
* **When to use**
|
|
2433
|
+
*
|
|
2434
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
2435
|
+
* and the elements after that prefix when you need both parts.
|
|
2436
|
+
*
|
|
2110
2437
|
* **Details**
|
|
2111
2438
|
*
|
|
2112
2439
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -2121,9 +2448,9 @@ export declare const span: {
|
|
|
2121
2448
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
2122
2449
|
* ```
|
|
2123
2450
|
*
|
|
2124
|
-
* @see {@link takeWhile}
|
|
2125
|
-
* @see {@link dropWhile}
|
|
2126
|
-
* @see {@link splitWhere}
|
|
2451
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
2452
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
2453
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
2127
2454
|
*
|
|
2128
2455
|
* @category splitting
|
|
2129
2456
|
* @since 2.0.0
|
|
@@ -2133,6 +2460,11 @@ export declare const span: {
|
|
|
2133
2460
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
2134
2461
|
* holds, and the remaining elements.
|
|
2135
2462
|
*
|
|
2463
|
+
* **When to use**
|
|
2464
|
+
*
|
|
2465
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
2466
|
+
* and the elements after that prefix when you need both parts.
|
|
2467
|
+
*
|
|
2136
2468
|
* **Details**
|
|
2137
2469
|
*
|
|
2138
2470
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -2147,9 +2479,9 @@ export declare const span: {
|
|
|
2147
2479
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
2148
2480
|
* ```
|
|
2149
2481
|
*
|
|
2150
|
-
* @see {@link takeWhile}
|
|
2151
|
-
* @see {@link dropWhile}
|
|
2152
|
-
* @see {@link splitWhere}
|
|
2482
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
2483
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
2484
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
2153
2485
|
*
|
|
2154
2486
|
* @category splitting
|
|
2155
2487
|
* @since 2.0.0
|
|
@@ -2159,6 +2491,11 @@ export declare const span: {
|
|
|
2159
2491
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
2160
2492
|
* holds, and the remaining elements.
|
|
2161
2493
|
*
|
|
2494
|
+
* **When to use**
|
|
2495
|
+
*
|
|
2496
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
2497
|
+
* and the elements after that prefix when you need both parts.
|
|
2498
|
+
*
|
|
2162
2499
|
* **Details**
|
|
2163
2500
|
*
|
|
2164
2501
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -2173,9 +2510,9 @@ export declare const span: {
|
|
|
2173
2510
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
2174
2511
|
* ```
|
|
2175
2512
|
*
|
|
2176
|
-
* @see {@link takeWhile}
|
|
2177
|
-
* @see {@link dropWhile}
|
|
2178
|
-
* @see {@link splitWhere}
|
|
2513
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
2514
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
2515
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
2179
2516
|
*
|
|
2180
2517
|
* @category splitting
|
|
2181
2518
|
* @since 2.0.0
|
|
@@ -2185,6 +2522,11 @@ export declare const span: {
|
|
|
2185
2522
|
/**
|
|
2186
2523
|
* Removes the first `n` elements, creating a new array.
|
|
2187
2524
|
*
|
|
2525
|
+
* **When to use**
|
|
2526
|
+
*
|
|
2527
|
+
* Use to keep the suffix of an iterable after skipping a fixed number of
|
|
2528
|
+
* leading elements.
|
|
2529
|
+
*
|
|
2188
2530
|
* **Details**
|
|
2189
2531
|
*
|
|
2190
2532
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -2198,9 +2540,9 @@ export declare const span: {
|
|
|
2198
2540
|
* console.log(Array.drop([1, 2, 3, 4, 5], 2)) // [3, 4, 5]
|
|
2199
2541
|
* ```
|
|
2200
2542
|
*
|
|
2201
|
-
* @see {@link dropRight}
|
|
2202
|
-
* @see {@link dropWhile}
|
|
2203
|
-
* @see {@link take}
|
|
2543
|
+
* @see {@link dropRight} for removing a fixed number of elements from the end
|
|
2544
|
+
* @see {@link dropWhile} for removing a prefix based on a predicate instead of a fixed count
|
|
2545
|
+
* @see {@link take} for keeping a fixed number of elements from the start
|
|
2204
2546
|
*
|
|
2205
2547
|
* @category getters
|
|
2206
2548
|
* @since 2.0.0
|
|
@@ -2209,6 +2551,11 @@ export declare const drop: {
|
|
|
2209
2551
|
/**
|
|
2210
2552
|
* Removes the first `n` elements, creating a new array.
|
|
2211
2553
|
*
|
|
2554
|
+
* **When to use**
|
|
2555
|
+
*
|
|
2556
|
+
* Use to keep the suffix of an iterable after skipping a fixed number of
|
|
2557
|
+
* leading elements.
|
|
2558
|
+
*
|
|
2212
2559
|
* **Details**
|
|
2213
2560
|
*
|
|
2214
2561
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -2222,9 +2569,9 @@ export declare const drop: {
|
|
|
2222
2569
|
* console.log(Array.drop([1, 2, 3, 4, 5], 2)) // [3, 4, 5]
|
|
2223
2570
|
* ```
|
|
2224
2571
|
*
|
|
2225
|
-
* @see {@link dropRight}
|
|
2226
|
-
* @see {@link dropWhile}
|
|
2227
|
-
* @see {@link take}
|
|
2572
|
+
* @see {@link dropRight} for removing a fixed number of elements from the end
|
|
2573
|
+
* @see {@link dropWhile} for removing a prefix based on a predicate instead of a fixed count
|
|
2574
|
+
* @see {@link take} for keeping a fixed number of elements from the start
|
|
2228
2575
|
*
|
|
2229
2576
|
* @category getters
|
|
2230
2577
|
* @since 2.0.0
|
|
@@ -2233,6 +2580,11 @@ export declare const drop: {
|
|
|
2233
2580
|
/**
|
|
2234
2581
|
* Removes the first `n` elements, creating a new array.
|
|
2235
2582
|
*
|
|
2583
|
+
* **When to use**
|
|
2584
|
+
*
|
|
2585
|
+
* Use to keep the suffix of an iterable after skipping a fixed number of
|
|
2586
|
+
* leading elements.
|
|
2587
|
+
*
|
|
2236
2588
|
* **Details**
|
|
2237
2589
|
*
|
|
2238
2590
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -2246,9 +2598,9 @@ export declare const drop: {
|
|
|
2246
2598
|
* console.log(Array.drop([1, 2, 3, 4, 5], 2)) // [3, 4, 5]
|
|
2247
2599
|
* ```
|
|
2248
2600
|
*
|
|
2249
|
-
* @see {@link dropRight}
|
|
2250
|
-
* @see {@link dropWhile}
|
|
2251
|
-
* @see {@link take}
|
|
2601
|
+
* @see {@link dropRight} for removing a fixed number of elements from the end
|
|
2602
|
+
* @see {@link dropWhile} for removing a prefix based on a predicate instead of a fixed count
|
|
2603
|
+
* @see {@link take} for keeping a fixed number of elements from the start
|
|
2252
2604
|
*
|
|
2253
2605
|
* @category getters
|
|
2254
2606
|
* @since 2.0.0
|
|
@@ -2258,9 +2610,13 @@ export declare const drop: {
|
|
|
2258
2610
|
/**
|
|
2259
2611
|
* Removes the last `n` elements, creating a new array.
|
|
2260
2612
|
*
|
|
2613
|
+
* **When to use**
|
|
2614
|
+
*
|
|
2615
|
+
* Use to remove the last `n` elements from an iterable.
|
|
2616
|
+
*
|
|
2261
2617
|
* **Details**
|
|
2262
2618
|
*
|
|
2263
|
-
*
|
|
2619
|
+
* `n` is clamped to `[0, length]`.
|
|
2264
2620
|
*
|
|
2265
2621
|
* **Example** (Dropping from the end)
|
|
2266
2622
|
*
|
|
@@ -2280,9 +2636,13 @@ export declare const dropRight: {
|
|
|
2280
2636
|
/**
|
|
2281
2637
|
* Removes the last `n` elements, creating a new array.
|
|
2282
2638
|
*
|
|
2639
|
+
* **When to use**
|
|
2640
|
+
*
|
|
2641
|
+
* Use to remove the last `n` elements from an iterable.
|
|
2642
|
+
*
|
|
2283
2643
|
* **Details**
|
|
2284
2644
|
*
|
|
2285
|
-
*
|
|
2645
|
+
* `n` is clamped to `[0, length]`.
|
|
2286
2646
|
*
|
|
2287
2647
|
* **Example** (Dropping from the end)
|
|
2288
2648
|
*
|
|
@@ -2302,9 +2662,13 @@ export declare const dropRight: {
|
|
|
2302
2662
|
/**
|
|
2303
2663
|
* Removes the last `n` elements, creating a new array.
|
|
2304
2664
|
*
|
|
2665
|
+
* **When to use**
|
|
2666
|
+
*
|
|
2667
|
+
* Use to remove the last `n` elements from an iterable.
|
|
2668
|
+
*
|
|
2305
2669
|
* **Details**
|
|
2306
2670
|
*
|
|
2307
|
-
*
|
|
2671
|
+
* `n` is clamped to `[0, length]`.
|
|
2308
2672
|
*
|
|
2309
2673
|
* **Example** (Dropping from the end)
|
|
2310
2674
|
*
|
|
@@ -2325,9 +2689,13 @@ export declare const dropRight: {
|
|
|
2325
2689
|
/**
|
|
2326
2690
|
* Drops elements from the start while the predicate holds, returning the rest.
|
|
2327
2691
|
*
|
|
2692
|
+
* **When to use**
|
|
2693
|
+
*
|
|
2694
|
+
* Use to remove a leading prefix of elements that satisfy a predicate.
|
|
2695
|
+
*
|
|
2328
2696
|
* **Details**
|
|
2329
2697
|
*
|
|
2330
|
-
*
|
|
2698
|
+
* The predicate receives `(element, index)`.
|
|
2331
2699
|
*
|
|
2332
2700
|
* **Example** (Dropping while condition holds)
|
|
2333
2701
|
*
|
|
@@ -2347,9 +2715,13 @@ export declare const dropWhile: {
|
|
|
2347
2715
|
/**
|
|
2348
2716
|
* Drops elements from the start while the predicate holds, returning the rest.
|
|
2349
2717
|
*
|
|
2718
|
+
* **When to use**
|
|
2719
|
+
*
|
|
2720
|
+
* Use to remove a leading prefix of elements that satisfy a predicate.
|
|
2721
|
+
*
|
|
2350
2722
|
* **Details**
|
|
2351
2723
|
*
|
|
2352
|
-
*
|
|
2724
|
+
* The predicate receives `(element, index)`.
|
|
2353
2725
|
*
|
|
2354
2726
|
* **Example** (Dropping while condition holds)
|
|
2355
2727
|
*
|
|
@@ -2369,9 +2741,13 @@ export declare const dropWhile: {
|
|
|
2369
2741
|
/**
|
|
2370
2742
|
* Drops elements from the start while the predicate holds, returning the rest.
|
|
2371
2743
|
*
|
|
2744
|
+
* **When to use**
|
|
2745
|
+
*
|
|
2746
|
+
* Use to remove a leading prefix of elements that satisfy a predicate.
|
|
2747
|
+
*
|
|
2372
2748
|
* **Details**
|
|
2373
2749
|
*
|
|
2374
|
-
*
|
|
2750
|
+
* The predicate receives `(element, index)`.
|
|
2375
2751
|
*
|
|
2376
2752
|
* **Example** (Dropping while condition holds)
|
|
2377
2753
|
*
|
|
@@ -2392,11 +2768,19 @@ export declare const dropWhile: {
|
|
|
2392
2768
|
/**
|
|
2393
2769
|
* Drops elements from the start while a `Filter` succeeds.
|
|
2394
2770
|
*
|
|
2771
|
+
* **When to use**
|
|
2772
|
+
*
|
|
2773
|
+
* Use when dropping a prefix requires computing a `Result` per element instead
|
|
2774
|
+
* of a simple boolean predicate.
|
|
2775
|
+
*
|
|
2395
2776
|
* **Details**
|
|
2396
2777
|
*
|
|
2397
2778
|
* - The filter receives `(element, index)`.
|
|
2398
2779
|
* - Returns the remaining original elements after the first filter failure.
|
|
2399
2780
|
*
|
|
2781
|
+
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
2782
|
+
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
2783
|
+
*
|
|
2400
2784
|
* @category getters
|
|
2401
2785
|
* @since 4.0.0
|
|
2402
2786
|
*/
|
|
@@ -2404,11 +2788,19 @@ export declare const dropWhileFilter: {
|
|
|
2404
2788
|
/**
|
|
2405
2789
|
* Drops elements from the start while a `Filter` succeeds.
|
|
2406
2790
|
*
|
|
2791
|
+
* **When to use**
|
|
2792
|
+
*
|
|
2793
|
+
* Use when dropping a prefix requires computing a `Result` per element instead
|
|
2794
|
+
* of a simple boolean predicate.
|
|
2795
|
+
*
|
|
2407
2796
|
* **Details**
|
|
2408
2797
|
*
|
|
2409
2798
|
* - The filter receives `(element, index)`.
|
|
2410
2799
|
* - Returns the remaining original elements after the first filter failure.
|
|
2411
2800
|
*
|
|
2801
|
+
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
2802
|
+
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
2803
|
+
*
|
|
2412
2804
|
* @category getters
|
|
2413
2805
|
* @since 4.0.0
|
|
2414
2806
|
*/
|
|
@@ -2416,11 +2808,19 @@ export declare const dropWhileFilter: {
|
|
|
2416
2808
|
/**
|
|
2417
2809
|
* Drops elements from the start while a `Filter` succeeds.
|
|
2418
2810
|
*
|
|
2811
|
+
* **When to use**
|
|
2812
|
+
*
|
|
2813
|
+
* Use when dropping a prefix requires computing a `Result` per element instead
|
|
2814
|
+
* of a simple boolean predicate.
|
|
2815
|
+
*
|
|
2419
2816
|
* **Details**
|
|
2420
2817
|
*
|
|
2421
2818
|
* - The filter receives `(element, index)`.
|
|
2422
2819
|
* - Returns the remaining original elements after the first filter failure.
|
|
2423
2820
|
*
|
|
2821
|
+
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
2822
|
+
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
2823
|
+
*
|
|
2424
2824
|
* @category getters
|
|
2425
2825
|
* @since 4.0.0
|
|
2426
2826
|
*/
|
|
@@ -2430,6 +2830,11 @@ export declare const dropWhileFilter: {
|
|
|
2430
2830
|
* Returns the index of the first element matching the predicate, wrapped in an
|
|
2431
2831
|
* `Option`.
|
|
2432
2832
|
*
|
|
2833
|
+
* **When to use**
|
|
2834
|
+
*
|
|
2835
|
+
* Use to find the index of the first matching element from the start of an
|
|
2836
|
+
* iterable.
|
|
2837
|
+
*
|
|
2433
2838
|
* **Example** (Finding an index)
|
|
2434
2839
|
*
|
|
2435
2840
|
* ```ts
|
|
@@ -2449,6 +2854,11 @@ export declare const findFirstIndex: {
|
|
|
2449
2854
|
* Returns the index of the first element matching the predicate, wrapped in an
|
|
2450
2855
|
* `Option`.
|
|
2451
2856
|
*
|
|
2857
|
+
* **When to use**
|
|
2858
|
+
*
|
|
2859
|
+
* Use to find the index of the first matching element from the start of an
|
|
2860
|
+
* iterable.
|
|
2861
|
+
*
|
|
2452
2862
|
* **Example** (Finding an index)
|
|
2453
2863
|
*
|
|
2454
2864
|
* ```ts
|
|
@@ -2468,6 +2878,11 @@ export declare const findFirstIndex: {
|
|
|
2468
2878
|
* Returns the index of the first element matching the predicate, wrapped in an
|
|
2469
2879
|
* `Option`.
|
|
2470
2880
|
*
|
|
2881
|
+
* **When to use**
|
|
2882
|
+
*
|
|
2883
|
+
* Use to find the index of the first matching element from the start of an
|
|
2884
|
+
* iterable.
|
|
2885
|
+
*
|
|
2471
2886
|
* **Example** (Finding an index)
|
|
2472
2887
|
*
|
|
2473
2888
|
* ```ts
|
|
@@ -2488,6 +2903,10 @@ export declare const findFirstIndex: {
|
|
|
2488
2903
|
* Returns the index of the last element matching the predicate, wrapped in an
|
|
2489
2904
|
* `Option`.
|
|
2490
2905
|
*
|
|
2906
|
+
* **When to use**
|
|
2907
|
+
*
|
|
2908
|
+
* Use to find the index of the last matching element from the end of an array.
|
|
2909
|
+
*
|
|
2491
2910
|
* **Example** (Finding the last matching index)
|
|
2492
2911
|
*
|
|
2493
2912
|
* ```ts
|
|
@@ -2507,6 +2926,10 @@ export declare const findLastIndex: {
|
|
|
2507
2926
|
* Returns the index of the last element matching the predicate, wrapped in an
|
|
2508
2927
|
* `Option`.
|
|
2509
2928
|
*
|
|
2929
|
+
* **When to use**
|
|
2930
|
+
*
|
|
2931
|
+
* Use to find the index of the last matching element from the end of an array.
|
|
2932
|
+
*
|
|
2510
2933
|
* **Example** (Finding the last matching index)
|
|
2511
2934
|
*
|
|
2512
2935
|
* ```ts
|
|
@@ -2526,6 +2949,10 @@ export declare const findLastIndex: {
|
|
|
2526
2949
|
* Returns the index of the last element matching the predicate, wrapped in an
|
|
2527
2950
|
* `Option`.
|
|
2528
2951
|
*
|
|
2952
|
+
* **When to use**
|
|
2953
|
+
*
|
|
2954
|
+
* Use to find the index of the last matching element from the end of an array.
|
|
2955
|
+
*
|
|
2529
2956
|
* **Example** (Finding the last matching index)
|
|
2530
2957
|
*
|
|
2531
2958
|
* ```ts
|
|
@@ -2546,6 +2973,11 @@ export declare const findLastIndex: {
|
|
|
2546
2973
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2547
2974
|
* function, wrapped in `Option`.
|
|
2548
2975
|
*
|
|
2976
|
+
* **When to use**
|
|
2977
|
+
*
|
|
2978
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
2979
|
+
* element or mapped value as an `Option`.
|
|
2980
|
+
*
|
|
2549
2981
|
* **Details**
|
|
2550
2982
|
*
|
|
2551
2983
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2572,6 +3004,11 @@ export declare const findFirst: {
|
|
|
2572
3004
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2573
3005
|
* function, wrapped in `Option`.
|
|
2574
3006
|
*
|
|
3007
|
+
* **When to use**
|
|
3008
|
+
*
|
|
3009
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
3010
|
+
* element or mapped value as an `Option`.
|
|
3011
|
+
*
|
|
2575
3012
|
* **Details**
|
|
2576
3013
|
*
|
|
2577
3014
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2598,6 +3035,11 @@ export declare const findFirst: {
|
|
|
2598
3035
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2599
3036
|
* function, wrapped in `Option`.
|
|
2600
3037
|
*
|
|
3038
|
+
* **When to use**
|
|
3039
|
+
*
|
|
3040
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
3041
|
+
* element or mapped value as an `Option`.
|
|
3042
|
+
*
|
|
2601
3043
|
* **Details**
|
|
2602
3044
|
*
|
|
2603
3045
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2624,6 +3066,11 @@ export declare const findFirst: {
|
|
|
2624
3066
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2625
3067
|
* function, wrapped in `Option`.
|
|
2626
3068
|
*
|
|
3069
|
+
* **When to use**
|
|
3070
|
+
*
|
|
3071
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
3072
|
+
* element or mapped value as an `Option`.
|
|
3073
|
+
*
|
|
2627
3074
|
* **Details**
|
|
2628
3075
|
*
|
|
2629
3076
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2650,6 +3097,11 @@ export declare const findFirst: {
|
|
|
2650
3097
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2651
3098
|
* function, wrapped in `Option`.
|
|
2652
3099
|
*
|
|
3100
|
+
* **When to use**
|
|
3101
|
+
*
|
|
3102
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
3103
|
+
* element or mapped value as an `Option`.
|
|
3104
|
+
*
|
|
2653
3105
|
* **Details**
|
|
2654
3106
|
*
|
|
2655
3107
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2676,6 +3128,11 @@ export declare const findFirst: {
|
|
|
2676
3128
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2677
3129
|
* function, wrapped in `Option`.
|
|
2678
3130
|
*
|
|
3131
|
+
* **When to use**
|
|
3132
|
+
*
|
|
3133
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
3134
|
+
* element or mapped value as an `Option`.
|
|
3135
|
+
*
|
|
2679
3136
|
* **Details**
|
|
2680
3137
|
*
|
|
2681
3138
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2702,6 +3159,11 @@ export declare const findFirst: {
|
|
|
2702
3159
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
2703
3160
|
* function, wrapped in `Option`.
|
|
2704
3161
|
*
|
|
3162
|
+
* **When to use**
|
|
3163
|
+
*
|
|
3164
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
3165
|
+
* element or mapped value as an `Option`.
|
|
3166
|
+
*
|
|
2705
3167
|
* **Details**
|
|
2706
3168
|
*
|
|
2707
3169
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -2729,6 +3191,10 @@ export declare const findFirst: {
|
|
|
2729
3191
|
* Returns the first selected value together with its index, wrapped in an
|
|
2730
3192
|
* `Option`.
|
|
2731
3193
|
*
|
|
3194
|
+
* **When to use**
|
|
3195
|
+
*
|
|
3196
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3197
|
+
*
|
|
2732
3198
|
* **Details**
|
|
2733
3199
|
*
|
|
2734
3200
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2754,6 +3220,10 @@ export declare const findFirstWithIndex: {
|
|
|
2754
3220
|
* Returns the first selected value together with its index, wrapped in an
|
|
2755
3221
|
* `Option`.
|
|
2756
3222
|
*
|
|
3223
|
+
* **When to use**
|
|
3224
|
+
*
|
|
3225
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3226
|
+
*
|
|
2757
3227
|
* **Details**
|
|
2758
3228
|
*
|
|
2759
3229
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2779,6 +3249,10 @@ export declare const findFirstWithIndex: {
|
|
|
2779
3249
|
* Returns the first selected value together with its index, wrapped in an
|
|
2780
3250
|
* `Option`.
|
|
2781
3251
|
*
|
|
3252
|
+
* **When to use**
|
|
3253
|
+
*
|
|
3254
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3255
|
+
*
|
|
2782
3256
|
* **Details**
|
|
2783
3257
|
*
|
|
2784
3258
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2804,6 +3278,10 @@ export declare const findFirstWithIndex: {
|
|
|
2804
3278
|
* Returns the first selected value together with its index, wrapped in an
|
|
2805
3279
|
* `Option`.
|
|
2806
3280
|
*
|
|
3281
|
+
* **When to use**
|
|
3282
|
+
*
|
|
3283
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3284
|
+
*
|
|
2807
3285
|
* **Details**
|
|
2808
3286
|
*
|
|
2809
3287
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2829,6 +3307,10 @@ export declare const findFirstWithIndex: {
|
|
|
2829
3307
|
* Returns the first selected value together with its index, wrapped in an
|
|
2830
3308
|
* `Option`.
|
|
2831
3309
|
*
|
|
3310
|
+
* **When to use**
|
|
3311
|
+
*
|
|
3312
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3313
|
+
*
|
|
2832
3314
|
* **Details**
|
|
2833
3315
|
*
|
|
2834
3316
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2854,6 +3336,10 @@ export declare const findFirstWithIndex: {
|
|
|
2854
3336
|
* Returns the first selected value together with its index, wrapped in an
|
|
2855
3337
|
* `Option`.
|
|
2856
3338
|
*
|
|
3339
|
+
* **When to use**
|
|
3340
|
+
*
|
|
3341
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3342
|
+
*
|
|
2857
3343
|
* **Details**
|
|
2858
3344
|
*
|
|
2859
3345
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2879,6 +3365,10 @@ export declare const findFirstWithIndex: {
|
|
|
2879
3365
|
* Returns the first selected value together with its index, wrapped in an
|
|
2880
3366
|
* `Option`.
|
|
2881
3367
|
*
|
|
3368
|
+
* **When to use**
|
|
3369
|
+
*
|
|
3370
|
+
* Use to find both the first matching element and its index in one pass.
|
|
3371
|
+
*
|
|
2882
3372
|
* **Details**
|
|
2883
3373
|
*
|
|
2884
3374
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -2905,6 +3395,10 @@ export declare const findFirstWithIndex: {
|
|
|
2905
3395
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
2906
3396
|
* function, wrapped in `Option`.
|
|
2907
3397
|
*
|
|
3398
|
+
* **When to use**
|
|
3399
|
+
*
|
|
3400
|
+
* Use to find the last matching element from the end of an array.
|
|
3401
|
+
*
|
|
2908
3402
|
* **Details**
|
|
2909
3403
|
*
|
|
2910
3404
|
* - Searches from the end of the array.
|
|
@@ -2929,6 +3423,10 @@ export declare const findLast: {
|
|
|
2929
3423
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
2930
3424
|
* function, wrapped in `Option`.
|
|
2931
3425
|
*
|
|
3426
|
+
* **When to use**
|
|
3427
|
+
*
|
|
3428
|
+
* Use to find the last matching element from the end of an array.
|
|
3429
|
+
*
|
|
2932
3430
|
* **Details**
|
|
2933
3431
|
*
|
|
2934
3432
|
* - Searches from the end of the array.
|
|
@@ -2953,6 +3451,10 @@ export declare const findLast: {
|
|
|
2953
3451
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
2954
3452
|
* function, wrapped in `Option`.
|
|
2955
3453
|
*
|
|
3454
|
+
* **When to use**
|
|
3455
|
+
*
|
|
3456
|
+
* Use to find the last matching element from the end of an array.
|
|
3457
|
+
*
|
|
2956
3458
|
* **Details**
|
|
2957
3459
|
*
|
|
2958
3460
|
* - Searches from the end of the array.
|
|
@@ -2977,6 +3479,10 @@ export declare const findLast: {
|
|
|
2977
3479
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
2978
3480
|
* function, wrapped in `Option`.
|
|
2979
3481
|
*
|
|
3482
|
+
* **When to use**
|
|
3483
|
+
*
|
|
3484
|
+
* Use to find the last matching element from the end of an array.
|
|
3485
|
+
*
|
|
2980
3486
|
* **Details**
|
|
2981
3487
|
*
|
|
2982
3488
|
* - Searches from the end of the array.
|
|
@@ -3001,6 +3507,10 @@ export declare const findLast: {
|
|
|
3001
3507
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
3002
3508
|
* function, wrapped in `Option`.
|
|
3003
3509
|
*
|
|
3510
|
+
* **When to use**
|
|
3511
|
+
*
|
|
3512
|
+
* Use to find the last matching element from the end of an array.
|
|
3513
|
+
*
|
|
3004
3514
|
* **Details**
|
|
3005
3515
|
*
|
|
3006
3516
|
* - Searches from the end of the array.
|
|
@@ -3025,6 +3535,10 @@ export declare const findLast: {
|
|
|
3025
3535
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
3026
3536
|
* function, wrapped in `Option`.
|
|
3027
3537
|
*
|
|
3538
|
+
* **When to use**
|
|
3539
|
+
*
|
|
3540
|
+
* Use to find the last matching element from the end of an array.
|
|
3541
|
+
*
|
|
3028
3542
|
* **Details**
|
|
3029
3543
|
*
|
|
3030
3544
|
* - Searches from the end of the array.
|
|
@@ -3049,6 +3563,10 @@ export declare const findLast: {
|
|
|
3049
3563
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
3050
3564
|
* function, wrapped in `Option`.
|
|
3051
3565
|
*
|
|
3566
|
+
* **When to use**
|
|
3567
|
+
*
|
|
3568
|
+
* Use to find the last matching element from the end of an array.
|
|
3569
|
+
*
|
|
3052
3570
|
* **Details**
|
|
3053
3571
|
*
|
|
3054
3572
|
* - Searches from the end of the array.
|
|
@@ -3074,6 +3592,10 @@ export declare const findLast: {
|
|
|
3074
3592
|
* Inserts an element at the specified index, returning a new `NonEmptyArray`
|
|
3075
3593
|
* wrapped in an `Option`.
|
|
3076
3594
|
*
|
|
3595
|
+
* **When to use**
|
|
3596
|
+
*
|
|
3597
|
+
* Use to insert a single element at a specific position in an array.
|
|
3598
|
+
*
|
|
3077
3599
|
* **Details**
|
|
3078
3600
|
*
|
|
3079
3601
|
* - Valid indices: `0` to `length` (inclusive — inserting at `length` appends).
|
|
@@ -3098,6 +3620,10 @@ export declare const insertAt: {
|
|
|
3098
3620
|
* Inserts an element at the specified index, returning a new `NonEmptyArray`
|
|
3099
3621
|
* wrapped in an `Option`.
|
|
3100
3622
|
*
|
|
3623
|
+
* **When to use**
|
|
3624
|
+
*
|
|
3625
|
+
* Use to insert a single element at a specific position in an array.
|
|
3626
|
+
*
|
|
3101
3627
|
* **Details**
|
|
3102
3628
|
*
|
|
3103
3629
|
* - Valid indices: `0` to `length` (inclusive — inserting at `length` appends).
|
|
@@ -3122,6 +3648,10 @@ export declare const insertAt: {
|
|
|
3122
3648
|
* Inserts an element at the specified index, returning a new `NonEmptyArray`
|
|
3123
3649
|
* wrapped in an `Option`.
|
|
3124
3650
|
*
|
|
3651
|
+
* **When to use**
|
|
3652
|
+
*
|
|
3653
|
+
* Use to insert a single element at a specific position in an array.
|
|
3654
|
+
*
|
|
3125
3655
|
* **Details**
|
|
3126
3656
|
*
|
|
3127
3657
|
* - Valid indices: `0` to `length` (inclusive — inserting at `length` appends).
|
|
@@ -3147,6 +3677,10 @@ export declare const insertAt: {
|
|
|
3147
3677
|
* Replaces the element at the specified index with a new value, returning the
|
|
3148
3678
|
* updated array in `Option.some`.
|
|
3149
3679
|
*
|
|
3680
|
+
* **When to use**
|
|
3681
|
+
*
|
|
3682
|
+
* Use to set a fixed replacement value at a specific index.
|
|
3683
|
+
*
|
|
3150
3684
|
* **Details**
|
|
3151
3685
|
*
|
|
3152
3686
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -3171,6 +3705,10 @@ export declare const replace: {
|
|
|
3171
3705
|
* Replaces the element at the specified index with a new value, returning the
|
|
3172
3706
|
* updated array in `Option.some`.
|
|
3173
3707
|
*
|
|
3708
|
+
* **When to use**
|
|
3709
|
+
*
|
|
3710
|
+
* Use to set a fixed replacement value at a specific index.
|
|
3711
|
+
*
|
|
3174
3712
|
* **Details**
|
|
3175
3713
|
*
|
|
3176
3714
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -3195,6 +3733,10 @@ export declare const replace: {
|
|
|
3195
3733
|
* Replaces the element at the specified index with a new value, returning the
|
|
3196
3734
|
* updated array in `Option.some`.
|
|
3197
3735
|
*
|
|
3736
|
+
* **When to use**
|
|
3737
|
+
*
|
|
3738
|
+
* Use to set a fixed replacement value at a specific index.
|
|
3739
|
+
*
|
|
3198
3740
|
* **Details**
|
|
3199
3741
|
*
|
|
3200
3742
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -3220,6 +3762,11 @@ export declare const replace: {
|
|
|
3220
3762
|
* Applies a function to the element at the specified index, returning the
|
|
3221
3763
|
* updated array in `Option.some`.
|
|
3222
3764
|
*
|
|
3765
|
+
* **When to use**
|
|
3766
|
+
*
|
|
3767
|
+
* Use to derive a replacement value from the current element at a specific
|
|
3768
|
+
* index while leaving the other elements unchanged.
|
|
3769
|
+
*
|
|
3223
3770
|
* **Details**
|
|
3224
3771
|
*
|
|
3225
3772
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -3246,6 +3793,11 @@ export declare const modify: {
|
|
|
3246
3793
|
* Applies a function to the element at the specified index, returning the
|
|
3247
3794
|
* updated array in `Option.some`.
|
|
3248
3795
|
*
|
|
3796
|
+
* **When to use**
|
|
3797
|
+
*
|
|
3798
|
+
* Use to derive a replacement value from the current element at a specific
|
|
3799
|
+
* index while leaving the other elements unchanged.
|
|
3800
|
+
*
|
|
3249
3801
|
* **Details**
|
|
3250
3802
|
*
|
|
3251
3803
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -3272,6 +3824,11 @@ export declare const modify: {
|
|
|
3272
3824
|
* Applies a function to the element at the specified index, returning the
|
|
3273
3825
|
* updated array in `Option.some`.
|
|
3274
3826
|
*
|
|
3827
|
+
* **When to use**
|
|
3828
|
+
*
|
|
3829
|
+
* Use to derive a replacement value from the current element at a specific
|
|
3830
|
+
* index while leaving the other elements unchanged.
|
|
3831
|
+
*
|
|
3275
3832
|
* **Details**
|
|
3276
3833
|
*
|
|
3277
3834
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
@@ -3299,9 +3856,13 @@ export declare const modify: {
|
|
|
3299
3856
|
* Removes the element at the specified index, returning a new array. If the
|
|
3300
3857
|
* index is out of bounds, returns a copy of the original.
|
|
3301
3858
|
*
|
|
3859
|
+
* **When to use**
|
|
3860
|
+
*
|
|
3861
|
+
* Use to remove a single element at a known index.
|
|
3862
|
+
*
|
|
3302
3863
|
* **Details**
|
|
3303
3864
|
*
|
|
3304
|
-
*
|
|
3865
|
+
* Does not mutate the input.
|
|
3305
3866
|
*
|
|
3306
3867
|
* **Example** (Removing an element)
|
|
3307
3868
|
*
|
|
@@ -3323,9 +3884,13 @@ export declare const remove: {
|
|
|
3323
3884
|
* Removes the element at the specified index, returning a new array. If the
|
|
3324
3885
|
* index is out of bounds, returns a copy of the original.
|
|
3325
3886
|
*
|
|
3887
|
+
* **When to use**
|
|
3888
|
+
*
|
|
3889
|
+
* Use to remove a single element at a known index.
|
|
3890
|
+
*
|
|
3326
3891
|
* **Details**
|
|
3327
3892
|
*
|
|
3328
|
-
*
|
|
3893
|
+
* Does not mutate the input.
|
|
3329
3894
|
*
|
|
3330
3895
|
* **Example** (Removing an element)
|
|
3331
3896
|
*
|
|
@@ -3347,9 +3912,13 @@ export declare const remove: {
|
|
|
3347
3912
|
* Removes the element at the specified index, returning a new array. If the
|
|
3348
3913
|
* index is out of bounds, returns a copy of the original.
|
|
3349
3914
|
*
|
|
3915
|
+
* **When to use**
|
|
3916
|
+
*
|
|
3917
|
+
* Use to remove a single element at a known index.
|
|
3918
|
+
*
|
|
3350
3919
|
* **Details**
|
|
3351
3920
|
*
|
|
3352
|
-
*
|
|
3921
|
+
* Does not mutate the input.
|
|
3353
3922
|
*
|
|
3354
3923
|
* **Example** (Removing an element)
|
|
3355
3924
|
*
|
|
@@ -3371,6 +3940,10 @@ export declare const remove: {
|
|
|
3371
3940
|
/**
|
|
3372
3941
|
* Reverses an iterable into a new array.
|
|
3373
3942
|
*
|
|
3943
|
+
* **When to use**
|
|
3944
|
+
*
|
|
3945
|
+
* Use to reverse the order of elements without mutating the original input.
|
|
3946
|
+
*
|
|
3374
3947
|
* **Details**
|
|
3375
3948
|
*
|
|
3376
3949
|
* - Does not mutate the input.
|
|
@@ -3391,6 +3964,10 @@ export declare const reverse: <S extends Iterable<any>>(self: S) => S extends No
|
|
|
3391
3964
|
/**
|
|
3392
3965
|
* Sorts an array by the given `Order`, returning a new array.
|
|
3393
3966
|
*
|
|
3967
|
+
* **When to use**
|
|
3968
|
+
*
|
|
3969
|
+
* Use to sort an array using a single `Order` comparator.
|
|
3970
|
+
*
|
|
3394
3971
|
* **Details**
|
|
3395
3972
|
*
|
|
3396
3973
|
* - Does not mutate the input.
|
|
@@ -3416,6 +3993,10 @@ export declare const sort: {
|
|
|
3416
3993
|
/**
|
|
3417
3994
|
* Sorts an array by the given `Order`, returning a new array.
|
|
3418
3995
|
*
|
|
3996
|
+
* **When to use**
|
|
3997
|
+
*
|
|
3998
|
+
* Use to sort an array using a single `Order` comparator.
|
|
3999
|
+
*
|
|
3419
4000
|
* **Details**
|
|
3420
4001
|
*
|
|
3421
4002
|
* - Does not mutate the input.
|
|
@@ -3441,6 +4022,10 @@ export declare const sort: {
|
|
|
3441
4022
|
/**
|
|
3442
4023
|
* Sorts an array by the given `Order`, returning a new array.
|
|
3443
4024
|
*
|
|
4025
|
+
* **When to use**
|
|
4026
|
+
*
|
|
4027
|
+
* Use to sort an array using a single `Order` comparator.
|
|
4028
|
+
*
|
|
3444
4029
|
* **Details**
|
|
3445
4030
|
*
|
|
3446
4031
|
* - Does not mutate the input.
|
|
@@ -3466,6 +4051,10 @@ export declare const sort: {
|
|
|
3466
4051
|
/**
|
|
3467
4052
|
* Sorts an array by the given `Order`, returning a new array.
|
|
3468
4053
|
*
|
|
4054
|
+
* **When to use**
|
|
4055
|
+
*
|
|
4056
|
+
* Use to sort an array using a single `Order` comparator.
|
|
4057
|
+
*
|
|
3469
4058
|
* **Details**
|
|
3470
4059
|
*
|
|
3471
4060
|
* - Does not mutate the input.
|
|
@@ -3493,6 +4082,11 @@ export declare const sort: {
|
|
|
3493
4082
|
* Sorts an array by a derived key using a mapping function and an `Order` for
|
|
3494
4083
|
* that key.
|
|
3495
4084
|
*
|
|
4085
|
+
* **When to use**
|
|
4086
|
+
*
|
|
4087
|
+
* Use when values need to be sorted by a derived key, such as a string length
|
|
4088
|
+
* or object field, while the output should keep the original values.
|
|
4089
|
+
*
|
|
3496
4090
|
* **Details**
|
|
3497
4091
|
*
|
|
3498
4092
|
* - Equivalent to `sort(Order.mapInput(order, f))` but more convenient.
|
|
@@ -3507,8 +4101,8 @@ export declare const sort: {
|
|
|
3507
4101
|
* // ["b", "cc", "aaa"]
|
|
3508
4102
|
* ```
|
|
3509
4103
|
*
|
|
3510
|
-
* @see {@link sort}
|
|
3511
|
-
* @see {@link sortBy}
|
|
4104
|
+
* @see {@link sort} for sorting with an `Order` that compares the elements directly
|
|
4105
|
+
* @see {@link sortBy} for sorting with multiple `Order`s applied in sequence
|
|
3512
4106
|
*
|
|
3513
4107
|
* @category elements
|
|
3514
4108
|
* @since 2.0.0
|
|
@@ -3518,6 +4112,11 @@ export declare const sortWith: {
|
|
|
3518
4112
|
* Sorts an array by a derived key using a mapping function and an `Order` for
|
|
3519
4113
|
* that key.
|
|
3520
4114
|
*
|
|
4115
|
+
* **When to use**
|
|
4116
|
+
*
|
|
4117
|
+
* Use when values need to be sorted by a derived key, such as a string length
|
|
4118
|
+
* or object field, while the output should keep the original values.
|
|
4119
|
+
*
|
|
3521
4120
|
* **Details**
|
|
3522
4121
|
*
|
|
3523
4122
|
* - Equivalent to `sort(Order.mapInput(order, f))` but more convenient.
|
|
@@ -3532,8 +4131,8 @@ export declare const sortWith: {
|
|
|
3532
4131
|
* // ["b", "cc", "aaa"]
|
|
3533
4132
|
* ```
|
|
3534
4133
|
*
|
|
3535
|
-
* @see {@link sort}
|
|
3536
|
-
* @see {@link sortBy}
|
|
4134
|
+
* @see {@link sort} for sorting with an `Order` that compares the elements directly
|
|
4135
|
+
* @see {@link sortBy} for sorting with multiple `Order`s applied in sequence
|
|
3537
4136
|
*
|
|
3538
4137
|
* @category elements
|
|
3539
4138
|
* @since 2.0.0
|
|
@@ -3543,6 +4142,11 @@ export declare const sortWith: {
|
|
|
3543
4142
|
* Sorts an array by a derived key using a mapping function and an `Order` for
|
|
3544
4143
|
* that key.
|
|
3545
4144
|
*
|
|
4145
|
+
* **When to use**
|
|
4146
|
+
*
|
|
4147
|
+
* Use when values need to be sorted by a derived key, such as a string length
|
|
4148
|
+
* or object field, while the output should keep the original values.
|
|
4149
|
+
*
|
|
3546
4150
|
* **Details**
|
|
3547
4151
|
*
|
|
3548
4152
|
* - Equivalent to `sort(Order.mapInput(order, f))` but more convenient.
|
|
@@ -3557,8 +4161,8 @@ export declare const sortWith: {
|
|
|
3557
4161
|
* // ["b", "cc", "aaa"]
|
|
3558
4162
|
* ```
|
|
3559
4163
|
*
|
|
3560
|
-
* @see {@link sort}
|
|
3561
|
-
* @see {@link sortBy}
|
|
4164
|
+
* @see {@link sort} for sorting with an `Order` that compares the elements directly
|
|
4165
|
+
* @see {@link sortBy} for sorting with multiple `Order`s applied in sequence
|
|
3562
4166
|
*
|
|
3563
4167
|
* @category elements
|
|
3564
4168
|
* @since 2.0.0
|
|
@@ -3568,6 +4172,11 @@ export declare const sortWith: {
|
|
|
3568
4172
|
* Sorts an array by a derived key using a mapping function and an `Order` for
|
|
3569
4173
|
* that key.
|
|
3570
4174
|
*
|
|
4175
|
+
* **When to use**
|
|
4176
|
+
*
|
|
4177
|
+
* Use when values need to be sorted by a derived key, such as a string length
|
|
4178
|
+
* or object field, while the output should keep the original values.
|
|
4179
|
+
*
|
|
3571
4180
|
* **Details**
|
|
3572
4181
|
*
|
|
3573
4182
|
* - Equivalent to `sort(Order.mapInput(order, f))` but more convenient.
|
|
@@ -3582,8 +4191,8 @@ export declare const sortWith: {
|
|
|
3582
4191
|
* // ["b", "cc", "aaa"]
|
|
3583
4192
|
* ```
|
|
3584
4193
|
*
|
|
3585
|
-
* @see {@link sort}
|
|
3586
|
-
* @see {@link sortBy}
|
|
4194
|
+
* @see {@link sort} for sorting with an `Order` that compares the elements directly
|
|
4195
|
+
* @see {@link sortBy} for sorting with multiple `Order`s applied in sequence
|
|
3587
4196
|
*
|
|
3588
4197
|
* @category elements
|
|
3589
4198
|
* @since 2.0.0
|
|
@@ -3594,6 +4203,11 @@ export declare const sortWith: {
|
|
|
3594
4203
|
* Sorts an array by multiple `Order`s applied in sequence: the first order is
|
|
3595
4204
|
* used first; ties are broken by the second order, and so on.
|
|
3596
4205
|
*
|
|
4206
|
+
* **When to use**
|
|
4207
|
+
*
|
|
4208
|
+
* Use to sort by multiple criteria where later orders break ties from earlier
|
|
4209
|
+
* ones.
|
|
4210
|
+
*
|
|
3597
4211
|
* **Details**
|
|
3598
4212
|
*
|
|
3599
4213
|
* - Data-last only (returns a function).
|
|
@@ -3632,6 +4246,10 @@ export declare const sortBy: <S extends Iterable<any>>(...orders: ReadonlyArray<
|
|
|
3632
4246
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
3633
4247
|
* length, the extra elements from the longer one are discarded.
|
|
3634
4248
|
*
|
|
4249
|
+
* **When to use**
|
|
4250
|
+
*
|
|
4251
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
4252
|
+
*
|
|
3635
4253
|
* **Details**
|
|
3636
4254
|
*
|
|
3637
4255
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -3655,6 +4273,10 @@ export declare const zip: {
|
|
|
3655
4273
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
3656
4274
|
* length, the extra elements from the longer one are discarded.
|
|
3657
4275
|
*
|
|
4276
|
+
* **When to use**
|
|
4277
|
+
*
|
|
4278
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
4279
|
+
*
|
|
3658
4280
|
* **Details**
|
|
3659
4281
|
*
|
|
3660
4282
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -3678,6 +4300,10 @@ export declare const zip: {
|
|
|
3678
4300
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
3679
4301
|
* length, the extra elements from the longer one are discarded.
|
|
3680
4302
|
*
|
|
4303
|
+
* **When to use**
|
|
4304
|
+
*
|
|
4305
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
4306
|
+
*
|
|
3681
4307
|
* **Details**
|
|
3682
4308
|
*
|
|
3683
4309
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -3701,6 +4327,10 @@ export declare const zip: {
|
|
|
3701
4327
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
3702
4328
|
* length, the extra elements from the longer one are discarded.
|
|
3703
4329
|
*
|
|
4330
|
+
* **When to use**
|
|
4331
|
+
*
|
|
4332
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
4333
|
+
*
|
|
3704
4334
|
* **Details**
|
|
3705
4335
|
*
|
|
3706
4336
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -3724,6 +4354,10 @@ export declare const zip: {
|
|
|
3724
4354
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
3725
4355
|
* length, the extra elements from the longer one are discarded.
|
|
3726
4356
|
*
|
|
4357
|
+
* **When to use**
|
|
4358
|
+
*
|
|
4359
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
4360
|
+
*
|
|
3727
4361
|
* **Details**
|
|
3728
4362
|
*
|
|
3729
4363
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -3855,6 +4489,10 @@ export declare const unzip: <S extends Iterable<readonly [any, any]>>(self: S) =
|
|
|
3855
4489
|
/**
|
|
3856
4490
|
* Places a separator element between every pair of elements.
|
|
3857
4491
|
*
|
|
4492
|
+
* **When to use**
|
|
4493
|
+
*
|
|
4494
|
+
* Use to insert a separator between elements, for example when preparing data for display or concatenation.
|
|
4495
|
+
*
|
|
3858
4496
|
* **Details**
|
|
3859
4497
|
*
|
|
3860
4498
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -3877,6 +4515,10 @@ export declare const intersperse: {
|
|
|
3877
4515
|
/**
|
|
3878
4516
|
* Places a separator element between every pair of elements.
|
|
3879
4517
|
*
|
|
4518
|
+
* **When to use**
|
|
4519
|
+
*
|
|
4520
|
+
* Use to insert a separator between elements, for example when preparing data for display or concatenation.
|
|
4521
|
+
*
|
|
3880
4522
|
* **Details**
|
|
3881
4523
|
*
|
|
3882
4524
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -3899,6 +4541,10 @@ export declare const intersperse: {
|
|
|
3899
4541
|
/**
|
|
3900
4542
|
* Places a separator element between every pair of elements.
|
|
3901
4543
|
*
|
|
4544
|
+
* **When to use**
|
|
4545
|
+
*
|
|
4546
|
+
* Use to insert a separator between elements, for example when preparing data for display or concatenation.
|
|
4547
|
+
*
|
|
3902
4548
|
* **Details**
|
|
3903
4549
|
*
|
|
3904
4550
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -3921,6 +4567,10 @@ export declare const intersperse: {
|
|
|
3921
4567
|
/**
|
|
3922
4568
|
* Places a separator element between every pair of elements.
|
|
3923
4569
|
*
|
|
4570
|
+
* **When to use**
|
|
4571
|
+
*
|
|
4572
|
+
* Use to insert a separator between elements, for example when preparing data for display or concatenation.
|
|
4573
|
+
*
|
|
3924
4574
|
* **Details**
|
|
3925
4575
|
*
|
|
3926
4576
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -3945,6 +4595,10 @@ export declare const intersperse: {
|
|
|
3945
4595
|
* Applies a function to the first element of a non-empty array, returning a
|
|
3946
4596
|
* new array.
|
|
3947
4597
|
*
|
|
4598
|
+
* **When to use**
|
|
4599
|
+
*
|
|
4600
|
+
* Use to transform the first element of a non-empty array while preserving the rest.
|
|
4601
|
+
*
|
|
3948
4602
|
* **Example** (Modifying the head)
|
|
3949
4603
|
*
|
|
3950
4604
|
* ```ts
|
|
@@ -3964,6 +4618,10 @@ export declare const modifyHeadNonEmpty: {
|
|
|
3964
4618
|
* Applies a function to the first element of a non-empty array, returning a
|
|
3965
4619
|
* new array.
|
|
3966
4620
|
*
|
|
4621
|
+
* **When to use**
|
|
4622
|
+
*
|
|
4623
|
+
* Use to transform the first element of a non-empty array while preserving the rest.
|
|
4624
|
+
*
|
|
3967
4625
|
* **Example** (Modifying the head)
|
|
3968
4626
|
*
|
|
3969
4627
|
* ```ts
|
|
@@ -3983,6 +4641,10 @@ export declare const modifyHeadNonEmpty: {
|
|
|
3983
4641
|
* Applies a function to the first element of a non-empty array, returning a
|
|
3984
4642
|
* new array.
|
|
3985
4643
|
*
|
|
4644
|
+
* **When to use**
|
|
4645
|
+
*
|
|
4646
|
+
* Use to transform the first element of a non-empty array while preserving the rest.
|
|
4647
|
+
*
|
|
3986
4648
|
* **Example** (Modifying the head)
|
|
3987
4649
|
*
|
|
3988
4650
|
* ```ts
|
|
@@ -4171,6 +4833,11 @@ export declare const setLastNonEmpty: {
|
|
|
4171
4833
|
* Rotates an array by `n` steps. Positive `n` rotates right; negative `n`
|
|
4172
4834
|
* rotates left.
|
|
4173
4835
|
*
|
|
4836
|
+
* **When to use**
|
|
4837
|
+
*
|
|
4838
|
+
* Use when elements should wrap around the end of the array rather than being
|
|
4839
|
+
* dropped.
|
|
4840
|
+
*
|
|
4174
4841
|
* **Details**
|
|
4175
4842
|
*
|
|
4176
4843
|
* - `n` is rounded to the nearest integer before rotating.
|
|
@@ -4185,6 +4852,9 @@ export declare const setLastNonEmpty: {
|
|
|
4185
4852
|
* console.log(Array.rotate(["a", "b", "c", "d"], 2)) // ["c", "d", "a", "b"]
|
|
4186
4853
|
* ```
|
|
4187
4854
|
*
|
|
4855
|
+
* @see {@link take} for taking a fixed number of elements from the start
|
|
4856
|
+
* @see {@link drop} for dropping a fixed number of elements from the start
|
|
4857
|
+
*
|
|
4188
4858
|
* @category elements
|
|
4189
4859
|
* @since 2.0.0
|
|
4190
4860
|
*/
|
|
@@ -4193,6 +4863,11 @@ export declare const rotate: {
|
|
|
4193
4863
|
* Rotates an array by `n` steps. Positive `n` rotates right; negative `n`
|
|
4194
4864
|
* rotates left.
|
|
4195
4865
|
*
|
|
4866
|
+
* **When to use**
|
|
4867
|
+
*
|
|
4868
|
+
* Use when elements should wrap around the end of the array rather than being
|
|
4869
|
+
* dropped.
|
|
4870
|
+
*
|
|
4196
4871
|
* **Details**
|
|
4197
4872
|
*
|
|
4198
4873
|
* - `n` is rounded to the nearest integer before rotating.
|
|
@@ -4207,6 +4882,9 @@ export declare const rotate: {
|
|
|
4207
4882
|
* console.log(Array.rotate(["a", "b", "c", "d"], 2)) // ["c", "d", "a", "b"]
|
|
4208
4883
|
* ```
|
|
4209
4884
|
*
|
|
4885
|
+
* @see {@link take} for taking a fixed number of elements from the start
|
|
4886
|
+
* @see {@link drop} for dropping a fixed number of elements from the start
|
|
4887
|
+
*
|
|
4210
4888
|
* @category elements
|
|
4211
4889
|
* @since 2.0.0
|
|
4212
4890
|
*/
|
|
@@ -4215,6 +4893,11 @@ export declare const rotate: {
|
|
|
4215
4893
|
* Rotates an array by `n` steps. Positive `n` rotates right; negative `n`
|
|
4216
4894
|
* rotates left.
|
|
4217
4895
|
*
|
|
4896
|
+
* **When to use**
|
|
4897
|
+
*
|
|
4898
|
+
* Use when elements should wrap around the end of the array rather than being
|
|
4899
|
+
* dropped.
|
|
4900
|
+
*
|
|
4218
4901
|
* **Details**
|
|
4219
4902
|
*
|
|
4220
4903
|
* - `n` is rounded to the nearest integer before rotating.
|
|
@@ -4229,6 +4912,9 @@ export declare const rotate: {
|
|
|
4229
4912
|
* console.log(Array.rotate(["a", "b", "c", "d"], 2)) // ["c", "d", "a", "b"]
|
|
4230
4913
|
* ```
|
|
4231
4914
|
*
|
|
4915
|
+
* @see {@link take} for taking a fixed number of elements from the start
|
|
4916
|
+
* @see {@link drop} for dropping a fixed number of elements from the start
|
|
4917
|
+
*
|
|
4232
4918
|
* @category elements
|
|
4233
4919
|
* @since 2.0.0
|
|
4234
4920
|
*/
|
|
@@ -4237,6 +4923,11 @@ export declare const rotate: {
|
|
|
4237
4923
|
* Rotates an array by `n` steps. Positive `n` rotates right; negative `n`
|
|
4238
4924
|
* rotates left.
|
|
4239
4925
|
*
|
|
4926
|
+
* **When to use**
|
|
4927
|
+
*
|
|
4928
|
+
* Use when elements should wrap around the end of the array rather than being
|
|
4929
|
+
* dropped.
|
|
4930
|
+
*
|
|
4240
4931
|
* **Details**
|
|
4241
4932
|
*
|
|
4242
4933
|
* - `n` is rounded to the nearest integer before rotating.
|
|
@@ -4251,6 +4942,9 @@ export declare const rotate: {
|
|
|
4251
4942
|
* console.log(Array.rotate(["a", "b", "c", "d"], 2)) // ["c", "d", "a", "b"]
|
|
4252
4943
|
* ```
|
|
4253
4944
|
*
|
|
4945
|
+
* @see {@link take} for taking a fixed number of elements from the start
|
|
4946
|
+
* @see {@link drop} for dropping a fixed number of elements from the start
|
|
4947
|
+
*
|
|
4254
4948
|
* @category elements
|
|
4255
4949
|
* @since 2.0.0
|
|
4256
4950
|
*/
|
|
@@ -4259,6 +4953,11 @@ export declare const rotate: {
|
|
|
4259
4953
|
/**
|
|
4260
4954
|
* Returns a membership-test function using a custom equivalence.
|
|
4261
4955
|
*
|
|
4956
|
+
* **When to use**
|
|
4957
|
+
*
|
|
4958
|
+
* Use when checking membership with caller-provided equality instead of
|
|
4959
|
+
* `Equal.equivalence()`.
|
|
4960
|
+
*
|
|
4262
4961
|
* **Example** (Custom equality check)
|
|
4263
4962
|
*
|
|
4264
4963
|
* ```ts
|
|
@@ -4268,7 +4967,7 @@ export declare const rotate: {
|
|
|
4268
4967
|
* console.log(pipe([1, 2, 3, 4], containsNumber(3))) // true
|
|
4269
4968
|
* ```
|
|
4270
4969
|
*
|
|
4271
|
-
* @see {@link contains}
|
|
4970
|
+
* @see {@link contains} for the `Equal.equivalence()` variant
|
|
4272
4971
|
*
|
|
4273
4972
|
* @category elements
|
|
4274
4973
|
* @since 2.0.0
|
|
@@ -4281,6 +4980,11 @@ export declare const containsWith: <A>(isEquivalent: (self: A, that: A) => boole
|
|
|
4281
4980
|
* Tests whether an array contains a value, using `Equal.equivalence()` for
|
|
4282
4981
|
* comparison.
|
|
4283
4982
|
*
|
|
4983
|
+
* **When to use**
|
|
4984
|
+
*
|
|
4985
|
+
* Use to check membership with Effect's default equality instead of providing a
|
|
4986
|
+
* comparison function.
|
|
4987
|
+
*
|
|
4284
4988
|
* **Example** (Checking membership)
|
|
4285
4989
|
*
|
|
4286
4990
|
* ```ts
|
|
@@ -4299,6 +5003,11 @@ export declare const contains: {
|
|
|
4299
5003
|
* Tests whether an array contains a value, using `Equal.equivalence()` for
|
|
4300
5004
|
* comparison.
|
|
4301
5005
|
*
|
|
5006
|
+
* **When to use**
|
|
5007
|
+
*
|
|
5008
|
+
* Use to check membership with Effect's default equality instead of providing a
|
|
5009
|
+
* comparison function.
|
|
5010
|
+
*
|
|
4302
5011
|
* **Example** (Checking membership)
|
|
4303
5012
|
*
|
|
4304
5013
|
* ```ts
|
|
@@ -4317,6 +5026,11 @@ export declare const contains: {
|
|
|
4317
5026
|
* Tests whether an array contains a value, using `Equal.equivalence()` for
|
|
4318
5027
|
* comparison.
|
|
4319
5028
|
*
|
|
5029
|
+
* **When to use**
|
|
5030
|
+
*
|
|
5031
|
+
* Use to check membership with Effect's default equality instead of providing a
|
|
5032
|
+
* comparison function.
|
|
5033
|
+
*
|
|
4320
5034
|
* **Example** (Checking membership)
|
|
4321
5035
|
*
|
|
4322
5036
|
* ```ts
|
|
@@ -4336,6 +5050,11 @@ export declare const contains: {
|
|
|
4336
5050
|
* Repeatedly applies a function that consumes a prefix of the array and
|
|
4337
5051
|
* produces a value plus the remaining elements, collecting the values.
|
|
4338
5052
|
*
|
|
5053
|
+
* **When to use**
|
|
5054
|
+
*
|
|
5055
|
+
* Use when the grouping logic is custom and each step needs to return both a
|
|
5056
|
+
* value and the remaining input.
|
|
5057
|
+
*
|
|
4339
5058
|
* **Details**
|
|
4340
5059
|
*
|
|
4341
5060
|
* - The function receives a `NonEmptyReadonlyArray` and returns
|
|
@@ -4366,6 +5085,11 @@ export declare const chop: {
|
|
|
4366
5085
|
* Repeatedly applies a function that consumes a prefix of the array and
|
|
4367
5086
|
* produces a value plus the remaining elements, collecting the values.
|
|
4368
5087
|
*
|
|
5088
|
+
* **When to use**
|
|
5089
|
+
*
|
|
5090
|
+
* Use when the grouping logic is custom and each step needs to return both a
|
|
5091
|
+
* value and the remaining input.
|
|
5092
|
+
*
|
|
4369
5093
|
* **Details**
|
|
4370
5094
|
*
|
|
4371
5095
|
* - The function receives a `NonEmptyReadonlyArray` and returns
|
|
@@ -4396,6 +5120,11 @@ export declare const chop: {
|
|
|
4396
5120
|
* Repeatedly applies a function that consumes a prefix of the array and
|
|
4397
5121
|
* produces a value plus the remaining elements, collecting the values.
|
|
4398
5122
|
*
|
|
5123
|
+
* **When to use**
|
|
5124
|
+
*
|
|
5125
|
+
* Use when the grouping logic is custom and each step needs to return both a
|
|
5126
|
+
* value and the remaining input.
|
|
5127
|
+
*
|
|
4399
5128
|
* **Details**
|
|
4400
5129
|
*
|
|
4401
5130
|
* - The function receives a `NonEmptyReadonlyArray` and returns
|
|
@@ -4426,6 +5155,11 @@ export declare const chop: {
|
|
|
4426
5155
|
* Repeatedly applies a function that consumes a prefix of the array and
|
|
4427
5156
|
* produces a value plus the remaining elements, collecting the values.
|
|
4428
5157
|
*
|
|
5158
|
+
* **When to use**
|
|
5159
|
+
*
|
|
5160
|
+
* Use when the grouping logic is custom and each step needs to return both a
|
|
5161
|
+
* value and the remaining input.
|
|
5162
|
+
*
|
|
4429
5163
|
* **Details**
|
|
4430
5164
|
*
|
|
4431
5165
|
* - The function receives a `NonEmptyReadonlyArray` and returns
|
|
@@ -4456,6 +5190,10 @@ export declare const chop: {
|
|
|
4456
5190
|
/**
|
|
4457
5191
|
* Splits an iterable into two arrays at the given index.
|
|
4458
5192
|
*
|
|
5193
|
+
* **When to use**
|
|
5194
|
+
*
|
|
5195
|
+
* Use to divide an array into a prefix and suffix at a specific position.
|
|
5196
|
+
*
|
|
4459
5197
|
* **Details**
|
|
4460
5198
|
*
|
|
4461
5199
|
* - `n` can be `0` (all elements in the second array).
|
|
@@ -4479,6 +5217,10 @@ export declare const splitAt: {
|
|
|
4479
5217
|
/**
|
|
4480
5218
|
* Splits an iterable into two arrays at the given index.
|
|
4481
5219
|
*
|
|
5220
|
+
* **When to use**
|
|
5221
|
+
*
|
|
5222
|
+
* Use to divide an array into a prefix and suffix at a specific position.
|
|
5223
|
+
*
|
|
4482
5224
|
* **Details**
|
|
4483
5225
|
*
|
|
4484
5226
|
* - `n` can be `0` (all elements in the second array).
|
|
@@ -4502,6 +5244,10 @@ export declare const splitAt: {
|
|
|
4502
5244
|
/**
|
|
4503
5245
|
* Splits an iterable into two arrays at the given index.
|
|
4504
5246
|
*
|
|
5247
|
+
* **When to use**
|
|
5248
|
+
*
|
|
5249
|
+
* Use to divide an array into a prefix and suffix at a specific position.
|
|
5250
|
+
*
|
|
4505
5251
|
* **Details**
|
|
4506
5252
|
*
|
|
4507
5253
|
* - `n` can be `0` (all elements in the second array).
|
|
@@ -4584,6 +5330,10 @@ export declare const splitAtNonEmpty: {
|
|
|
4584
5330
|
/**
|
|
4585
5331
|
* Splits an iterable into `n` roughly equal-sized chunks.
|
|
4586
5332
|
*
|
|
5333
|
+
* **When to use**
|
|
5334
|
+
*
|
|
5335
|
+
* Use to distribute elements across a fixed number of groups, such as when splitting work across threads.
|
|
5336
|
+
*
|
|
4587
5337
|
* **Details**
|
|
4588
5338
|
*
|
|
4589
5339
|
* - Uses `chunksOf(ceil(length / n))` internally.
|
|
@@ -4606,6 +5356,10 @@ export declare const split: {
|
|
|
4606
5356
|
/**
|
|
4607
5357
|
* Splits an iterable into `n` roughly equal-sized chunks.
|
|
4608
5358
|
*
|
|
5359
|
+
* **When to use**
|
|
5360
|
+
*
|
|
5361
|
+
* Use to distribute elements across a fixed number of groups, such as when splitting work across threads.
|
|
5362
|
+
*
|
|
4609
5363
|
* **Details**
|
|
4610
5364
|
*
|
|
4611
5365
|
* - Uses `chunksOf(ceil(length / n))` internally.
|
|
@@ -4628,6 +5382,10 @@ export declare const split: {
|
|
|
4628
5382
|
/**
|
|
4629
5383
|
* Splits an iterable into `n` roughly equal-sized chunks.
|
|
4630
5384
|
*
|
|
5385
|
+
* **When to use**
|
|
5386
|
+
*
|
|
5387
|
+
* Use to distribute elements across a fixed number of groups, such as when splitting work across threads.
|
|
5388
|
+
*
|
|
4631
5389
|
* **Details**
|
|
4632
5390
|
*
|
|
4633
5391
|
* - Uses `chunksOf(ceil(length / n))` internally.
|
|
@@ -4652,6 +5410,10 @@ export declare const split: {
|
|
|
4652
5410
|
* Splits an iterable at the first element matching the predicate. The matching
|
|
4653
5411
|
* element is included in the second array.
|
|
4654
5412
|
*
|
|
5413
|
+
* **When to use**
|
|
5414
|
+
*
|
|
5415
|
+
* Use to split an array at a condition boundary when you know which element marks the transition point.
|
|
5416
|
+
*
|
|
4655
5417
|
* **Example** (Splitting at a condition)
|
|
4656
5418
|
*
|
|
4657
5419
|
* ```ts
|
|
@@ -4671,6 +5433,10 @@ export declare const splitWhere: {
|
|
|
4671
5433
|
* Splits an iterable at the first element matching the predicate. The matching
|
|
4672
5434
|
* element is included in the second array.
|
|
4673
5435
|
*
|
|
5436
|
+
* **When to use**
|
|
5437
|
+
*
|
|
5438
|
+
* Use to split an array at a condition boundary when you know which element marks the transition point.
|
|
5439
|
+
*
|
|
4674
5440
|
* **Example** (Splitting at a condition)
|
|
4675
5441
|
*
|
|
4676
5442
|
* ```ts
|
|
@@ -4690,6 +5456,10 @@ export declare const splitWhere: {
|
|
|
4690
5456
|
* Splits an iterable at the first element matching the predicate. The matching
|
|
4691
5457
|
* element is included in the second array.
|
|
4692
5458
|
*
|
|
5459
|
+
* **When to use**
|
|
5460
|
+
*
|
|
5461
|
+
* Use to split an array at a condition boundary when you know which element marks the transition point.
|
|
5462
|
+
*
|
|
4693
5463
|
* **Example** (Splitting at a condition)
|
|
4694
5464
|
*
|
|
4695
5465
|
* ```ts
|
|
@@ -4709,6 +5479,11 @@ export declare const splitWhere: {
|
|
|
4709
5479
|
/**
|
|
4710
5480
|
* Creates a shallow copy of an array.
|
|
4711
5481
|
*
|
|
5482
|
+
* **When to use**
|
|
5483
|
+
*
|
|
5484
|
+
* Use to create a distinct array reference for an existing array, for example
|
|
5485
|
+
* before mutating the returned array.
|
|
5486
|
+
*
|
|
4712
5487
|
* **Details**
|
|
4713
5488
|
*
|
|
4714
5489
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -4734,6 +5509,11 @@ export declare const copy: {
|
|
|
4734
5509
|
/**
|
|
4735
5510
|
* Creates a shallow copy of an array.
|
|
4736
5511
|
*
|
|
5512
|
+
* **When to use**
|
|
5513
|
+
*
|
|
5514
|
+
* Use to create a distinct array reference for an existing array, for example
|
|
5515
|
+
* before mutating the returned array.
|
|
5516
|
+
*
|
|
4737
5517
|
* **Details**
|
|
4738
5518
|
*
|
|
4739
5519
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -4759,6 +5539,11 @@ export declare const copy: {
|
|
|
4759
5539
|
/**
|
|
4760
5540
|
* Creates a shallow copy of an array.
|
|
4761
5541
|
*
|
|
5542
|
+
* **When to use**
|
|
5543
|
+
*
|
|
5544
|
+
* Use to create a distinct array reference for an existing array, for example
|
|
5545
|
+
* before mutating the returned array.
|
|
5546
|
+
*
|
|
4762
5547
|
* **Details**
|
|
4763
5548
|
*
|
|
4764
5549
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -4786,6 +5571,10 @@ export declare const copy: {
|
|
|
4786
5571
|
* Pads or truncates an array to exactly `n` elements, filling with `fill`
|
|
4787
5572
|
* if the array is shorter, or slicing if longer.
|
|
4788
5573
|
*
|
|
5574
|
+
* **When to use**
|
|
5575
|
+
*
|
|
5576
|
+
* Use to ensure an array has a specific length, padding with a fill value or truncating as needed.
|
|
5577
|
+
*
|
|
4789
5578
|
* **Details**
|
|
4790
5579
|
*
|
|
4791
5580
|
* - Returns an empty array when `n <= 0`.
|
|
@@ -4809,6 +5598,10 @@ export declare const pad: {
|
|
|
4809
5598
|
* Pads or truncates an array to exactly `n` elements, filling with `fill`
|
|
4810
5599
|
* if the array is shorter, or slicing if longer.
|
|
4811
5600
|
*
|
|
5601
|
+
* **When to use**
|
|
5602
|
+
*
|
|
5603
|
+
* Use to ensure an array has a specific length, padding with a fill value or truncating as needed.
|
|
5604
|
+
*
|
|
4812
5605
|
* **Details**
|
|
4813
5606
|
*
|
|
4814
5607
|
* - Returns an empty array when `n <= 0`.
|
|
@@ -4832,6 +5625,10 @@ export declare const pad: {
|
|
|
4832
5625
|
* Pads or truncates an array to exactly `n` elements, filling with `fill`
|
|
4833
5626
|
* if the array is shorter, or slicing if longer.
|
|
4834
5627
|
*
|
|
5628
|
+
* **When to use**
|
|
5629
|
+
*
|
|
5630
|
+
* Use to ensure an array has a specific length, padding with a fill value or truncating as needed.
|
|
5631
|
+
*
|
|
4835
5632
|
* **Details**
|
|
4836
5633
|
*
|
|
4837
5634
|
* - Returns an empty array when `n <= 0`.
|
|
@@ -4856,6 +5653,11 @@ export declare const pad: {
|
|
|
4856
5653
|
* Splits an iterable into chunks of length `n`. The last chunk may be shorter
|
|
4857
5654
|
* if `n` does not evenly divide the length.
|
|
4858
5655
|
*
|
|
5656
|
+
* **When to use**
|
|
5657
|
+
*
|
|
5658
|
+
* Use to divide an iterable into non-overlapping chunks with a maximum chunk
|
|
5659
|
+
* size.
|
|
5660
|
+
*
|
|
4859
5661
|
* **Details**
|
|
4860
5662
|
*
|
|
4861
5663
|
* - `chunksOf(n)([])` is `[]`, not `[[]]`.
|
|
@@ -4881,6 +5683,11 @@ export declare const chunksOf: {
|
|
|
4881
5683
|
* Splits an iterable into chunks of length `n`. The last chunk may be shorter
|
|
4882
5684
|
* if `n` does not evenly divide the length.
|
|
4883
5685
|
*
|
|
5686
|
+
* **When to use**
|
|
5687
|
+
*
|
|
5688
|
+
* Use to divide an iterable into non-overlapping chunks with a maximum chunk
|
|
5689
|
+
* size.
|
|
5690
|
+
*
|
|
4884
5691
|
* **Details**
|
|
4885
5692
|
*
|
|
4886
5693
|
* - `chunksOf(n)([])` is `[]`, not `[[]]`.
|
|
@@ -4906,6 +5713,11 @@ export declare const chunksOf: {
|
|
|
4906
5713
|
* Splits an iterable into chunks of length `n`. The last chunk may be shorter
|
|
4907
5714
|
* if `n` does not evenly divide the length.
|
|
4908
5715
|
*
|
|
5716
|
+
* **When to use**
|
|
5717
|
+
*
|
|
5718
|
+
* Use to divide an iterable into non-overlapping chunks with a maximum chunk
|
|
5719
|
+
* size.
|
|
5720
|
+
*
|
|
4909
5721
|
* **Details**
|
|
4910
5722
|
*
|
|
4911
5723
|
* - `chunksOf(n)([])` is `[]`, not `[[]]`.
|
|
@@ -4931,6 +5743,11 @@ export declare const chunksOf: {
|
|
|
4931
5743
|
* Splits an iterable into chunks of length `n`. The last chunk may be shorter
|
|
4932
5744
|
* if `n` does not evenly divide the length.
|
|
4933
5745
|
*
|
|
5746
|
+
* **When to use**
|
|
5747
|
+
*
|
|
5748
|
+
* Use to divide an iterable into non-overlapping chunks with a maximum chunk
|
|
5749
|
+
* size.
|
|
5750
|
+
*
|
|
4934
5751
|
* **Details**
|
|
4935
5752
|
*
|
|
4936
5753
|
* - `chunksOf(n)([])` is `[]`, not `[[]]`.
|
|
@@ -4956,6 +5773,10 @@ export declare const chunksOf: {
|
|
|
4956
5773
|
/**
|
|
4957
5774
|
* Creates overlapping sliding windows of size `n`.
|
|
4958
5775
|
*
|
|
5776
|
+
* **When to use**
|
|
5777
|
+
*
|
|
5778
|
+
* Use to process sequences with a moving window, such as for computing running averages or detecting patterns.
|
|
5779
|
+
*
|
|
4959
5780
|
* **Details**
|
|
4960
5781
|
*
|
|
4961
5782
|
* - Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
@@ -4979,6 +5800,10 @@ export declare const window: {
|
|
|
4979
5800
|
/**
|
|
4980
5801
|
* Creates overlapping sliding windows of size `n`.
|
|
4981
5802
|
*
|
|
5803
|
+
* **When to use**
|
|
5804
|
+
*
|
|
5805
|
+
* Use to process sequences with a moving window, such as for computing running averages or detecting patterns.
|
|
5806
|
+
*
|
|
4982
5807
|
* **Details**
|
|
4983
5808
|
*
|
|
4984
5809
|
* - Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
@@ -5002,6 +5827,10 @@ export declare const window: {
|
|
|
5002
5827
|
/**
|
|
5003
5828
|
* Creates overlapping sliding windows of size `n`.
|
|
5004
5829
|
*
|
|
5830
|
+
* **When to use**
|
|
5831
|
+
*
|
|
5832
|
+
* Use to process sequences with a moving window, such as for computing running averages or detecting patterns.
|
|
5833
|
+
*
|
|
5005
5834
|
* **Details**
|
|
5006
5835
|
*
|
|
5007
5836
|
* - Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
@@ -5026,6 +5855,11 @@ export declare const window: {
|
|
|
5026
5855
|
/**
|
|
5027
5856
|
* Groups consecutive equal elements using a custom equivalence function.
|
|
5028
5857
|
*
|
|
5858
|
+
* **When to use**
|
|
5859
|
+
*
|
|
5860
|
+
* Use when a non-empty array is already arranged so matching elements are
|
|
5861
|
+
* adjacent and you need a custom equivalence function.
|
|
5862
|
+
*
|
|
5029
5863
|
* **Details**
|
|
5030
5864
|
*
|
|
5031
5865
|
* - Only groups **adjacent** elements — non-adjacent duplicates stay separate.
|
|
@@ -5040,8 +5874,8 @@ export declare const window: {
|
|
|
5040
5874
|
* // [["a", "a"], ["b", "b", "b"], ["c"], ["a"]]
|
|
5041
5875
|
* ```
|
|
5042
5876
|
*
|
|
5043
|
-
* @see {@link group}
|
|
5044
|
-
* @see {@link groupBy}
|
|
5877
|
+
* @see {@link group} for grouping adjacent elements with `Equal.equivalence()`
|
|
5878
|
+
* @see {@link groupBy} for grouping all elements into a record by key, regardless of adjacency
|
|
5045
5879
|
*
|
|
5046
5880
|
* @category grouping
|
|
5047
5881
|
* @since 2.0.0
|
|
@@ -5050,6 +5884,11 @@ export declare const groupWith: {
|
|
|
5050
5884
|
/**
|
|
5051
5885
|
* Groups consecutive equal elements using a custom equivalence function.
|
|
5052
5886
|
*
|
|
5887
|
+
* **When to use**
|
|
5888
|
+
*
|
|
5889
|
+
* Use when a non-empty array is already arranged so matching elements are
|
|
5890
|
+
* adjacent and you need a custom equivalence function.
|
|
5891
|
+
*
|
|
5053
5892
|
* **Details**
|
|
5054
5893
|
*
|
|
5055
5894
|
* - Only groups **adjacent** elements — non-adjacent duplicates stay separate.
|
|
@@ -5064,8 +5903,8 @@ export declare const groupWith: {
|
|
|
5064
5903
|
* // [["a", "a"], ["b", "b", "b"], ["c"], ["a"]]
|
|
5065
5904
|
* ```
|
|
5066
5905
|
*
|
|
5067
|
-
* @see {@link group}
|
|
5068
|
-
* @see {@link groupBy}
|
|
5906
|
+
* @see {@link group} for grouping adjacent elements with `Equal.equivalence()`
|
|
5907
|
+
* @see {@link groupBy} for grouping all elements into a record by key, regardless of adjacency
|
|
5069
5908
|
*
|
|
5070
5909
|
* @category grouping
|
|
5071
5910
|
* @since 2.0.0
|
|
@@ -5074,6 +5913,11 @@ export declare const groupWith: {
|
|
|
5074
5913
|
/**
|
|
5075
5914
|
* Groups consecutive equal elements using a custom equivalence function.
|
|
5076
5915
|
*
|
|
5916
|
+
* **When to use**
|
|
5917
|
+
*
|
|
5918
|
+
* Use when a non-empty array is already arranged so matching elements are
|
|
5919
|
+
* adjacent and you need a custom equivalence function.
|
|
5920
|
+
*
|
|
5077
5921
|
* **Details**
|
|
5078
5922
|
*
|
|
5079
5923
|
* - Only groups **adjacent** elements — non-adjacent duplicates stay separate.
|
|
@@ -5088,8 +5932,8 @@ export declare const groupWith: {
|
|
|
5088
5932
|
* // [["a", "a"], ["b", "b", "b"], ["c"], ["a"]]
|
|
5089
5933
|
* ```
|
|
5090
5934
|
*
|
|
5091
|
-
* @see {@link group}
|
|
5092
|
-
* @see {@link groupBy}
|
|
5935
|
+
* @see {@link group} for grouping adjacent elements with `Equal.equivalence()`
|
|
5936
|
+
* @see {@link groupBy} for grouping all elements into a record by key, regardless of adjacency
|
|
5093
5937
|
*
|
|
5094
5938
|
* @category grouping
|
|
5095
5939
|
* @since 2.0.0
|
|
@@ -5099,6 +5943,11 @@ export declare const groupWith: {
|
|
|
5099
5943
|
/**
|
|
5100
5944
|
* Groups consecutive equal elements using `Equal.equivalence()`.
|
|
5101
5945
|
*
|
|
5946
|
+
* **When to use**
|
|
5947
|
+
*
|
|
5948
|
+
* Use when equal values are already adjacent and Effect's default equality is
|
|
5949
|
+
* the right comparison.
|
|
5950
|
+
*
|
|
5102
5951
|
* **Details**
|
|
5103
5952
|
*
|
|
5104
5953
|
* - Only groups **adjacent** elements.
|
|
@@ -5122,6 +5971,10 @@ export declare const group: <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyArray
|
|
|
5122
5971
|
* Groups elements into a record by a key-returning function. Each key maps
|
|
5123
5972
|
* to a `NonEmptyArray` of elements that produced that key.
|
|
5124
5973
|
*
|
|
5974
|
+
* **When to use**
|
|
5975
|
+
*
|
|
5976
|
+
* Use to build buckets of elements indexed by a computed string or symbol key.
|
|
5977
|
+
*
|
|
5125
5978
|
* **Details**
|
|
5126
5979
|
*
|
|
5127
5980
|
* - Unlike {@link group}/{@link groupWith}, elements do not need to be
|
|
@@ -5155,6 +6008,10 @@ export declare const groupBy: {
|
|
|
5155
6008
|
* Groups elements into a record by a key-returning function. Each key maps
|
|
5156
6009
|
* to a `NonEmptyArray` of elements that produced that key.
|
|
5157
6010
|
*
|
|
6011
|
+
* **When to use**
|
|
6012
|
+
*
|
|
6013
|
+
* Use to build buckets of elements indexed by a computed string or symbol key.
|
|
6014
|
+
*
|
|
5158
6015
|
* **Details**
|
|
5159
6016
|
*
|
|
5160
6017
|
* - Unlike {@link group}/{@link groupWith}, elements do not need to be
|
|
@@ -5188,6 +6045,10 @@ export declare const groupBy: {
|
|
|
5188
6045
|
* Groups elements into a record by a key-returning function. Each key maps
|
|
5189
6046
|
* to a `NonEmptyArray` of elements that produced that key.
|
|
5190
6047
|
*
|
|
6048
|
+
* **When to use**
|
|
6049
|
+
*
|
|
6050
|
+
* Use to build buckets of elements indexed by a computed string or symbol key.
|
|
6051
|
+
*
|
|
5191
6052
|
* **Details**
|
|
5192
6053
|
*
|
|
5193
6054
|
* - Unlike {@link group}/{@link groupWith}, elements do not need to be
|
|
@@ -5222,6 +6083,11 @@ export declare const groupBy: {
|
|
|
5222
6083
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
5223
6084
|
* duplicates.
|
|
5224
6085
|
*
|
|
6086
|
+
* **When to use**
|
|
6087
|
+
*
|
|
6088
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6089
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6090
|
+
*
|
|
5225
6091
|
* **Example** (Union with custom equality)
|
|
5226
6092
|
*
|
|
5227
6093
|
* ```ts
|
|
@@ -5230,9 +6096,9 @@ export declare const groupBy: {
|
|
|
5230
6096
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
5231
6097
|
* ```
|
|
5232
6098
|
*
|
|
5233
|
-
* @see {@link union}
|
|
5234
|
-
* @see {@link
|
|
5235
|
-
* @see {@link
|
|
6099
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
6100
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
6101
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
5236
6102
|
*
|
|
5237
6103
|
* @category elements
|
|
5238
6104
|
* @since 2.0.0
|
|
@@ -5242,6 +6108,11 @@ export declare const unionWith: {
|
|
|
5242
6108
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
5243
6109
|
* duplicates.
|
|
5244
6110
|
*
|
|
6111
|
+
* **When to use**
|
|
6112
|
+
*
|
|
6113
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6114
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6115
|
+
*
|
|
5245
6116
|
* **Example** (Union with custom equality)
|
|
5246
6117
|
*
|
|
5247
6118
|
* ```ts
|
|
@@ -5250,9 +6121,9 @@ export declare const unionWith: {
|
|
|
5250
6121
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
5251
6122
|
* ```
|
|
5252
6123
|
*
|
|
5253
|
-
* @see {@link union}
|
|
5254
|
-
* @see {@link
|
|
5255
|
-
* @see {@link
|
|
6124
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
6125
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
6126
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
5256
6127
|
*
|
|
5257
6128
|
* @category elements
|
|
5258
6129
|
* @since 2.0.0
|
|
@@ -5262,6 +6133,11 @@ export declare const unionWith: {
|
|
|
5262
6133
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
5263
6134
|
* duplicates.
|
|
5264
6135
|
*
|
|
6136
|
+
* **When to use**
|
|
6137
|
+
*
|
|
6138
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6139
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6140
|
+
*
|
|
5265
6141
|
* **Example** (Union with custom equality)
|
|
5266
6142
|
*
|
|
5267
6143
|
* ```ts
|
|
@@ -5270,9 +6146,9 @@ export declare const unionWith: {
|
|
|
5270
6146
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
5271
6147
|
* ```
|
|
5272
6148
|
*
|
|
5273
|
-
* @see {@link union}
|
|
5274
|
-
* @see {@link
|
|
5275
|
-
* @see {@link
|
|
6149
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
6150
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
6151
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
5276
6152
|
*
|
|
5277
6153
|
* @category elements
|
|
5278
6154
|
* @since 2.0.0
|
|
@@ -5282,6 +6158,11 @@ export declare const unionWith: {
|
|
|
5282
6158
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
5283
6159
|
* duplicates.
|
|
5284
6160
|
*
|
|
6161
|
+
* **When to use**
|
|
6162
|
+
*
|
|
6163
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6164
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6165
|
+
*
|
|
5285
6166
|
* **Example** (Union with custom equality)
|
|
5286
6167
|
*
|
|
5287
6168
|
* ```ts
|
|
@@ -5290,9 +6171,9 @@ export declare const unionWith: {
|
|
|
5290
6171
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
5291
6172
|
* ```
|
|
5292
6173
|
*
|
|
5293
|
-
* @see {@link union}
|
|
5294
|
-
* @see {@link
|
|
5295
|
-
* @see {@link
|
|
6174
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
6175
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
6176
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
5296
6177
|
*
|
|
5297
6178
|
* @category elements
|
|
5298
6179
|
* @since 2.0.0
|
|
@@ -5302,6 +6183,11 @@ export declare const unionWith: {
|
|
|
5302
6183
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
5303
6184
|
* duplicates.
|
|
5304
6185
|
*
|
|
6186
|
+
* **When to use**
|
|
6187
|
+
*
|
|
6188
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
6189
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
6190
|
+
*
|
|
5305
6191
|
* **Example** (Union with custom equality)
|
|
5306
6192
|
*
|
|
5307
6193
|
* ```ts
|
|
@@ -5310,9 +6196,9 @@ export declare const unionWith: {
|
|
|
5310
6196
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
5311
6197
|
* ```
|
|
5312
6198
|
*
|
|
5313
|
-
* @see {@link union}
|
|
5314
|
-
* @see {@link
|
|
5315
|
-
* @see {@link
|
|
6199
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
6200
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
6201
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
5316
6202
|
*
|
|
5317
6203
|
* @category elements
|
|
5318
6204
|
* @since 2.0.0
|
|
@@ -5424,6 +6310,11 @@ export declare const union: {
|
|
|
5424
6310
|
* Computes the intersection of two arrays using a custom equivalence. Order is
|
|
5425
6311
|
* determined by the first array.
|
|
5426
6312
|
*
|
|
6313
|
+
* **When to use**
|
|
6314
|
+
*
|
|
6315
|
+
* Use when keeping only values present in both arrays and equality must be
|
|
6316
|
+
* defined by a custom comparator, such as matching objects by id.
|
|
6317
|
+
*
|
|
5427
6318
|
* **Example** (Intersection with custom equality)
|
|
5428
6319
|
*
|
|
5429
6320
|
* ```ts
|
|
@@ -5435,9 +6326,9 @@ export declare const union: {
|
|
|
5435
6326
|
* console.log(Array.intersectionWith(isEquivalent)(array2)(array1)) // [{ id: 1 }, { id: 3 }]
|
|
5436
6327
|
* ```
|
|
5437
6328
|
*
|
|
5438
|
-
* @see {@link intersection}
|
|
5439
|
-
* @see {@link
|
|
5440
|
-
* @see {@link
|
|
6329
|
+
* @see {@link intersection} for the `Equal.equivalence()` variant
|
|
6330
|
+
* @see {@link unionWith} for keeping values from either array with custom equality
|
|
6331
|
+
* @see {@link differenceWith} for keeping values only from the first array with custom equality
|
|
5441
6332
|
*
|
|
5442
6333
|
* @category elements
|
|
5443
6334
|
* @since 2.0.0
|
|
@@ -5511,6 +6402,11 @@ export declare const intersection: {
|
|
|
5511
6402
|
* Computes elements in the first array that are not in the second, using a
|
|
5512
6403
|
* custom equivalence.
|
|
5513
6404
|
*
|
|
6405
|
+
* **When to use**
|
|
6406
|
+
*
|
|
6407
|
+
* Use when keeping only values from the first array and equality must be
|
|
6408
|
+
* defined by a custom comparator, such as matching objects by id.
|
|
6409
|
+
*
|
|
5514
6410
|
* **Example** (Difference with custom equality)
|
|
5515
6411
|
*
|
|
5516
6412
|
* ```ts
|
|
@@ -5520,9 +6416,9 @@ export declare const intersection: {
|
|
|
5520
6416
|
* console.log(diff) // [1]
|
|
5521
6417
|
* ```
|
|
5522
6418
|
*
|
|
5523
|
-
* @see {@link difference}
|
|
5524
|
-
* @see {@link
|
|
5525
|
-
* @see {@link
|
|
6419
|
+
* @see {@link difference} for the `Equal.equivalence()` variant
|
|
6420
|
+
* @see {@link unionWith} for keeping values from either array with custom equality
|
|
6421
|
+
* @see {@link intersectionWith} for keeping values present in both arrays with custom equality
|
|
5526
6422
|
*
|
|
5527
6423
|
* @category elements
|
|
5528
6424
|
* @since 2.0.0
|
|
@@ -5535,6 +6431,11 @@ export declare const differenceWith: <A>(isEquivalent: (self: A, that: A) => boo
|
|
|
5535
6431
|
* Computes elements in the first array that are not in the second, using
|
|
5536
6432
|
* `Equal.equivalence()`.
|
|
5537
6433
|
*
|
|
6434
|
+
* **When to use**
|
|
6435
|
+
*
|
|
6436
|
+
* Use when you need to keep values from the first array that are absent from
|
|
6437
|
+
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
6438
|
+
*
|
|
5538
6439
|
* **Example** (Array difference)
|
|
5539
6440
|
*
|
|
5540
6441
|
* ```ts
|
|
@@ -5555,6 +6456,11 @@ export declare const difference: {
|
|
|
5555
6456
|
* Computes elements in the first array that are not in the second, using
|
|
5556
6457
|
* `Equal.equivalence()`.
|
|
5557
6458
|
*
|
|
6459
|
+
* **When to use**
|
|
6460
|
+
*
|
|
6461
|
+
* Use when you need to keep values from the first array that are absent from
|
|
6462
|
+
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
6463
|
+
*
|
|
5558
6464
|
* **Example** (Array difference)
|
|
5559
6465
|
*
|
|
5560
6466
|
* ```ts
|
|
@@ -5575,6 +6481,11 @@ export declare const difference: {
|
|
|
5575
6481
|
* Computes elements in the first array that are not in the second, using
|
|
5576
6482
|
* `Equal.equivalence()`.
|
|
5577
6483
|
*
|
|
6484
|
+
* **When to use**
|
|
6485
|
+
*
|
|
6486
|
+
* Use when you need to keep values from the first array that are absent from
|
|
6487
|
+
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
6488
|
+
*
|
|
5578
6489
|
* **Example** (Array difference)
|
|
5579
6490
|
*
|
|
5580
6491
|
* ```ts
|
|
@@ -5595,6 +6506,10 @@ export declare const difference: {
|
|
|
5595
6506
|
/**
|
|
5596
6507
|
* Creates an empty array.
|
|
5597
6508
|
*
|
|
6509
|
+
* **When to use**
|
|
6510
|
+
*
|
|
6511
|
+
* Use to create a typed empty array without allocating placeholder elements.
|
|
6512
|
+
*
|
|
5598
6513
|
* **Example** (Creating an empty array)
|
|
5599
6514
|
*
|
|
5600
6515
|
* ```ts
|
|
@@ -5729,6 +6644,10 @@ export declare namespace ReadonlyArray {
|
|
|
5729
6644
|
/**
|
|
5730
6645
|
* Transforms each element using a function, returning a new array.
|
|
5731
6646
|
*
|
|
6647
|
+
* **When to use**
|
|
6648
|
+
*
|
|
6649
|
+
* Use to transform each element independently while preserving the array shape.
|
|
6650
|
+
*
|
|
5732
6651
|
* **Details**
|
|
5733
6652
|
*
|
|
5734
6653
|
* - The function receives `(element, index)`.
|
|
@@ -5751,6 +6670,10 @@ export declare const map: {
|
|
|
5751
6670
|
/**
|
|
5752
6671
|
* Transforms each element using a function, returning a new array.
|
|
5753
6672
|
*
|
|
6673
|
+
* **When to use**
|
|
6674
|
+
*
|
|
6675
|
+
* Use to transform each element independently while preserving the array shape.
|
|
6676
|
+
*
|
|
5754
6677
|
* **Details**
|
|
5755
6678
|
*
|
|
5756
6679
|
* - The function receives `(element, index)`.
|
|
@@ -5773,6 +6696,10 @@ export declare const map: {
|
|
|
5773
6696
|
/**
|
|
5774
6697
|
* Transforms each element using a function, returning a new array.
|
|
5775
6698
|
*
|
|
6699
|
+
* **When to use**
|
|
6700
|
+
*
|
|
6701
|
+
* Use to transform each element independently while preserving the array shape.
|
|
6702
|
+
*
|
|
5776
6703
|
* **Details**
|
|
5777
6704
|
*
|
|
5778
6705
|
* - The function receives `(element, index)`.
|
|
@@ -5796,6 +6723,11 @@ export declare const map: {
|
|
|
5796
6723
|
/**
|
|
5797
6724
|
* Maps each element to an array and flattens the results into a single array.
|
|
5798
6725
|
*
|
|
6726
|
+
* **When to use**
|
|
6727
|
+
*
|
|
6728
|
+
* Use to map each element to zero or more values and concatenate the results in
|
|
6729
|
+
* one pass.
|
|
6730
|
+
*
|
|
5799
6731
|
* **Details**
|
|
5800
6732
|
*
|
|
5801
6733
|
* - The function receives `(element, index)`.
|
|
@@ -5819,6 +6751,11 @@ export declare const flatMap: {
|
|
|
5819
6751
|
/**
|
|
5820
6752
|
* Maps each element to an array and flattens the results into a single array.
|
|
5821
6753
|
*
|
|
6754
|
+
* **When to use**
|
|
6755
|
+
*
|
|
6756
|
+
* Use to map each element to zero or more values and concatenate the results in
|
|
6757
|
+
* one pass.
|
|
6758
|
+
*
|
|
5822
6759
|
* **Details**
|
|
5823
6760
|
*
|
|
5824
6761
|
* - The function receives `(element, index)`.
|
|
@@ -5842,6 +6779,11 @@ export declare const flatMap: {
|
|
|
5842
6779
|
/**
|
|
5843
6780
|
* Maps each element to an array and flattens the results into a single array.
|
|
5844
6781
|
*
|
|
6782
|
+
* **When to use**
|
|
6783
|
+
*
|
|
6784
|
+
* Use to map each element to zero or more values and concatenate the results in
|
|
6785
|
+
* one pass.
|
|
6786
|
+
*
|
|
5845
6787
|
* **Details**
|
|
5846
6788
|
*
|
|
5847
6789
|
* - The function receives `(element, index)`.
|
|
@@ -5865,6 +6807,11 @@ export declare const flatMap: {
|
|
|
5865
6807
|
/**
|
|
5866
6808
|
* Maps each element to an array and flattens the results into a single array.
|
|
5867
6809
|
*
|
|
6810
|
+
* **When to use**
|
|
6811
|
+
*
|
|
6812
|
+
* Use to map each element to zero or more values and concatenate the results in
|
|
6813
|
+
* one pass.
|
|
6814
|
+
*
|
|
5868
6815
|
* **Details**
|
|
5869
6816
|
*
|
|
5870
6817
|
* - The function receives `(element, index)`.
|
|
@@ -5889,6 +6836,11 @@ export declare const flatMap: {
|
|
|
5889
6836
|
/**
|
|
5890
6837
|
* Flattens a nested array of arrays into a single array.
|
|
5891
6838
|
*
|
|
6839
|
+
* **When to use**
|
|
6840
|
+
*
|
|
6841
|
+
* Use to collapse one level of nested arrays when no per-element mapping is
|
|
6842
|
+
* needed.
|
|
6843
|
+
*
|
|
5892
6844
|
* **Example** (Flattening nested arrays)
|
|
5893
6845
|
*
|
|
5894
6846
|
* ```ts
|
|
@@ -5906,6 +6858,11 @@ export declare const flatten: <const S extends ReadonlyArray<ReadonlyArray<any>>
|
|
|
5906
6858
|
/**
|
|
5907
6859
|
* Extracts all `Some` values from an iterable of `Option`s, discarding `None`s.
|
|
5908
6860
|
*
|
|
6861
|
+
* **When to use**
|
|
6862
|
+
*
|
|
6863
|
+
* Use to collect only present values from `Option` values while discarding
|
|
6864
|
+
* `None` values.
|
|
6865
|
+
*
|
|
5909
6866
|
* **Example** (Extracting Some values)
|
|
5910
6867
|
*
|
|
5911
6868
|
* ```ts
|
|
@@ -5925,6 +6882,11 @@ export declare const getSomes: <T extends Iterable<Option.Option<X>>, X = any>(s
|
|
|
5925
6882
|
* Extracts all failure values from an iterable of `Result`s, discarding
|
|
5926
6883
|
* successes.
|
|
5927
6884
|
*
|
|
6885
|
+
* **When to use**
|
|
6886
|
+
*
|
|
6887
|
+
* Use to collect only failure values from `Result` values while discarding
|
|
6888
|
+
* successes.
|
|
6889
|
+
*
|
|
5928
6890
|
* **Example** (Extracting failures)
|
|
5929
6891
|
*
|
|
5930
6892
|
* ```ts
|
|
@@ -5945,6 +6907,11 @@ export declare const getFailures: <T extends Iterable<Result.Result<any, any>>>(
|
|
|
5945
6907
|
* Extracts all success values from an iterable of `Result`s, discarding
|
|
5946
6908
|
* failures.
|
|
5947
6909
|
*
|
|
6910
|
+
* **When to use**
|
|
6911
|
+
*
|
|
6912
|
+
* Use to collect only success values from `Result` values while discarding
|
|
6913
|
+
* failures.
|
|
6914
|
+
*
|
|
5948
6915
|
* **Example** (Extracting successes)
|
|
5949
6916
|
*
|
|
5950
6917
|
* ```ts
|
|
@@ -5964,6 +6931,11 @@ export declare const getSuccesses: <T extends Iterable<Result.Result<any, any>>>
|
|
|
5964
6931
|
/**
|
|
5965
6932
|
* Keeps transformed values for elements where a `Filter` succeeds.
|
|
5966
6933
|
*
|
|
6934
|
+
* **When to use**
|
|
6935
|
+
*
|
|
6936
|
+
* Use to transform elements with a `Result`-returning filter while discarding
|
|
6937
|
+
* failures.
|
|
6938
|
+
*
|
|
5967
6939
|
* **Details**
|
|
5968
6940
|
*
|
|
5969
6941
|
* - The filter receives `(element, index)`.
|
|
@@ -5979,6 +6951,7 @@ export declare const getSuccesses: <T extends Iterable<Result.Result<any, any>>>
|
|
|
5979
6951
|
* ```
|
|
5980
6952
|
*
|
|
5981
6953
|
* @see {@link filter} — keep original elements matching a predicate
|
|
6954
|
+
* @see {@link partition} for keeping both failures and successes
|
|
5982
6955
|
*
|
|
5983
6956
|
* @category filtering
|
|
5984
6957
|
* @since 2.0.0
|
|
@@ -5987,6 +6960,11 @@ export declare const filterMap: {
|
|
|
5987
6960
|
/**
|
|
5988
6961
|
* Keeps transformed values for elements where a `Filter` succeeds.
|
|
5989
6962
|
*
|
|
6963
|
+
* **When to use**
|
|
6964
|
+
*
|
|
6965
|
+
* Use to transform elements with a `Result`-returning filter while discarding
|
|
6966
|
+
* failures.
|
|
6967
|
+
*
|
|
5990
6968
|
* **Details**
|
|
5991
6969
|
*
|
|
5992
6970
|
* - The filter receives `(element, index)`.
|
|
@@ -6002,6 +6980,7 @@ export declare const filterMap: {
|
|
|
6002
6980
|
* ```
|
|
6003
6981
|
*
|
|
6004
6982
|
* @see {@link filter} — keep original elements matching a predicate
|
|
6983
|
+
* @see {@link partition} for keeping both failures and successes
|
|
6005
6984
|
*
|
|
6006
6985
|
* @category filtering
|
|
6007
6986
|
* @since 2.0.0
|
|
@@ -6010,6 +6989,11 @@ export declare const filterMap: {
|
|
|
6010
6989
|
/**
|
|
6011
6990
|
* Keeps transformed values for elements where a `Filter` succeeds.
|
|
6012
6991
|
*
|
|
6992
|
+
* **When to use**
|
|
6993
|
+
*
|
|
6994
|
+
* Use to transform elements with a `Result`-returning filter while discarding
|
|
6995
|
+
* failures.
|
|
6996
|
+
*
|
|
6013
6997
|
* **Details**
|
|
6014
6998
|
*
|
|
6015
6999
|
* - The filter receives `(element, index)`.
|
|
@@ -6025,6 +7009,7 @@ export declare const filterMap: {
|
|
|
6025
7009
|
* ```
|
|
6026
7010
|
*
|
|
6027
7011
|
* @see {@link filter} — keep original elements matching a predicate
|
|
7012
|
+
* @see {@link partition} for keeping both failures and successes
|
|
6028
7013
|
*
|
|
6029
7014
|
* @category filtering
|
|
6030
7015
|
* @since 2.0.0
|
|
@@ -6034,6 +7019,10 @@ export declare const filterMap: {
|
|
|
6034
7019
|
/**
|
|
6035
7020
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
6036
7021
|
*
|
|
7022
|
+
* **When to use**
|
|
7023
|
+
*
|
|
7024
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
7025
|
+
*
|
|
6037
7026
|
* **Details**
|
|
6038
7027
|
*
|
|
6039
7028
|
* - The predicate receives `(element, index)`.
|
|
@@ -6048,6 +7037,7 @@ export declare const filterMap: {
|
|
|
6048
7037
|
* ```
|
|
6049
7038
|
*
|
|
6050
7039
|
* @see {@link partition} — split into matching and non-matching
|
|
7040
|
+
* @see {@link filterMap} for transforming while filtering
|
|
6051
7041
|
*
|
|
6052
7042
|
* @category filtering
|
|
6053
7043
|
* @since 2.0.0
|
|
@@ -6056,6 +7046,10 @@ export declare const filter: {
|
|
|
6056
7046
|
/**
|
|
6057
7047
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
6058
7048
|
*
|
|
7049
|
+
* **When to use**
|
|
7050
|
+
*
|
|
7051
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
7052
|
+
*
|
|
6059
7053
|
* **Details**
|
|
6060
7054
|
*
|
|
6061
7055
|
* - The predicate receives `(element, index)`.
|
|
@@ -6070,6 +7064,7 @@ export declare const filter: {
|
|
|
6070
7064
|
* ```
|
|
6071
7065
|
*
|
|
6072
7066
|
* @see {@link partition} — split into matching and non-matching
|
|
7067
|
+
* @see {@link filterMap} for transforming while filtering
|
|
6073
7068
|
*
|
|
6074
7069
|
* @category filtering
|
|
6075
7070
|
* @since 2.0.0
|
|
@@ -6078,6 +7073,10 @@ export declare const filter: {
|
|
|
6078
7073
|
/**
|
|
6079
7074
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
6080
7075
|
*
|
|
7076
|
+
* **When to use**
|
|
7077
|
+
*
|
|
7078
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
7079
|
+
*
|
|
6081
7080
|
* **Details**
|
|
6082
7081
|
*
|
|
6083
7082
|
* - The predicate receives `(element, index)`.
|
|
@@ -6092,6 +7091,7 @@ export declare const filter: {
|
|
|
6092
7091
|
* ```
|
|
6093
7092
|
*
|
|
6094
7093
|
* @see {@link partition} — split into matching and non-matching
|
|
7094
|
+
* @see {@link filterMap} for transforming while filtering
|
|
6095
7095
|
*
|
|
6096
7096
|
* @category filtering
|
|
6097
7097
|
* @since 2.0.0
|
|
@@ -6100,6 +7100,10 @@ export declare const filter: {
|
|
|
6100
7100
|
/**
|
|
6101
7101
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
6102
7102
|
*
|
|
7103
|
+
* **When to use**
|
|
7104
|
+
*
|
|
7105
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
7106
|
+
*
|
|
6103
7107
|
* **Details**
|
|
6104
7108
|
*
|
|
6105
7109
|
* - The predicate receives `(element, index)`.
|
|
@@ -6114,6 +7118,7 @@ export declare const filter: {
|
|
|
6114
7118
|
* ```
|
|
6115
7119
|
*
|
|
6116
7120
|
* @see {@link partition} — split into matching and non-matching
|
|
7121
|
+
* @see {@link filterMap} for transforming while filtering
|
|
6117
7122
|
*
|
|
6118
7123
|
* @category filtering
|
|
6119
7124
|
* @since 2.0.0
|
|
@@ -6122,6 +7127,10 @@ export declare const filter: {
|
|
|
6122
7127
|
/**
|
|
6123
7128
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
6124
7129
|
*
|
|
7130
|
+
* **When to use**
|
|
7131
|
+
*
|
|
7132
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
7133
|
+
*
|
|
6125
7134
|
* **Details**
|
|
6126
7135
|
*
|
|
6127
7136
|
* - The predicate receives `(element, index)`.
|
|
@@ -6136,6 +7145,7 @@ export declare const filter: {
|
|
|
6136
7145
|
* ```
|
|
6137
7146
|
*
|
|
6138
7147
|
* @see {@link partition} — split into matching and non-matching
|
|
7148
|
+
* @see {@link filterMap} for transforming while filtering
|
|
6139
7149
|
*
|
|
6140
7150
|
* @category filtering
|
|
6141
7151
|
* @since 2.0.0
|
|
@@ -6145,6 +7155,11 @@ export declare const filter: {
|
|
|
6145
7155
|
/**
|
|
6146
7156
|
* Splits an iterable using a `Filter` into failures and successes.
|
|
6147
7157
|
*
|
|
7158
|
+
* **When to use**
|
|
7159
|
+
*
|
|
7160
|
+
* Use to evaluate each element with a `Result`-returning filter and keep both
|
|
7161
|
+
* failure and success values.
|
|
7162
|
+
*
|
|
6148
7163
|
* **Details**
|
|
6149
7164
|
*
|
|
6150
7165
|
* - Returns `[excluded, satisfying]`.
|
|
@@ -6162,6 +7177,7 @@ export declare const filter: {
|
|
|
6162
7177
|
* ```
|
|
6163
7178
|
*
|
|
6164
7179
|
* @see {@link filter} — keep only matching elements
|
|
7180
|
+
* @see {@link filterMap} for discarding failures
|
|
6165
7181
|
* @see {@link separate} — split an iterable of `Result` values
|
|
6166
7182
|
*
|
|
6167
7183
|
* @category filtering
|
|
@@ -6171,6 +7187,11 @@ export declare const partition: {
|
|
|
6171
7187
|
/**
|
|
6172
7188
|
* Splits an iterable using a `Filter` into failures and successes.
|
|
6173
7189
|
*
|
|
7190
|
+
* **When to use**
|
|
7191
|
+
*
|
|
7192
|
+
* Use to evaluate each element with a `Result`-returning filter and keep both
|
|
7193
|
+
* failure and success values.
|
|
7194
|
+
*
|
|
6174
7195
|
* **Details**
|
|
6175
7196
|
*
|
|
6176
7197
|
* - Returns `[excluded, satisfying]`.
|
|
@@ -6188,6 +7209,7 @@ export declare const partition: {
|
|
|
6188
7209
|
* ```
|
|
6189
7210
|
*
|
|
6190
7211
|
* @see {@link filter} — keep only matching elements
|
|
7212
|
+
* @see {@link filterMap} for discarding failures
|
|
6191
7213
|
* @see {@link separate} — split an iterable of `Result` values
|
|
6192
7214
|
*
|
|
6193
7215
|
* @category filtering
|
|
@@ -6197,6 +7219,11 @@ export declare const partition: {
|
|
|
6197
7219
|
/**
|
|
6198
7220
|
* Splits an iterable using a `Filter` into failures and successes.
|
|
6199
7221
|
*
|
|
7222
|
+
* **When to use**
|
|
7223
|
+
*
|
|
7224
|
+
* Use to evaluate each element with a `Result`-returning filter and keep both
|
|
7225
|
+
* failure and success values.
|
|
7226
|
+
*
|
|
6200
7227
|
* **Details**
|
|
6201
7228
|
*
|
|
6202
7229
|
* - Returns `[excluded, satisfying]`.
|
|
@@ -6214,6 +7241,7 @@ export declare const partition: {
|
|
|
6214
7241
|
* ```
|
|
6215
7242
|
*
|
|
6216
7243
|
* @see {@link filter} — keep only matching elements
|
|
7244
|
+
* @see {@link filterMap} for discarding failures
|
|
6217
7245
|
* @see {@link separate} — split an iterable of `Result` values
|
|
6218
7246
|
*
|
|
6219
7247
|
* @category filtering
|
|
@@ -6224,6 +7252,10 @@ export declare const partition: {
|
|
|
6224
7252
|
/**
|
|
6225
7253
|
* Separates an iterable of `Result`s into failure values and success values.
|
|
6226
7254
|
*
|
|
7255
|
+
* **When to use**
|
|
7256
|
+
*
|
|
7257
|
+
* Use to split existing `Result` values into failure and success arrays.
|
|
7258
|
+
*
|
|
6227
7259
|
* **Details**
|
|
6228
7260
|
*
|
|
6229
7261
|
* - Returns `[failures, successes]`.
|
|
@@ -6243,6 +7275,7 @@ export declare const partition: {
|
|
|
6243
7275
|
*
|
|
6244
7276
|
* @see {@link getFailures} — extract only failures
|
|
6245
7277
|
* @see {@link getSuccesses} — extract only successes
|
|
7278
|
+
* @see {@link partition} for computing `Result` values while splitting
|
|
6246
7279
|
*
|
|
6247
7280
|
* @category filtering
|
|
6248
7281
|
* @since 2.0.0
|
|
@@ -6254,6 +7287,10 @@ export declare const separate: <T extends Iterable<Result.Result<any, any>>>(sel
|
|
|
6254
7287
|
/**
|
|
6255
7288
|
* Folds an iterable from left to right into a single value.
|
|
6256
7289
|
*
|
|
7290
|
+
* **When to use**
|
|
7291
|
+
*
|
|
7292
|
+
* Use to combine all elements into one accumulated value from left to right.
|
|
7293
|
+
*
|
|
6257
7294
|
* **Details**
|
|
6258
7295
|
*
|
|
6259
7296
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -6276,6 +7313,10 @@ export declare const reduce: {
|
|
|
6276
7313
|
/**
|
|
6277
7314
|
* Folds an iterable from left to right into a single value.
|
|
6278
7315
|
*
|
|
7316
|
+
* **When to use**
|
|
7317
|
+
*
|
|
7318
|
+
* Use to combine all elements into one accumulated value from left to right.
|
|
7319
|
+
*
|
|
6279
7320
|
* **Details**
|
|
6280
7321
|
*
|
|
6281
7322
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -6298,6 +7339,10 @@ export declare const reduce: {
|
|
|
6298
7339
|
/**
|
|
6299
7340
|
* Folds an iterable from left to right into a single value.
|
|
6300
7341
|
*
|
|
7342
|
+
* **When to use**
|
|
7343
|
+
*
|
|
7344
|
+
* Use to combine all elements into one accumulated value from left to right.
|
|
7345
|
+
*
|
|
6301
7346
|
* **Details**
|
|
6302
7347
|
*
|
|
6303
7348
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -6321,6 +7366,11 @@ export declare const reduce: {
|
|
|
6321
7366
|
/**
|
|
6322
7367
|
* Folds an iterable from right to left into a single value.
|
|
6323
7368
|
*
|
|
7369
|
+
* **When to use**
|
|
7370
|
+
*
|
|
7371
|
+
* Use when folding order matters and values must be combined from right to
|
|
7372
|
+
* left.
|
|
7373
|
+
*
|
|
6324
7374
|
* **Details**
|
|
6325
7375
|
*
|
|
6326
7376
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -6343,6 +7393,11 @@ export declare const reduceRight: {
|
|
|
6343
7393
|
/**
|
|
6344
7394
|
* Folds an iterable from right to left into a single value.
|
|
6345
7395
|
*
|
|
7396
|
+
* **When to use**
|
|
7397
|
+
*
|
|
7398
|
+
* Use when folding order matters and values must be combined from right to
|
|
7399
|
+
* left.
|
|
7400
|
+
*
|
|
6346
7401
|
* **Details**
|
|
6347
7402
|
*
|
|
6348
7403
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -6365,6 +7420,11 @@ export declare const reduceRight: {
|
|
|
6365
7420
|
/**
|
|
6366
7421
|
* Folds an iterable from right to left into a single value.
|
|
6367
7422
|
*
|
|
7423
|
+
* **When to use**
|
|
7424
|
+
*
|
|
7425
|
+
* Use when folding order matters and values must be combined from right to
|
|
7426
|
+
* left.
|
|
7427
|
+
*
|
|
6368
7428
|
* **Details**
|
|
6369
7429
|
*
|
|
6370
7430
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -6457,6 +7517,10 @@ export declare const liftOption: <A extends Array<unknown>, B>(f: (...a: A) => O
|
|
|
6457
7517
|
* Converts a nullable value to an array: `null`/`undefined` becomes `[]`,
|
|
6458
7518
|
* anything else becomes `[value]`.
|
|
6459
7519
|
*
|
|
7520
|
+
* **When to use**
|
|
7521
|
+
*
|
|
7522
|
+
* Use to treat a nullable single value as zero or one array element.
|
|
7523
|
+
*
|
|
6460
7524
|
* **Example** (Nullable to array)
|
|
6461
7525
|
*
|
|
6462
7526
|
* ```ts
|
|
@@ -6502,6 +7566,11 @@ export declare const liftNullishOr: <A extends Array<unknown>, B>(f: (...a: A) =
|
|
|
6502
7566
|
* Maps each element with a nullable-returning function, keeping only non-null /
|
|
6503
7567
|
* non-undefined results.
|
|
6504
7568
|
*
|
|
7569
|
+
* **When to use**
|
|
7570
|
+
*
|
|
7571
|
+
* Use when mapping and filtering in one step, where the mapper can return
|
|
7572
|
+
* `null` or `undefined` to skip elements.
|
|
7573
|
+
*
|
|
6505
7574
|
* **Example** (FlatMapping with nullable)
|
|
6506
7575
|
*
|
|
6507
7576
|
* ```ts
|
|
@@ -6511,6 +7580,9 @@ export declare const liftNullishOr: <A extends Array<unknown>, B>(f: (...a: A) =
|
|
|
6511
7580
|
* // [1, 3]
|
|
6512
7581
|
* ```
|
|
6513
7582
|
*
|
|
7583
|
+
* @see {@link flatMap} for mapping each element to an array and flattening
|
|
7584
|
+
* @see {@link fromNullishOr} for converting a single nullable value to an array
|
|
7585
|
+
*
|
|
6514
7586
|
* @category sequencing
|
|
6515
7587
|
* @since 4.0.0
|
|
6516
7588
|
*/
|
|
@@ -6519,6 +7591,11 @@ export declare const flatMapNullishOr: {
|
|
|
6519
7591
|
* Maps each element with a nullable-returning function, keeping only non-null /
|
|
6520
7592
|
* non-undefined results.
|
|
6521
7593
|
*
|
|
7594
|
+
* **When to use**
|
|
7595
|
+
*
|
|
7596
|
+
* Use when mapping and filtering in one step, where the mapper can return
|
|
7597
|
+
* `null` or `undefined` to skip elements.
|
|
7598
|
+
*
|
|
6522
7599
|
* **Example** (FlatMapping with nullable)
|
|
6523
7600
|
*
|
|
6524
7601
|
* ```ts
|
|
@@ -6528,6 +7605,9 @@ export declare const flatMapNullishOr: {
|
|
|
6528
7605
|
* // [1, 3]
|
|
6529
7606
|
* ```
|
|
6530
7607
|
*
|
|
7608
|
+
* @see {@link flatMap} for mapping each element to an array and flattening
|
|
7609
|
+
* @see {@link fromNullishOr} for converting a single nullable value to an array
|
|
7610
|
+
*
|
|
6531
7611
|
* @category sequencing
|
|
6532
7612
|
* @since 4.0.0
|
|
6533
7613
|
*/
|
|
@@ -6536,6 +7616,11 @@ export declare const flatMapNullishOr: {
|
|
|
6536
7616
|
* Maps each element with a nullable-returning function, keeping only non-null /
|
|
6537
7617
|
* non-undefined results.
|
|
6538
7618
|
*
|
|
7619
|
+
* **When to use**
|
|
7620
|
+
*
|
|
7621
|
+
* Use when mapping and filtering in one step, where the mapper can return
|
|
7622
|
+
* `null` or `undefined` to skip elements.
|
|
7623
|
+
*
|
|
6539
7624
|
* **Example** (FlatMapping with nullable)
|
|
6540
7625
|
*
|
|
6541
7626
|
* ```ts
|
|
@@ -6545,6 +7630,9 @@ export declare const flatMapNullishOr: {
|
|
|
6545
7630
|
* // [1, 3]
|
|
6546
7631
|
* ```
|
|
6547
7632
|
*
|
|
7633
|
+
* @see {@link flatMap} for mapping each element to an array and flattening
|
|
7634
|
+
* @see {@link fromNullishOr} for converting a single nullable value to an array
|
|
7635
|
+
*
|
|
6548
7636
|
* @category sequencing
|
|
6549
7637
|
* @since 4.0.0
|
|
6550
7638
|
*/
|
|
@@ -6580,6 +7668,11 @@ export declare const liftResult: <A extends Array<unknown>, E, B>(f: (...a: A) =
|
|
|
6580
7668
|
* Tests whether all elements satisfy the predicate. Supports refinements for
|
|
6581
7669
|
* type narrowing.
|
|
6582
7670
|
*
|
|
7671
|
+
* **When to use**
|
|
7672
|
+
*
|
|
7673
|
+
* Use to check that all elements satisfy a predicate, including
|
|
7674
|
+
* refinement-based type narrowing.
|
|
7675
|
+
*
|
|
6583
7676
|
* **Example** (Testing all elements)
|
|
6584
7677
|
*
|
|
6585
7678
|
* ```ts
|
|
@@ -6599,6 +7692,11 @@ export declare const every: {
|
|
|
6599
7692
|
* Tests whether all elements satisfy the predicate. Supports refinements for
|
|
6600
7693
|
* type narrowing.
|
|
6601
7694
|
*
|
|
7695
|
+
* **When to use**
|
|
7696
|
+
*
|
|
7697
|
+
* Use to check that all elements satisfy a predicate, including
|
|
7698
|
+
* refinement-based type narrowing.
|
|
7699
|
+
*
|
|
6602
7700
|
* **Example** (Testing all elements)
|
|
6603
7701
|
*
|
|
6604
7702
|
* ```ts
|
|
@@ -6618,6 +7716,11 @@ export declare const every: {
|
|
|
6618
7716
|
* Tests whether all elements satisfy the predicate. Supports refinements for
|
|
6619
7717
|
* type narrowing.
|
|
6620
7718
|
*
|
|
7719
|
+
* **When to use**
|
|
7720
|
+
*
|
|
7721
|
+
* Use to check that all elements satisfy a predicate, including
|
|
7722
|
+
* refinement-based type narrowing.
|
|
7723
|
+
*
|
|
6621
7724
|
* **Example** (Testing all elements)
|
|
6622
7725
|
*
|
|
6623
7726
|
* ```ts
|
|
@@ -6637,6 +7740,11 @@ export declare const every: {
|
|
|
6637
7740
|
* Tests whether all elements satisfy the predicate. Supports refinements for
|
|
6638
7741
|
* type narrowing.
|
|
6639
7742
|
*
|
|
7743
|
+
* **When to use**
|
|
7744
|
+
*
|
|
7745
|
+
* Use to check that all elements satisfy a predicate, including
|
|
7746
|
+
* refinement-based type narrowing.
|
|
7747
|
+
*
|
|
6640
7748
|
* **Example** (Testing all elements)
|
|
6641
7749
|
*
|
|
6642
7750
|
* ```ts
|
|
@@ -6656,6 +7764,11 @@ export declare const every: {
|
|
|
6656
7764
|
* Tests whether all elements satisfy the predicate. Supports refinements for
|
|
6657
7765
|
* type narrowing.
|
|
6658
7766
|
*
|
|
7767
|
+
* **When to use**
|
|
7768
|
+
*
|
|
7769
|
+
* Use to check that all elements satisfy a predicate, including
|
|
7770
|
+
* refinement-based type narrowing.
|
|
7771
|
+
*
|
|
6659
7772
|
* **Example** (Testing all elements)
|
|
6660
7773
|
*
|
|
6661
7774
|
* ```ts
|
|
@@ -6737,6 +7850,11 @@ export declare const some: {
|
|
|
6737
7850
|
* Applies a function to each suffix of the array (starting from each index),
|
|
6738
7851
|
* collecting the results.
|
|
6739
7852
|
*
|
|
7853
|
+
* **When to use**
|
|
7854
|
+
*
|
|
7855
|
+
* Use when a computation depends on every suffix of an array, such as
|
|
7856
|
+
* cumulative aggregations from each position.
|
|
7857
|
+
*
|
|
6740
7858
|
* **Details**
|
|
6741
7859
|
*
|
|
6742
7860
|
* - For index `i`, the function receives `self.slice(i)`.
|
|
@@ -6749,6 +7867,8 @@ export declare const some: {
|
|
|
6749
7867
|
* console.log(Array.extend([1, 2, 3], (as) => as.length)) // [3, 2, 1]
|
|
6750
7868
|
* ```
|
|
6751
7869
|
*
|
|
7870
|
+
* @see {@link scan} for keeping intermediate accumulator values during a fold
|
|
7871
|
+
*
|
|
6752
7872
|
* @category mapping
|
|
6753
7873
|
* @since 2.0.0
|
|
6754
7874
|
*/
|
|
@@ -6757,6 +7877,11 @@ export declare const extend: {
|
|
|
6757
7877
|
* Applies a function to each suffix of the array (starting from each index),
|
|
6758
7878
|
* collecting the results.
|
|
6759
7879
|
*
|
|
7880
|
+
* **When to use**
|
|
7881
|
+
*
|
|
7882
|
+
* Use when a computation depends on every suffix of an array, such as
|
|
7883
|
+
* cumulative aggregations from each position.
|
|
7884
|
+
*
|
|
6760
7885
|
* **Details**
|
|
6761
7886
|
*
|
|
6762
7887
|
* - For index `i`, the function receives `self.slice(i)`.
|
|
@@ -6769,6 +7894,8 @@ export declare const extend: {
|
|
|
6769
7894
|
* console.log(Array.extend([1, 2, 3], (as) => as.length)) // [3, 2, 1]
|
|
6770
7895
|
* ```
|
|
6771
7896
|
*
|
|
7897
|
+
* @see {@link scan} for keeping intermediate accumulator values during a fold
|
|
7898
|
+
*
|
|
6772
7899
|
* @category mapping
|
|
6773
7900
|
* @since 2.0.0
|
|
6774
7901
|
*/
|
|
@@ -6777,6 +7904,11 @@ export declare const extend: {
|
|
|
6777
7904
|
* Applies a function to each suffix of the array (starting from each index),
|
|
6778
7905
|
* collecting the results.
|
|
6779
7906
|
*
|
|
7907
|
+
* **When to use**
|
|
7908
|
+
*
|
|
7909
|
+
* Use when a computation depends on every suffix of an array, such as
|
|
7910
|
+
* cumulative aggregations from each position.
|
|
7911
|
+
*
|
|
6780
7912
|
* **Details**
|
|
6781
7913
|
*
|
|
6782
7914
|
* - For index `i`, the function receives `self.slice(i)`.
|
|
@@ -6789,6 +7921,8 @@ export declare const extend: {
|
|
|
6789
7921
|
* console.log(Array.extend([1, 2, 3], (as) => as.length)) // [3, 2, 1]
|
|
6790
7922
|
* ```
|
|
6791
7923
|
*
|
|
7924
|
+
* @see {@link scan} for keeping intermediate accumulator values during a fold
|
|
7925
|
+
*
|
|
6792
7926
|
* @category mapping
|
|
6793
7927
|
* @since 2.0.0
|
|
6794
7928
|
*/
|
|
@@ -6974,6 +8108,11 @@ export declare const makeEquivalence: <A>(isEquivalent: Equivalence.Equivalence<
|
|
|
6974
8108
|
/**
|
|
6975
8109
|
* Runs a side-effect for each element. The callback receives `(element, index)`.
|
|
6976
8110
|
*
|
|
8111
|
+
* **When to use**
|
|
8112
|
+
*
|
|
8113
|
+
* Use to iterate over an array for side-effects only, when no transformed
|
|
8114
|
+
* result is needed.
|
|
8115
|
+
*
|
|
6977
8116
|
* **Example** (Iterating with side-effects)
|
|
6978
8117
|
*
|
|
6979
8118
|
* ```ts
|
|
@@ -6982,6 +8121,8 @@ export declare const makeEquivalence: <A>(isEquivalent: Equivalence.Equivalence<
|
|
|
6982
8121
|
* Array.forEach([1, 2, 3], (n) => console.log(n)) // 1, 2, 3
|
|
6983
8122
|
* ```
|
|
6984
8123
|
*
|
|
8124
|
+
* @see {@link map} for transforming each element into a new array
|
|
8125
|
+
*
|
|
6985
8126
|
* @category elements
|
|
6986
8127
|
* @since 2.0.0
|
|
6987
8128
|
*/
|
|
@@ -6989,6 +8130,11 @@ export declare const forEach: {
|
|
|
6989
8130
|
/**
|
|
6990
8131
|
* Runs a side-effect for each element. The callback receives `(element, index)`.
|
|
6991
8132
|
*
|
|
8133
|
+
* **When to use**
|
|
8134
|
+
*
|
|
8135
|
+
* Use to iterate over an array for side-effects only, when no transformed
|
|
8136
|
+
* result is needed.
|
|
8137
|
+
*
|
|
6992
8138
|
* **Example** (Iterating with side-effects)
|
|
6993
8139
|
*
|
|
6994
8140
|
* ```ts
|
|
@@ -6997,6 +8143,8 @@ export declare const forEach: {
|
|
|
6997
8143
|
* Array.forEach([1, 2, 3], (n) => console.log(n)) // 1, 2, 3
|
|
6998
8144
|
* ```
|
|
6999
8145
|
*
|
|
8146
|
+
* @see {@link map} for transforming each element into a new array
|
|
8147
|
+
*
|
|
7000
8148
|
* @category elements
|
|
7001
8149
|
* @since 2.0.0
|
|
7002
8150
|
*/
|
|
@@ -7004,6 +8152,11 @@ export declare const forEach: {
|
|
|
7004
8152
|
/**
|
|
7005
8153
|
* Runs a side-effect for each element. The callback receives `(element, index)`.
|
|
7006
8154
|
*
|
|
8155
|
+
* **When to use**
|
|
8156
|
+
*
|
|
8157
|
+
* Use to iterate over an array for side-effects only, when no transformed
|
|
8158
|
+
* result is needed.
|
|
8159
|
+
*
|
|
7007
8160
|
* **Example** (Iterating with side-effects)
|
|
7008
8161
|
*
|
|
7009
8162
|
* ```ts
|
|
@@ -7012,6 +8165,8 @@ export declare const forEach: {
|
|
|
7012
8165
|
* Array.forEach([1, 2, 3], (n) => console.log(n)) // 1, 2, 3
|
|
7013
8166
|
* ```
|
|
7014
8167
|
*
|
|
8168
|
+
* @see {@link map} for transforming each element into a new array
|
|
8169
|
+
*
|
|
7015
8170
|
* @category elements
|
|
7016
8171
|
* @since 2.0.0
|
|
7017
8172
|
*/
|
|
@@ -7021,6 +8176,11 @@ export declare const forEach: {
|
|
|
7021
8176
|
* Removes duplicates using a custom equivalence, preserving the order of the
|
|
7022
8177
|
* first occurrence.
|
|
7023
8178
|
*
|
|
8179
|
+
* **When to use**
|
|
8180
|
+
*
|
|
8181
|
+
* Use to remove all duplicate elements with a custom equivalence when default
|
|
8182
|
+
* equality is not appropriate.
|
|
8183
|
+
*
|
|
7024
8184
|
* **Example** (Deduplicating with custom equality)
|
|
7025
8185
|
*
|
|
7026
8186
|
* ```ts
|
|
@@ -7040,6 +8200,11 @@ export declare const dedupeWith: {
|
|
|
7040
8200
|
* Removes duplicates using a custom equivalence, preserving the order of the
|
|
7041
8201
|
* first occurrence.
|
|
7042
8202
|
*
|
|
8203
|
+
* **When to use**
|
|
8204
|
+
*
|
|
8205
|
+
* Use to remove all duplicate elements with a custom equivalence when default
|
|
8206
|
+
* equality is not appropriate.
|
|
8207
|
+
*
|
|
7043
8208
|
* **Example** (Deduplicating with custom equality)
|
|
7044
8209
|
*
|
|
7045
8210
|
* ```ts
|
|
@@ -7059,6 +8224,11 @@ export declare const dedupeWith: {
|
|
|
7059
8224
|
* Removes duplicates using a custom equivalence, preserving the order of the
|
|
7060
8225
|
* first occurrence.
|
|
7061
8226
|
*
|
|
8227
|
+
* **When to use**
|
|
8228
|
+
*
|
|
8229
|
+
* Use to remove all duplicate elements with a custom equivalence when default
|
|
8230
|
+
* equality is not appropriate.
|
|
8231
|
+
*
|
|
7062
8232
|
* **Example** (Deduplicating with custom equality)
|
|
7063
8233
|
*
|
|
7064
8234
|
* ```ts
|
|
@@ -7078,6 +8248,11 @@ export declare const dedupeWith: {
|
|
|
7078
8248
|
* Removes duplicates using a custom equivalence, preserving the order of the
|
|
7079
8249
|
* first occurrence.
|
|
7080
8250
|
*
|
|
8251
|
+
* **When to use**
|
|
8252
|
+
*
|
|
8253
|
+
* Use to remove all duplicate elements with a custom equivalence when default
|
|
8254
|
+
* equality is not appropriate.
|
|
8255
|
+
*
|
|
7081
8256
|
* **Example** (Deduplicating with custom equality)
|
|
7082
8257
|
*
|
|
7083
8258
|
* ```ts
|
|
@@ -7098,6 +8273,11 @@ export declare const dedupeWith: {
|
|
|
7098
8273
|
* Removes duplicates using `Equal.equivalence()`, preserving the order of the
|
|
7099
8274
|
* first occurrence.
|
|
7100
8275
|
*
|
|
8276
|
+
* **When to use**
|
|
8277
|
+
*
|
|
8278
|
+
* Use to remove repeated values from an iterable when Effect's default equality
|
|
8279
|
+
* is the right comparison, preserving the first occurrence.
|
|
8280
|
+
*
|
|
7101
8281
|
* **Example** (Removing duplicates)
|
|
7102
8282
|
*
|
|
7103
8283
|
* ```ts
|
|
@@ -7116,6 +8296,12 @@ export declare const dedupe: <S extends Iterable<any>>(self: S) => S extends Non
|
|
|
7116
8296
|
/**
|
|
7117
8297
|
* Removes consecutive duplicate elements using a custom equivalence.
|
|
7118
8298
|
*
|
|
8299
|
+
* **When to use**
|
|
8300
|
+
*
|
|
8301
|
+
* Use when consecutive duplicates should be collapsed using a custom
|
|
8302
|
+
* equivalence, while equivalent values that appear later should remain in the
|
|
8303
|
+
* result.
|
|
8304
|
+
*
|
|
7119
8305
|
* **Details**
|
|
7120
8306
|
*
|
|
7121
8307
|
* - Non-adjacent duplicates are preserved.
|
|
@@ -7139,6 +8325,12 @@ export declare const dedupeAdjacentWith: {
|
|
|
7139
8325
|
/**
|
|
7140
8326
|
* Removes consecutive duplicate elements using a custom equivalence.
|
|
7141
8327
|
*
|
|
8328
|
+
* **When to use**
|
|
8329
|
+
*
|
|
8330
|
+
* Use when consecutive duplicates should be collapsed using a custom
|
|
8331
|
+
* equivalence, while equivalent values that appear later should remain in the
|
|
8332
|
+
* result.
|
|
8333
|
+
*
|
|
7142
8334
|
* **Details**
|
|
7143
8335
|
*
|
|
7144
8336
|
* - Non-adjacent duplicates are preserved.
|
|
@@ -7162,6 +8354,12 @@ export declare const dedupeAdjacentWith: {
|
|
|
7162
8354
|
/**
|
|
7163
8355
|
* Removes consecutive duplicate elements using a custom equivalence.
|
|
7164
8356
|
*
|
|
8357
|
+
* **When to use**
|
|
8358
|
+
*
|
|
8359
|
+
* Use when consecutive duplicates should be collapsed using a custom
|
|
8360
|
+
* equivalence, while equivalent values that appear later should remain in the
|
|
8361
|
+
* result.
|
|
8362
|
+
*
|
|
7165
8363
|
* **Details**
|
|
7166
8364
|
*
|
|
7167
8365
|
* - Non-adjacent duplicates are preserved.
|
|
@@ -7186,6 +8384,11 @@ export declare const dedupeAdjacentWith: {
|
|
|
7186
8384
|
/**
|
|
7187
8385
|
* Removes consecutive duplicate elements using `Equal.equivalence()`.
|
|
7188
8386
|
*
|
|
8387
|
+
* **When to use**
|
|
8388
|
+
*
|
|
8389
|
+
* Use when you need to collapse consecutive duplicates while preserving later
|
|
8390
|
+
* non-consecutive repeats, and the default equality is sufficient.
|
|
8391
|
+
*
|
|
7189
8392
|
* **Example** (Removing adjacent duplicates)
|
|
7190
8393
|
*
|
|
7191
8394
|
* ```ts
|
|
@@ -7256,6 +8459,11 @@ export declare const join: {
|
|
|
7256
8459
|
/**
|
|
7257
8460
|
* Maps over an array while threading an accumulator through each step, returning both the final state and the mapped array.
|
|
7258
8461
|
*
|
|
8462
|
+
* **When to use**
|
|
8463
|
+
*
|
|
8464
|
+
* Use when mapping needs state threaded through each element and the final state
|
|
8465
|
+
* is also needed.
|
|
8466
|
+
*
|
|
7259
8467
|
* **Details**
|
|
7260
8468
|
*
|
|
7261
8469
|
* - Combines `map` and `reduce` in a single pass.
|
|
@@ -7282,6 +8490,11 @@ export declare const mapAccum: {
|
|
|
7282
8490
|
/**
|
|
7283
8491
|
* Maps over an array while threading an accumulator through each step, returning both the final state and the mapped array.
|
|
7284
8492
|
*
|
|
8493
|
+
* **When to use**
|
|
8494
|
+
*
|
|
8495
|
+
* Use when mapping needs state threaded through each element and the final state
|
|
8496
|
+
* is also needed.
|
|
8497
|
+
*
|
|
7285
8498
|
* **Details**
|
|
7286
8499
|
*
|
|
7287
8500
|
* - Combines `map` and `reduce` in a single pass.
|
|
@@ -7308,6 +8521,11 @@ export declare const mapAccum: {
|
|
|
7308
8521
|
/**
|
|
7309
8522
|
* Maps over an array while threading an accumulator through each step, returning both the final state and the mapped array.
|
|
7310
8523
|
*
|
|
8524
|
+
* **When to use**
|
|
8525
|
+
*
|
|
8526
|
+
* Use when mapping needs state threaded through each element and the final state
|
|
8527
|
+
* is also needed.
|
|
8528
|
+
*
|
|
7311
8529
|
* **Details**
|
|
7312
8530
|
*
|
|
7313
8531
|
* - Combines `map` and `reduce` in a single pass.
|
|
@@ -7335,6 +8553,11 @@ export declare const mapAccum: {
|
|
|
7335
8553
|
/**
|
|
7336
8554
|
* Computes the cartesian product of two arrays, applying a combiner to each pair.
|
|
7337
8555
|
*
|
|
8556
|
+
* **When to use**
|
|
8557
|
+
*
|
|
8558
|
+
* Use to compute every combination from two arrays and immediately transform
|
|
8559
|
+
* each pair into a custom result.
|
|
8560
|
+
*
|
|
7338
8561
|
* **Details**
|
|
7339
8562
|
*
|
|
7340
8563
|
* - Produces every combination of an element from `self` with an element from `that`.
|
|
@@ -7350,7 +8573,7 @@ export declare const mapAccum: {
|
|
|
7350
8573
|
* console.log(result) // ["1-a", "1-b", "2-a", "2-b"]
|
|
7351
8574
|
* ```
|
|
7352
8575
|
*
|
|
7353
|
-
* @see {@link cartesian}
|
|
8576
|
+
* @see {@link cartesian} for returning tuples instead of applying a combiner
|
|
7354
8577
|
*
|
|
7355
8578
|
* @category elements
|
|
7356
8579
|
* @since 2.0.0
|
|
@@ -7359,6 +8582,11 @@ export declare const cartesianWith: {
|
|
|
7359
8582
|
/**
|
|
7360
8583
|
* Computes the cartesian product of two arrays, applying a combiner to each pair.
|
|
7361
8584
|
*
|
|
8585
|
+
* **When to use**
|
|
8586
|
+
*
|
|
8587
|
+
* Use to compute every combination from two arrays and immediately transform
|
|
8588
|
+
* each pair into a custom result.
|
|
8589
|
+
*
|
|
7362
8590
|
* **Details**
|
|
7363
8591
|
*
|
|
7364
8592
|
* - Produces every combination of an element from `self` with an element from `that`.
|
|
@@ -7374,7 +8602,7 @@ export declare const cartesianWith: {
|
|
|
7374
8602
|
* console.log(result) // ["1-a", "1-b", "2-a", "2-b"]
|
|
7375
8603
|
* ```
|
|
7376
8604
|
*
|
|
7377
|
-
* @see {@link cartesian}
|
|
8605
|
+
* @see {@link cartesian} for returning tuples instead of applying a combiner
|
|
7378
8606
|
*
|
|
7379
8607
|
* @category elements
|
|
7380
8608
|
* @since 2.0.0
|
|
@@ -7383,6 +8611,11 @@ export declare const cartesianWith: {
|
|
|
7383
8611
|
/**
|
|
7384
8612
|
* Computes the cartesian product of two arrays, applying a combiner to each pair.
|
|
7385
8613
|
*
|
|
8614
|
+
* **When to use**
|
|
8615
|
+
*
|
|
8616
|
+
* Use to compute every combination from two arrays and immediately transform
|
|
8617
|
+
* each pair into a custom result.
|
|
8618
|
+
*
|
|
7386
8619
|
* **Details**
|
|
7387
8620
|
*
|
|
7388
8621
|
* - Produces every combination of an element from `self` with an element from `that`.
|
|
@@ -7398,7 +8631,7 @@ export declare const cartesianWith: {
|
|
|
7398
8631
|
* console.log(result) // ["1-a", "1-b", "2-a", "2-b"]
|
|
7399
8632
|
* ```
|
|
7400
8633
|
*
|
|
7401
|
-
* @see {@link cartesian}
|
|
8634
|
+
* @see {@link cartesian} for returning tuples instead of applying a combiner
|
|
7402
8635
|
*
|
|
7403
8636
|
* @category elements
|
|
7404
8637
|
* @since 2.0.0
|
|
@@ -7408,6 +8641,10 @@ export declare const cartesianWith: {
|
|
|
7408
8641
|
/**
|
|
7409
8642
|
* Computes the cartesian product of two arrays, returning all pairs as tuples.
|
|
7410
8643
|
*
|
|
8644
|
+
* **When to use**
|
|
8645
|
+
*
|
|
8646
|
+
* Use when you need every `[a, b]` pair from two arrays as tuples.
|
|
8647
|
+
*
|
|
7411
8648
|
* **Details**
|
|
7412
8649
|
*
|
|
7413
8650
|
* - Produces every `[a, b]` combination of an element from `self` with an element from `that`.
|
|
@@ -7431,6 +8668,10 @@ export declare const cartesian: {
|
|
|
7431
8668
|
/**
|
|
7432
8669
|
* Computes the cartesian product of two arrays, returning all pairs as tuples.
|
|
7433
8670
|
*
|
|
8671
|
+
* **When to use**
|
|
8672
|
+
*
|
|
8673
|
+
* Use when you need every `[a, b]` pair from two arrays as tuples.
|
|
8674
|
+
*
|
|
7434
8675
|
* **Details**
|
|
7435
8676
|
*
|
|
7436
8677
|
* - Produces every `[a, b]` combination of an element from `self` with an element from `that`.
|
|
@@ -7454,6 +8695,10 @@ export declare const cartesian: {
|
|
|
7454
8695
|
/**
|
|
7455
8696
|
* Computes the cartesian product of two arrays, returning all pairs as tuples.
|
|
7456
8697
|
*
|
|
8698
|
+
* **When to use**
|
|
8699
|
+
*
|
|
8700
|
+
* Use when you need every `[a, b]` pair from two arrays as tuples.
|
|
8701
|
+
*
|
|
7457
8702
|
* **Details**
|
|
7458
8703
|
*
|
|
7459
8704
|
* - Produces every `[a, b]` combination of an element from `self` with an element from `that`.
|
|
@@ -7480,7 +8725,7 @@ export declare const cartesian: {
|
|
|
7480
8725
|
*
|
|
7481
8726
|
* **When to use**
|
|
7482
8727
|
*
|
|
7483
|
-
*
|
|
8728
|
+
* Use when begin a pipeline with `Do`, then use {@link bind} to introduce array variables and {@link let_ let} for plain values.
|
|
7484
8729
|
* - Each `bind` produces the cartesian product of all bound variables (like nested loops).
|
|
7485
8730
|
* - Use `filter` and `map` in the pipeline to add conditions and transformations.
|
|
7486
8731
|
*
|
|
@@ -7510,6 +8755,11 @@ export declare const Do: ReadonlyArray<{}>;
|
|
|
7510
8755
|
/**
|
|
7511
8756
|
* Introduces a new array variable into a do-notation scope, producing the cartesian product with all previous bindings.
|
|
7512
8757
|
*
|
|
8758
|
+
* **When to use**
|
|
8759
|
+
*
|
|
8760
|
+
* Use to add another array-producing binding to an `Array.Do` pipeline, pairing
|
|
8761
|
+
* each existing scope with every value returned by the callback.
|
|
8762
|
+
*
|
|
7513
8763
|
* **Details**
|
|
7514
8764
|
*
|
|
7515
8765
|
* - Each `bind` call adds a named property to the accumulated object.
|
|
@@ -7541,6 +8791,11 @@ export declare const bind: {
|
|
|
7541
8791
|
/**
|
|
7542
8792
|
* Introduces a new array variable into a do-notation scope, producing the cartesian product with all previous bindings.
|
|
7543
8793
|
*
|
|
8794
|
+
* **When to use**
|
|
8795
|
+
*
|
|
8796
|
+
* Use to add another array-producing binding to an `Array.Do` pipeline, pairing
|
|
8797
|
+
* each existing scope with every value returned by the callback.
|
|
8798
|
+
*
|
|
7544
8799
|
* **Details**
|
|
7545
8800
|
*
|
|
7546
8801
|
* - Each `bind` call adds a named property to the accumulated object.
|
|
@@ -7574,6 +8829,11 @@ export declare const bind: {
|
|
|
7574
8829
|
/**
|
|
7575
8830
|
* Introduces a new array variable into a do-notation scope, producing the cartesian product with all previous bindings.
|
|
7576
8831
|
*
|
|
8832
|
+
* **When to use**
|
|
8833
|
+
*
|
|
8834
|
+
* Use to add another array-producing binding to an `Array.Do` pipeline, pairing
|
|
8835
|
+
* each existing scope with every value returned by the callback.
|
|
8836
|
+
*
|
|
7577
8837
|
* **Details**
|
|
7578
8838
|
*
|
|
7579
8839
|
* - Each `bind` call adds a named property to the accumulated object.
|
|
@@ -7608,6 +8868,11 @@ export declare const bind: {
|
|
|
7608
8868
|
/**
|
|
7609
8869
|
* Names the elements of an array by wrapping each in an object with the given key, starting a do-notation scope.
|
|
7610
8870
|
*
|
|
8871
|
+
* **When to use**
|
|
8872
|
+
*
|
|
8873
|
+
* Use when you already have an array and want to start a do-notation pipeline
|
|
8874
|
+
* by naming each element.
|
|
8875
|
+
*
|
|
7611
8876
|
* **Details**
|
|
7612
8877
|
*
|
|
7613
8878
|
* - Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`.
|
|
@@ -7635,6 +8900,11 @@ export declare const bindTo: {
|
|
|
7635
8900
|
/**
|
|
7636
8901
|
* Names the elements of an array by wrapping each in an object with the given key, starting a do-notation scope.
|
|
7637
8902
|
*
|
|
8903
|
+
* **When to use**
|
|
8904
|
+
*
|
|
8905
|
+
* Use when you already have an array and want to start a do-notation pipeline
|
|
8906
|
+
* by naming each element.
|
|
8907
|
+
*
|
|
7638
8908
|
* **Details**
|
|
7639
8909
|
*
|
|
7640
8910
|
* - Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`.
|
|
@@ -7664,6 +8934,11 @@ export declare const bindTo: {
|
|
|
7664
8934
|
/**
|
|
7665
8935
|
* Names the elements of an array by wrapping each in an object with the given key, starting a do-notation scope.
|
|
7666
8936
|
*
|
|
8937
|
+
* **When to use**
|
|
8938
|
+
*
|
|
8939
|
+
* Use when you already have an array and want to start a do-notation pipeline
|
|
8940
|
+
* by naming each element.
|
|
8941
|
+
*
|
|
7667
8942
|
* **Details**
|
|
7668
8943
|
*
|
|
7669
8944
|
* - Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`.
|
|
@@ -7750,6 +9025,11 @@ export declare function makeReducerConcat<A>(): Reducer.Reducer<Array<A>>;
|
|
|
7750
9025
|
/**
|
|
7751
9026
|
* Counts the elements in an iterable that satisfy a predicate.
|
|
7752
9027
|
*
|
|
9028
|
+
* **When to use**
|
|
9029
|
+
*
|
|
9030
|
+
* Use to count how many elements satisfy a predicate when you only need the
|
|
9031
|
+
* number of matches instead of the matching elements.
|
|
9032
|
+
*
|
|
7753
9033
|
* **Details**
|
|
7754
9034
|
*
|
|
7755
9035
|
* - The predicate receives both the element and its index.
|
|
@@ -7773,6 +9053,11 @@ export declare const countBy: {
|
|
|
7773
9053
|
/**
|
|
7774
9054
|
* Counts the elements in an iterable that satisfy a predicate.
|
|
7775
9055
|
*
|
|
9056
|
+
* **When to use**
|
|
9057
|
+
*
|
|
9058
|
+
* Use to count how many elements satisfy a predicate when you only need the
|
|
9059
|
+
* number of matches instead of the matching elements.
|
|
9060
|
+
*
|
|
7776
9061
|
* **Details**
|
|
7777
9062
|
*
|
|
7778
9063
|
* - The predicate receives both the element and its index.
|
|
@@ -7796,6 +9081,11 @@ export declare const countBy: {
|
|
|
7796
9081
|
/**
|
|
7797
9082
|
* Counts the elements in an iterable that satisfy a predicate.
|
|
7798
9083
|
*
|
|
9084
|
+
* **When to use**
|
|
9085
|
+
*
|
|
9086
|
+
* Use to count how many elements satisfy a predicate when you only need the
|
|
9087
|
+
* number of matches instead of the matching elements.
|
|
9088
|
+
*
|
|
7799
9089
|
* **Details**
|
|
7800
9090
|
*
|
|
7801
9091
|
* - The predicate receives both the element and its index.
|