effect 4.0.0-beta.73 → 4.0.0-beta.75
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 +745 -627
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +277 -217
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +37 -30
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +19 -16
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +34 -40
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +16 -16
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +10 -10
- package/dist/Boolean.js +6 -6
- package/dist/Brand.d.ts +13 -11
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +10 -8
- package/dist/Brand.js.map +1 -1
- package/dist/Cause.d.ts +21 -23
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +21 -23
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +282 -72
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +108 -28
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -11
- package/dist/ChannelSchema.js +5 -5
- package/dist/Chunk.d.ts +86 -33
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +48 -13
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +3 -3
- package/dist/Clock.js +3 -3
- package/dist/Combiner.d.ts +9 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +9 -13
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +49 -56
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +40 -43
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +34 -44
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +24 -32
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.js +2 -2
- package/dist/Context.d.ts +63 -75
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +29 -33
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +6 -6
- package/dist/Cron.js +6 -6
- package/dist/Crypto.d.ts +4 -4
- package/dist/Crypto.js +4 -4
- package/dist/Data.d.ts +21 -15
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +7 -7
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +35 -16
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +35 -8
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +61 -52
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +21 -18
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +50 -37
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +24 -13
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +574 -474
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +273 -213
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +5 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +5 -0
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +28 -41
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +12 -19
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +72 -100
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +54 -74
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +1 -1
- package/dist/ErrorReporter.js +1 -1
- package/dist/ExecutionPlan.d.ts +2 -2
- package/dist/ExecutionPlan.js +1 -1
- package/dist/Exit.d.ts +79 -96
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +57 -64
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +8 -6
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +8 -6
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +25 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +15 -0
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +35 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +15 -0
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +20 -0
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +10 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +6 -6
- package/dist/FileSystem.js +2 -2
- package/dist/Filter.d.ts +4 -4
- package/dist/Filter.js +4 -4
- package/dist/Formatter.d.ts +14 -19
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +14 -19
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +20 -21
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +14 -15
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +13 -13
- package/dist/Graph.js +7 -7
- package/dist/HKT.d.ts +3 -3
- package/dist/Hash.d.ts +2 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +2 -1
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +18 -3
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +5 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +9 -9
- package/dist/HashRing.js +3 -3
- package/dist/HashSet.d.ts +1 -1
- package/dist/Iterable.d.ts +39 -27
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +21 -11
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +2 -3
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +2 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +2 -6
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +2 -6
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +17 -13
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +17 -13
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +4 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +4 -3
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +108 -130
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +43 -51
- package/dist/Layer.js.map +1 -1
- package/dist/Logger.d.ts +16 -19
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +15 -18
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +2 -2
- package/dist/Match.d.ts +22 -22
- package/dist/Match.js +18 -18
- package/dist/Metric.d.ts +105 -125
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +54 -64
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +21 -12
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +7 -4
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableList.d.ts +15 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +15 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +56 -42
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +28 -22
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +10 -7
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +10 -7
- package/dist/Newtype.js.map +1 -1
- package/dist/Number.d.ts +23 -11
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +9 -5
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +16 -16
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +10 -9
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +232 -204
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +113 -96
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +119 -180
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +93 -145
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +14 -14
- package/dist/PartitionedSemaphore.js +6 -6
- package/dist/Path.d.ts +3 -3
- package/dist/Path.js +3 -3
- package/dist/Pipeable.d.ts +3 -3
- package/dist/Pipeable.js +3 -3
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +4 -4
- package/dist/Pool.d.ts +7 -11
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +3 -5
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +279 -268
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +128 -123
- package/dist/Predicate.js.map +1 -1
- package/dist/PubSub.d.ts +33 -23
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +21 -11
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +4 -4
- package/dist/Pull.js +4 -4
- package/dist/Queue.d.ts +70 -31
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +66 -27
- package/dist/Queue.js.map +1 -1
- package/dist/RcRef.d.ts +0 -4
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +15 -15
- package/dist/Record.js +5 -5
- package/dist/Redactable.d.ts +2 -2
- package/dist/Redactable.js +2 -2
- package/dist/Redacted.d.ts +5 -5
- package/dist/Redacted.js +4 -4
- package/dist/Reducer.d.ts +2 -3
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -3
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +23 -22
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +21 -20
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +4 -4
- package/dist/References.js +4 -4
- package/dist/RegExp.d.ts +1 -1
- package/dist/RegExp.js +1 -1
- package/dist/Request.d.ts +22 -22
- package/dist/Request.js +6 -6
- package/dist/RequestResolver.d.ts +6 -6
- package/dist/RequestResolver.js +2 -2
- package/dist/Resource.d.ts +3 -3
- package/dist/Resource.js +3 -3
- package/dist/Result.d.ts +95 -51
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +53 -30
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +11 -8
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +11 -8
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +151 -89
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +59 -47
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +6 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +6 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +620 -830
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +543 -452
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +43 -22
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +80 -59
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +139 -119
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +133 -113
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +37 -39
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -17
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +75 -156
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +75 -148
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +30 -21
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +26 -22
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +169 -145
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +183 -159
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.js +2 -2
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +16 -1
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +16 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedRef.d.ts +14 -18
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -8
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +9 -9
- package/dist/Semaphore.js +3 -3
- package/dist/Sink.d.ts +18 -18
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +12 -12
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +4 -5
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +4 -5
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +376 -99
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +158 -43
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +11 -14
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +5 -6
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +23 -21
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +14 -12
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +24 -19
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +12 -7
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +145 -120
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +51 -42
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.d.ts +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Tracer.d.ts +9 -9
- package/dist/Tracer.js +6 -6
- package/dist/Trie.d.ts +15 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +5 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +39 -33
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +23 -19
- package/dist/Tuple.js.map +1 -1
- package/dist/TxHashMap.d.ts +3 -3
- package/dist/TxHashSet.d.ts +1 -1
- package/dist/TxReentrantLock.d.ts +6 -3
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +2 -1
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +16 -16
- package/dist/TxRef.js +8 -8
- package/dist/TxSubscriptionRef.d.ts +43 -27
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +19 -13
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +12 -38
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +0 -2
- package/dist/UndefinedOr.d.ts +15 -14
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +11 -10
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +9 -9
- package/dist/Unify.js +1 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +9 -9
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/equivalence.js +9 -9
- package/dist/internal/schema/equivalence.js.map +1 -1
- package/dist/internal/schema/representation.js +14 -14
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.js +11 -11
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestClock.d.ts +5 -5
- package/dist/testing/TestClock.js +4 -4
- package/dist/testing/TestConsole.d.ts +3 -3
- package/dist/testing/TestConsole.js +3 -3
- package/dist/testing/TestSchema.d.ts +10 -10
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +9 -9
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +4 -2
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +4 -2
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +17 -20
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +36 -39
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +6 -7
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +6 -7
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +5 -5
- package/dist/unstable/ai/EmbeddingModel.js +4 -4
- package/dist/unstable/ai/IdGenerator.d.ts +4 -5
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +3 -4
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +7 -6
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +6 -5
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +14 -12
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +19 -17
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +11 -4
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +8 -5
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +20 -18
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +45 -43
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +17 -17
- package/dist/unstable/ai/Prompt.js +4 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +3 -2
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +3 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +26 -11
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +9 -4
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +1 -1
- package/dist/unstable/ai/Tokenizer.js +1 -1
- package/dist/unstable/ai/Tool.d.ts +13 -12
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +14 -13
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +2 -2
- package/dist/unstable/ai/Toolkit.js +2 -2
- package/dist/unstable/cli/Command.d.ts +37 -16
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +16 -9
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +1 -1
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +7 -6
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +7 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +6 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +7 -2
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +13 -10
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +6 -5
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +4 -3
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +11 -11
- package/dist/unstable/cli/internal/parser.js +145 -10
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -2
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +5 -0
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +5 -0
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +3 -3
- package/dist/unstable/cluster/ClusterSchema.js +3 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +15 -15
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +1 -1
- package/dist/unstable/cluster/Entity.js +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +10 -0
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +10 -0
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +2 -2
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +2 -2
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -2
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +12 -12
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -2
- package/dist/unstable/cluster/RunnerServer.js +2 -2
- package/dist/unstable/cluster/Runners.d.ts +4 -4
- package/dist/unstable/cluster/Runners.js +4 -4
- package/dist/unstable/cluster/ShardId.js +3 -3
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +4 -4
- package/dist/unstable/cluster/Sharding.js +4 -4
- package/dist/unstable/cluster/ShardingConfig.d.ts +4 -4
- package/dist/unstable/cluster/ShardingConfig.js +4 -4
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +6 -6
- package/dist/unstable/cluster/Snowflake.js +8 -8
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +2 -2
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -2
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +5 -5
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +5 -0
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +5 -0
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +2 -2
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +2 -2
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +2 -1
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +2 -1
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +10 -0
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +10 -0
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +4 -4
- package/dist/unstable/eventlog/EventLog.js +4 -4
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +8 -10
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +8 -10
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogSessionAuth.js +4 -4
- package/dist/unstable/http/Cookies.d.ts +1 -1
- package/dist/unstable/http/Cookies.js +4 -4
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +3 -4
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +3 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +2 -2
- package/dist/unstable/http/FetchHttpClient.js +2 -2
- package/dist/unstable/http/Headers.js +2 -2
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.js +2 -2
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +3 -3
- package/dist/unstable/http/HttpClient.js +3 -3
- package/dist/unstable/http/HttpClientRequest.d.ts +32 -5
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +10 -1
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.js +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +1 -1
- package/dist/unstable/http/HttpPlatform.js +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +5 -5
- package/dist/unstable/http/HttpRouter.js +5 -5
- package/dist/unstable/http/HttpServerResponse.d.ts +28 -23
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +13 -8
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.js +3 -3
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +33 -33
- package/dist/unstable/http/Url.js +11 -11
- package/dist/unstable/http/UrlParams.d.ts +30 -0
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +16 -6
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +4 -3
- 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 +10 -8
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +15 -15
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +9 -9
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +11 -11
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +5 -0
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +5 -0
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +8 -6
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +6 -4
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +3 -3
- package/dist/unstable/persistence/KeyValueStore.js +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.js +2 -2
- package/dist/unstable/persistence/PersistedQueue.d.ts +8 -8
- package/dist/unstable/persistence/PersistedQueue.js +8 -8
- package/dist/unstable/persistence/RateLimiter.d.ts +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -5
- package/dist/unstable/process/ChildProcess.js +2 -2
- package/dist/unstable/reactivity/AsyncResult.d.ts +4 -4
- package/dist/unstable/reactivity/AsyncResult.js +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +4 -4
- package/dist/unstable/reactivity/Atom.js +4 -4
- package/dist/unstable/reactivity/AtomRegistry.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +1 -1
- package/dist/unstable/reactivity/Reactivity.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +5 -5
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +5 -5
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +2 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
- package/dist/unstable/rpc/RpcSerialization.js +2 -2
- package/dist/unstable/schema/Model.d.ts +2 -2
- package/dist/unstable/schema/Model.js +6 -6
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +2 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +3 -3
- package/dist/unstable/socket/Socket.js +3 -3
- package/dist/unstable/socket/SocketServer.d.ts +1 -1
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +3 -3
- package/dist/unstable/sql/SqlClient.js +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +4 -4
- package/dist/unstable/sql/SqlSchema.js +4 -4
- package/dist/unstable/sql/Statement.d.ts +2 -2
- package/dist/unstable/sql/Statement.js +2 -2
- package/dist/unstable/workers/Transferable.d.ts +3 -3
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +6 -6
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +1 -1
- package/dist/unstable/workers/Worker.js +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -1
- package/dist/unstable/workflow/Activity.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +8 -8
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +1 -2
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +1 -2
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +35 -15
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +94 -72
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +10 -2
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -8
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -4
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +9 -11
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +7 -7
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +745 -627
- package/src/BigDecimal.ts +37 -30
- package/src/BigInt.ts +34 -40
- package/src/Boolean.ts +10 -10
- package/src/Brand.ts +16 -14
- package/src/Cause.ts +21 -23
- package/src/Channel.ts +316 -76
- package/src/ChannelSchema.ts +11 -11
- package/src/Chunk.ts +87 -34
- package/src/Clock.ts +3 -3
- package/src/Combiner.ts +9 -13
- package/src/Config.ts +60 -67
- package/src/ConfigProvider.ts +34 -44
- package/src/Console.ts +2 -2
- package/src/Context.ts +64 -76
- package/src/Cron.ts +6 -6
- package/src/Crypto.ts +4 -4
- package/src/Data.ts +21 -15
- package/src/DateTime.ts +35 -16
- package/src/Deferred.ts +61 -52
- package/src/Duration.ts +50 -37
- package/src/Effect.ts +574 -474
- package/src/Encoding.ts +5 -0
- package/src/Equal.ts +28 -41
- package/src/Equivalence.ts +72 -100
- package/src/ErrorReporter.ts +1 -1
- package/src/ExecutionPlan.ts +2 -2
- package/src/Exit.ts +79 -96
- package/src/Fiber.ts +8 -6
- package/src/FiberHandle.ts +25 -0
- package/src/FiberMap.ts +35 -0
- package/src/FiberSet.ts +20 -0
- package/src/FileSystem.ts +6 -6
- package/src/Filter.ts +4 -4
- package/src/Formatter.ts +14 -19
- package/src/Function.ts +20 -21
- package/src/Graph.ts +13 -13
- package/src/HKT.ts +3 -3
- package/src/Hash.ts +2 -1
- package/src/HashMap.ts +18 -3
- package/src/HashRing.ts +9 -9
- package/src/HashSet.ts +1 -1
- package/src/Iterable.ts +39 -27
- package/src/JsonPatch.ts +2 -3
- package/src/JsonPointer.ts +2 -6
- package/src/JsonSchema.ts +17 -13
- package/src/Latch.ts +4 -3
- package/src/Layer.ts +108 -130
- package/src/Logger.ts +22 -25
- package/src/ManagedRuntime.ts +2 -2
- package/src/Match.ts +22 -22
- package/src/Metric.ts +129 -157
- package/src/MutableHashMap.ts +35 -20
- package/src/MutableList.ts +15 -0
- package/src/MutableRef.ts +56 -42
- package/src/Newtype.ts +10 -7
- package/src/Number.ts +23 -11
- package/src/Optic.ts +25 -22
- package/src/Option.ts +232 -204
- package/src/Order.ts +119 -180
- package/src/PartitionedSemaphore.ts +14 -14
- package/src/Path.ts +3 -3
- package/src/Pipeable.ts +3 -3
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +7 -11
- package/src/Predicate.ts +279 -268
- package/src/PubSub.ts +33 -23
- package/src/Pull.ts +4 -4
- package/src/Queue.ts +70 -31
- package/src/RcRef.ts +0 -4
- package/src/Record.ts +15 -15
- package/src/Redactable.ts +2 -2
- package/src/Redacted.ts +5 -5
- package/src/Reducer.ts +2 -3
- package/src/Ref.ts +61 -58
- package/src/References.ts +4 -4
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +22 -22
- package/src/RequestResolver.ts +8 -8
- package/src/Resource.ts +3 -3
- package/src/Result.ts +105 -51
- package/src/Runtime.ts +11 -8
- package/src/Schedule.ts +157 -90
- package/src/Scheduler.ts +6 -4
- package/src/Schema.ts +1020 -1108
- package/src/SchemaAST.ts +149 -118
- package/src/SchemaGetter.ts +155 -134
- package/src/SchemaIssue.ts +39 -41
- package/src/SchemaParser.ts +176 -232
- package/src/SchemaRepresentation.ts +38 -28
- package/src/SchemaTransformation.ts +233 -207
- package/src/SchemaUtils.ts +2 -2
- package/src/Scope.ts +16 -1
- package/src/ScopedCache.ts +1 -1
- package/src/ScopedRef.ts +14 -18
- package/src/Semaphore.ts +9 -9
- package/src/Sink.ts +18 -18
- package/src/Stdio.ts +4 -5
- package/src/Stream.ts +411 -114
- package/src/String.ts +11 -14
- package/src/Struct.ts +23 -21
- package/src/SubscriptionRef.ts +24 -19
- package/src/SynchronizedRef.ts +145 -120
- package/src/Terminal.ts +1 -1
- package/src/Tracer.ts +9 -9
- package/src/Trie.ts +15 -0
- package/src/Tuple.ts +39 -33
- package/src/TxHashMap.ts +3 -3
- package/src/TxHashSet.ts +1 -1
- package/src/TxReentrantLock.ts +6 -3
- package/src/TxRef.ts +16 -16
- package/src/TxSubscriptionRef.ts +43 -27
- package/src/Types.ts +12 -39
- package/src/UndefinedOr.ts +15 -14
- package/src/Unify.ts +9 -9
- package/src/internal/schema/annotations.ts +4 -4
- package/src/internal/schema/arbitrary.ts +16 -16
- package/src/internal/schema/equivalence.ts +11 -11
- package/src/internal/schema/representation.ts +23 -23
- package/src/internal/schema/schema.ts +17 -17
- package/src/testing/TestClock.ts +5 -5
- package/src/testing/TestConsole.ts +3 -3
- package/src/testing/TestSchema.ts +20 -20
- package/src/unstable/ai/AiError.ts +4 -2
- package/src/unstable/ai/AnthropicStructuredOutput.ts +59 -56
- package/src/unstable/ai/Chat.ts +6 -7
- package/src/unstable/ai/EmbeddingModel.ts +5 -5
- package/src/unstable/ai/IdGenerator.ts +4 -5
- package/src/unstable/ai/LanguageModel.ts +9 -8
- package/src/unstable/ai/McpSchema.ts +19 -17
- package/src/unstable/ai/McpServer.ts +14 -7
- package/src/unstable/ai/OpenAiStructuredOutput.ts +72 -61
- package/src/unstable/ai/Prompt.ts +20 -20
- package/src/unstable/ai/ResponseIdTracker.ts +3 -2
- package/src/unstable/ai/Telemetry.ts +26 -11
- package/src/unstable/ai/Tokenizer.ts +1 -1
- package/src/unstable/ai/Tool.ts +17 -16
- package/src/unstable/ai/Toolkit.ts +2 -2
- package/src/unstable/cli/Command.ts +42 -17
- package/src/unstable/cli/Completions.ts +1 -1
- package/src/unstable/cli/Flag.ts +7 -6
- package/src/unstable/cli/GlobalFlag.ts +7 -1
- package/src/unstable/cli/Param.ts +24 -19
- package/src/unstable/cli/Primitive.ts +6 -5
- package/src/unstable/cli/Prompt.ts +11 -11
- package/src/unstable/cli/internal/parser.ts +204 -10
- package/src/unstable/cluster/ClusterCron.ts +1 -2
- package/src/unstable/cluster/ClusterMetrics.ts +5 -0
- package/src/unstable/cluster/ClusterSchema.ts +3 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +15 -15
- package/src/unstable/cluster/Entity.ts +1 -1
- package/src/unstable/cluster/EntityResource.ts +10 -0
- package/src/unstable/cluster/Envelope.ts +3 -3
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +1 -1
- package/src/unstable/cluster/Reply.ts +14 -12
- package/src/unstable/cluster/RunnerHealth.ts +2 -1
- package/src/unstable/cluster/RunnerServer.ts +2 -2
- package/src/unstable/cluster/Runners.ts +4 -4
- package/src/unstable/cluster/ShardId.ts +3 -3
- package/src/unstable/cluster/Sharding.ts +4 -4
- package/src/unstable/cluster/ShardingConfig.ts +4 -4
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/internal/entityManager.ts +2 -2
- package/src/unstable/devtools/DevToolsClient.ts +1 -1
- package/src/unstable/encoding/Msgpack.ts +6 -6
- package/src/unstable/encoding/Ndjson.ts +5 -0
- package/src/unstable/encoding/Sse.ts +2 -2
- package/src/unstable/eventlog/EventGroup.ts +2 -1
- package/src/unstable/eventlog/EventJournal.ts +10 -0
- package/src/unstable/eventlog/EventLog.ts +4 -4
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -3
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +8 -10
- package/src/unstable/eventlog/EventLogSessionAuth.ts +4 -4
- package/src/unstable/http/Cookies.ts +5 -5
- package/src/unstable/http/Etag.ts +3 -4
- package/src/unstable/http/FetchHttpClient.ts +2 -2
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpBody.ts +2 -2
- package/src/unstable/http/HttpClient.ts +3 -3
- package/src/unstable/http/HttpClientRequest.ts +32 -5
- package/src/unstable/http/HttpMiddleware.ts +1 -1
- package/src/unstable/http/HttpPlatform.ts +1 -1
- package/src/unstable/http/HttpRouter.ts +5 -5
- package/src/unstable/http/HttpServerResponse.ts +28 -23
- package/src/unstable/http/Multipart.ts +3 -3
- package/src/unstable/http/Url.ts +33 -33
- package/src/unstable/http/UrlParams.ts +36 -6
- package/src/unstable/httpapi/HttpApi.ts +6 -5
- package/src/unstable/httpapi/HttpApiBuilder.ts +14 -13
- package/src/unstable/httpapi/HttpApiClient.ts +16 -16
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/httpapi/HttpApiMiddleware.ts +3 -3
- package/src/unstable/httpapi/HttpApiSchema.ts +15 -15
- package/src/unstable/httpapi/OpenApi.ts +18 -18
- package/src/unstable/observability/OtlpResource.ts +5 -0
- package/src/unstable/observability/PrometheusMetrics.ts +8 -6
- package/src/unstable/persistence/KeyValueStore.ts +3 -3
- package/src/unstable/persistence/Persistable.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +8 -8
- package/src/unstable/persistence/RateLimiter.ts +1 -1
- package/src/unstable/process/ChildProcess.ts +5 -5
- package/src/unstable/reactivity/AsyncResult.ts +4 -4
- package/src/unstable/reactivity/Atom.ts +4 -4
- package/src/unstable/reactivity/AtomRegistry.ts +1 -1
- package/src/unstable/reactivity/Reactivity.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +5 -5
- package/src/unstable/rpc/RpcMiddleware.ts +1 -1
- package/src/unstable/rpc/RpcSchema.ts +5 -5
- package/src/unstable/rpc/RpcSerialization.ts +2 -2
- package/src/unstable/schema/Model.ts +7 -7
- package/src/unstable/schema/VariantSchema.ts +2 -2
- package/src/unstable/socket/Socket.ts +3 -3
- package/src/unstable/socket/SocketServer.ts +1 -1
- package/src/unstable/sql/Migrator.ts +1 -1
- package/src/unstable/sql/SqlClient.ts +3 -3
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/SqlSchema.ts +4 -4
- package/src/unstable/sql/Statement.ts +2 -2
- package/src/unstable/workers/Transferable.ts +7 -7
- package/src/unstable/workers/Worker.ts +1 -1
- package/src/unstable/workflow/Activity.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +8 -8
- package/src/unstable/workflow/DurableQueue.ts +1 -2
- package/src/unstable/workflow/Workflow.ts +159 -114
- package/src/unstable/workflow/WorkflowEngine.ts +16 -8
- package/src/unstable/workflow/WorkflowProxy.ts +9 -11
- package/src/unstable/workflow/WorkflowProxyServer.ts +7 -7
package/src/Array.ts
CHANGED
|
@@ -138,8 +138,8 @@ export interface ReadonlyArrayTypeLambda extends TypeLambda {
|
|
|
138
138
|
*
|
|
139
139
|
* **When to use**
|
|
140
140
|
*
|
|
141
|
-
* Use when
|
|
142
|
-
*
|
|
141
|
+
* Use when non-emptiness must be tracked at the type level while preventing mutation.
|
|
142
|
+
* Many Array module functions accept or return this type.
|
|
143
143
|
*
|
|
144
144
|
* **Example** (Typing a non-empty array)
|
|
145
145
|
*
|
|
@@ -194,9 +194,12 @@ export type NonEmptyArray<A> = [A, ...Array<A>]
|
|
|
194
194
|
*
|
|
195
195
|
* **When to use**
|
|
196
196
|
*
|
|
197
|
-
* Use when you
|
|
198
|
-
*
|
|
199
|
-
*
|
|
197
|
+
* Use when you need to create a typed non-empty array from literal values.
|
|
198
|
+
*
|
|
199
|
+
* **Details**
|
|
200
|
+
*
|
|
201
|
+
* The element type is inferred as the union of all arguments. Because at least
|
|
202
|
+
* one argument is required, this always returns a `NonEmptyArray`.
|
|
200
203
|
*
|
|
201
204
|
* **Example** (Creating an array from values)
|
|
202
205
|
*
|
|
@@ -222,9 +225,11 @@ export const make = <Elements extends NonEmptyArray<unknown>>(
|
|
|
222
225
|
*
|
|
223
226
|
* **When to use**
|
|
224
227
|
*
|
|
225
|
-
* Use when you need a pre-sized array
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
+
* Use when you need a pre-sized array that will be filled imperatively.
|
|
229
|
+
*
|
|
230
|
+
* **Details**
|
|
231
|
+
*
|
|
232
|
+
* Elements are typed as `A | undefined` because the slots are empty.
|
|
228
233
|
*
|
|
229
234
|
* **Example** (Allocating a fixed-size array)
|
|
230
235
|
*
|
|
@@ -247,9 +252,13 @@ export const allocate = <A = never>(n: number): Array<A | undefined> => new Arra
|
|
|
247
252
|
*
|
|
248
253
|
* **When to use**
|
|
249
254
|
*
|
|
250
|
-
* Use when you need
|
|
251
|
-
*
|
|
252
|
-
*
|
|
255
|
+
* Use when you need to compute each array element from its index.
|
|
256
|
+
*
|
|
257
|
+
* **Details**
|
|
258
|
+
*
|
|
259
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
260
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
261
|
+
* usage.
|
|
253
262
|
*
|
|
254
263
|
* **Example** (Generating values from indices)
|
|
255
264
|
*
|
|
@@ -272,9 +281,13 @@ export const makeBy: {
|
|
|
272
281
|
*
|
|
273
282
|
* **When to use**
|
|
274
283
|
*
|
|
275
|
-
* Use when you need
|
|
276
|
-
*
|
|
277
|
-
*
|
|
284
|
+
* Use when you need to compute each array element from its index.
|
|
285
|
+
*
|
|
286
|
+
* **Details**
|
|
287
|
+
*
|
|
288
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
289
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
290
|
+
* usage.
|
|
278
291
|
*
|
|
279
292
|
* **Example** (Generating values from indices)
|
|
280
293
|
*
|
|
@@ -297,9 +310,13 @@ export const makeBy: {
|
|
|
297
310
|
*
|
|
298
311
|
* **When to use**
|
|
299
312
|
*
|
|
300
|
-
* Use when you need
|
|
301
|
-
*
|
|
302
|
-
*
|
|
313
|
+
* Use when you need to compute each array element from its index.
|
|
314
|
+
*
|
|
315
|
+
* **Details**
|
|
316
|
+
*
|
|
317
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
318
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
319
|
+
* usage.
|
|
303
320
|
*
|
|
304
321
|
* **Example** (Generating values from indices)
|
|
305
322
|
*
|
|
@@ -332,9 +349,11 @@ export const makeBy: {
|
|
|
332
349
|
*
|
|
333
350
|
* **When to use**
|
|
334
351
|
*
|
|
335
|
-
* Use when you need a sequence of consecutive integers.
|
|
336
|
-
*
|
|
337
|
-
*
|
|
352
|
+
* Use when you need a non-empty sequence of consecutive integers.
|
|
353
|
+
*
|
|
354
|
+
* **Details**
|
|
355
|
+
*
|
|
356
|
+
* If `start > end`, returns `[start]`.
|
|
338
357
|
*
|
|
339
358
|
* **Example** (Creating a range)
|
|
340
359
|
*
|
|
@@ -358,9 +377,13 @@ export const range = (start: number, end: number): NonEmptyArray<number> =>
|
|
|
358
377
|
*
|
|
359
378
|
* **When to use**
|
|
360
379
|
*
|
|
361
|
-
* Use when you need
|
|
362
|
-
*
|
|
363
|
-
*
|
|
380
|
+
* Use when you need a non-empty array containing repeated copies of one value.
|
|
381
|
+
*
|
|
382
|
+
* **Details**
|
|
383
|
+
*
|
|
384
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
385
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
386
|
+
* usage.
|
|
364
387
|
*
|
|
365
388
|
* **Example** (Repeating a value)
|
|
366
389
|
*
|
|
@@ -382,9 +405,13 @@ export const replicate: {
|
|
|
382
405
|
*
|
|
383
406
|
* **When to use**
|
|
384
407
|
*
|
|
385
|
-
* Use when you need
|
|
386
|
-
*
|
|
387
|
-
*
|
|
408
|
+
* Use when you need a non-empty array containing repeated copies of one value.
|
|
409
|
+
*
|
|
410
|
+
* **Details**
|
|
411
|
+
*
|
|
412
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
413
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
414
|
+
* usage.
|
|
388
415
|
*
|
|
389
416
|
* **Example** (Repeating a value)
|
|
390
417
|
*
|
|
@@ -406,9 +433,13 @@ export const replicate: {
|
|
|
406
433
|
*
|
|
407
434
|
* **When to use**
|
|
408
435
|
*
|
|
409
|
-
* Use when you need
|
|
410
|
-
*
|
|
411
|
-
*
|
|
436
|
+
* Use when you need a non-empty array containing repeated copies of one value.
|
|
437
|
+
*
|
|
438
|
+
* **Details**
|
|
439
|
+
*
|
|
440
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
441
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
442
|
+
* usage.
|
|
412
443
|
*
|
|
413
444
|
* **Example** (Repeating a value)
|
|
414
445
|
*
|
|
@@ -436,10 +467,9 @@ export const replicate: {
|
|
|
436
467
|
*
|
|
437
468
|
* **Details**
|
|
438
469
|
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
* an array.
|
|
470
|
+
* If the input is already an array, this returns it by reference without
|
|
471
|
+
* copying. Otherwise, it creates a new array from the iterable. Use `copy` if
|
|
472
|
+
* you need a fresh array even when the input is already an array.
|
|
443
473
|
*
|
|
444
474
|
* **Example** (Converting a Set to an array)
|
|
445
475
|
*
|
|
@@ -469,9 +499,9 @@ export const fromIterable = <A>(collection: Iterable<A>): Array<A> =>
|
|
|
469
499
|
*
|
|
470
500
|
* **Details**
|
|
471
501
|
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
502
|
+
* If the input is already an array, this returns it by reference. If the input
|
|
503
|
+
* is a single value, this wraps it in a one-element array. This is useful for
|
|
504
|
+
* APIs that accept `A | Array<A>`.
|
|
475
505
|
*
|
|
476
506
|
* **Example** (Normalizing input)
|
|
477
507
|
*
|
|
@@ -500,8 +530,8 @@ export const ensure = <A>(self: ReadonlyArray<A> | A): Array<A> => Array.isArray
|
|
|
500
530
|
*
|
|
501
531
|
* **Details**
|
|
502
532
|
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
533
|
+
* Key order follows `Object.entries` semantics. Empty records produce an empty
|
|
534
|
+
* array.
|
|
505
535
|
*
|
|
506
536
|
* **Example** (Record to entries)
|
|
507
537
|
*
|
|
@@ -548,9 +578,12 @@ export const fromOption: <A>(self: Option.Option<A>) => Array<A> = Option.toArra
|
|
|
548
578
|
*
|
|
549
579
|
* **When to use**
|
|
550
580
|
*
|
|
551
|
-
* Use when you need to branch on whether an array
|
|
552
|
-
*
|
|
553
|
-
*
|
|
581
|
+
* Use when you need to branch on whether an array is empty.
|
|
582
|
+
*
|
|
583
|
+
* **Details**
|
|
584
|
+
*
|
|
585
|
+
* `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
|
|
586
|
+
* data-last usage.
|
|
554
587
|
*
|
|
555
588
|
* **Example** (Branching on emptiness)
|
|
556
589
|
*
|
|
@@ -577,9 +610,12 @@ export const match: {
|
|
|
577
610
|
*
|
|
578
611
|
* **When to use**
|
|
579
612
|
*
|
|
580
|
-
* Use when you need to branch on whether an array
|
|
581
|
-
*
|
|
582
|
-
*
|
|
613
|
+
* Use when you need to branch on whether an array is empty.
|
|
614
|
+
*
|
|
615
|
+
* **Details**
|
|
616
|
+
*
|
|
617
|
+
* `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
|
|
618
|
+
* data-last usage.
|
|
583
619
|
*
|
|
584
620
|
* **Example** (Branching on emptiness)
|
|
585
621
|
*
|
|
@@ -611,9 +647,12 @@ export const match: {
|
|
|
611
647
|
*
|
|
612
648
|
* **When to use**
|
|
613
649
|
*
|
|
614
|
-
* Use when you need to branch on whether an array
|
|
615
|
-
*
|
|
616
|
-
*
|
|
650
|
+
* Use when you need to branch on whether an array is empty.
|
|
651
|
+
*
|
|
652
|
+
* **Details**
|
|
653
|
+
*
|
|
654
|
+
* `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
|
|
655
|
+
* data-last usage.
|
|
617
656
|
*
|
|
618
657
|
* **Example** (Branching on emptiness)
|
|
619
658
|
*
|
|
@@ -655,8 +694,8 @@ export const match: {
|
|
|
655
694
|
*
|
|
656
695
|
* **When to use**
|
|
657
696
|
*
|
|
658
|
-
* Use
|
|
659
|
-
*
|
|
697
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
698
|
+
* first element plus the remaining elements.
|
|
660
699
|
*
|
|
661
700
|
* **Details**
|
|
662
701
|
*
|
|
@@ -688,8 +727,8 @@ export const matchLeft: {
|
|
|
688
727
|
*
|
|
689
728
|
* **When to use**
|
|
690
729
|
*
|
|
691
|
-
* Use
|
|
692
|
-
*
|
|
730
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
731
|
+
* first element plus the remaining elements.
|
|
693
732
|
*
|
|
694
733
|
* **Details**
|
|
695
734
|
*
|
|
@@ -726,8 +765,8 @@ export const matchLeft: {
|
|
|
726
765
|
*
|
|
727
766
|
* **When to use**
|
|
728
767
|
*
|
|
729
|
-
* Use
|
|
730
|
-
*
|
|
768
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
769
|
+
* first element plus the remaining elements.
|
|
731
770
|
*
|
|
732
771
|
* **Details**
|
|
733
772
|
*
|
|
@@ -773,8 +812,8 @@ export const matchLeft: {
|
|
|
773
812
|
*
|
|
774
813
|
* **When to use**
|
|
775
814
|
*
|
|
776
|
-
* Use
|
|
777
|
-
*
|
|
815
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
816
|
+
* elements before the last plus the last element.
|
|
778
817
|
*
|
|
779
818
|
* **Details**
|
|
780
819
|
*
|
|
@@ -806,8 +845,8 @@ export const matchRight: {
|
|
|
806
845
|
*
|
|
807
846
|
* **When to use**
|
|
808
847
|
*
|
|
809
|
-
* Use
|
|
810
|
-
*
|
|
848
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
849
|
+
* elements before the last plus the last element.
|
|
811
850
|
*
|
|
812
851
|
* **Details**
|
|
813
852
|
*
|
|
@@ -844,8 +883,8 @@ export const matchRight: {
|
|
|
844
883
|
*
|
|
845
884
|
* **When to use**
|
|
846
885
|
*
|
|
847
|
-
* Use
|
|
848
|
-
*
|
|
886
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
887
|
+
* elements before the last plus the last element.
|
|
849
888
|
*
|
|
850
889
|
* **Details**
|
|
851
890
|
*
|
|
@@ -893,11 +932,8 @@ export const matchRight: {
|
|
|
893
932
|
*
|
|
894
933
|
* **When to use**
|
|
895
934
|
*
|
|
896
|
-
* Use
|
|
897
|
-
*
|
|
898
|
-
* **Details**
|
|
899
|
-
*
|
|
900
|
-
* - Always returns a non-empty array.
|
|
935
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
936
|
+
* leading value.
|
|
901
937
|
*
|
|
902
938
|
* **Example** (Prepending an element)
|
|
903
939
|
*
|
|
@@ -911,7 +947,7 @@ export const matchRight: {
|
|
|
911
947
|
* @see {@link append} — add to the end
|
|
912
948
|
* @see {@link prependAll} — prepend multiple elements
|
|
913
949
|
*
|
|
914
|
-
* @category
|
|
950
|
+
* @category combining
|
|
915
951
|
* @since 2.0.0
|
|
916
952
|
*/
|
|
917
953
|
export const prepend: {
|
|
@@ -920,11 +956,8 @@ export const prepend: {
|
|
|
920
956
|
*
|
|
921
957
|
* **When to use**
|
|
922
958
|
*
|
|
923
|
-
* Use
|
|
924
|
-
*
|
|
925
|
-
* **Details**
|
|
926
|
-
*
|
|
927
|
-
* - Always returns a non-empty array.
|
|
959
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
960
|
+
* leading value.
|
|
928
961
|
*
|
|
929
962
|
* **Example** (Prepending an element)
|
|
930
963
|
*
|
|
@@ -938,7 +971,7 @@ export const prepend: {
|
|
|
938
971
|
* @see {@link append} — add to the end
|
|
939
972
|
* @see {@link prependAll} — prepend multiple elements
|
|
940
973
|
*
|
|
941
|
-
* @category
|
|
974
|
+
* @category combining
|
|
942
975
|
* @since 2.0.0
|
|
943
976
|
*/
|
|
944
977
|
<B>(head: B): <A>(self: Iterable<A>) => NonEmptyArray<A | B>
|
|
@@ -947,11 +980,8 @@ export const prepend: {
|
|
|
947
980
|
*
|
|
948
981
|
* **When to use**
|
|
949
982
|
*
|
|
950
|
-
* Use
|
|
951
|
-
*
|
|
952
|
-
* **Details**
|
|
953
|
-
*
|
|
954
|
-
* - Always returns a non-empty array.
|
|
983
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
984
|
+
* leading value.
|
|
955
985
|
*
|
|
956
986
|
* **Example** (Prepending an element)
|
|
957
987
|
*
|
|
@@ -965,7 +995,7 @@ export const prepend: {
|
|
|
965
995
|
* @see {@link append} — add to the end
|
|
966
996
|
* @see {@link prependAll} — prepend multiple elements
|
|
967
997
|
*
|
|
968
|
-
* @category
|
|
998
|
+
* @category combining
|
|
969
999
|
* @since 2.0.0
|
|
970
1000
|
*/
|
|
971
1001
|
<A, B>(self: Iterable<A>, head: B): NonEmptyArray<A | B>
|
|
@@ -980,7 +1010,7 @@ export const prepend: {
|
|
|
980
1010
|
*
|
|
981
1011
|
* **Details**
|
|
982
1012
|
*
|
|
983
|
-
*
|
|
1013
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
984
1014
|
*
|
|
985
1015
|
* **Example** (Prepending multiple elements)
|
|
986
1016
|
*
|
|
@@ -994,7 +1024,7 @@ export const prepend: {
|
|
|
994
1024
|
* @see {@link prepend} — add a single element to the front
|
|
995
1025
|
* @see {@link appendAll} — add elements to the end
|
|
996
1026
|
*
|
|
997
|
-
* @category
|
|
1027
|
+
* @category combining
|
|
998
1028
|
* @since 2.0.0
|
|
999
1029
|
*/
|
|
1000
1030
|
export const prependAll: {
|
|
@@ -1007,7 +1037,7 @@ export const prependAll: {
|
|
|
1007
1037
|
*
|
|
1008
1038
|
* **Details**
|
|
1009
1039
|
*
|
|
1010
|
-
*
|
|
1040
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1011
1041
|
*
|
|
1012
1042
|
* **Example** (Prepending multiple elements)
|
|
1013
1043
|
*
|
|
@@ -1021,7 +1051,7 @@ export const prependAll: {
|
|
|
1021
1051
|
* @see {@link prepend} — add a single element to the front
|
|
1022
1052
|
* @see {@link appendAll} — add elements to the end
|
|
1023
1053
|
*
|
|
1024
|
-
* @category
|
|
1054
|
+
* @category combining
|
|
1025
1055
|
* @since 2.0.0
|
|
1026
1056
|
*/
|
|
1027
1057
|
<S extends Iterable<any>, T extends Iterable<any>>(that: T): (self: S) => ReadonlyArray.OrNonEmpty<S, T, ReadonlyArray.Infer<S> | ReadonlyArray.Infer<T>>
|
|
@@ -1034,7 +1064,7 @@ export const prependAll: {
|
|
|
1034
1064
|
*
|
|
1035
1065
|
* **Details**
|
|
1036
1066
|
*
|
|
1037
|
-
*
|
|
1067
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1038
1068
|
*
|
|
1039
1069
|
* **Example** (Prepending multiple elements)
|
|
1040
1070
|
*
|
|
@@ -1048,7 +1078,7 @@ export const prependAll: {
|
|
|
1048
1078
|
* @see {@link prepend} — add a single element to the front
|
|
1049
1079
|
* @see {@link appendAll} — add elements to the end
|
|
1050
1080
|
*
|
|
1051
|
-
* @category
|
|
1081
|
+
* @category combining
|
|
1052
1082
|
* @since 2.0.0
|
|
1053
1083
|
*/
|
|
1054
1084
|
<A, B>(self: Iterable<A>, that: NonEmptyReadonlyArray<B>): NonEmptyArray<A | B>
|
|
@@ -1061,7 +1091,7 @@ export const prependAll: {
|
|
|
1061
1091
|
*
|
|
1062
1092
|
* **Details**
|
|
1063
1093
|
*
|
|
1064
|
-
*
|
|
1094
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1065
1095
|
*
|
|
1066
1096
|
* **Example** (Prepending multiple elements)
|
|
1067
1097
|
*
|
|
@@ -1075,7 +1105,7 @@ export const prependAll: {
|
|
|
1075
1105
|
* @see {@link prepend} — add a single element to the front
|
|
1076
1106
|
* @see {@link appendAll} — add elements to the end
|
|
1077
1107
|
*
|
|
1078
|
-
* @category
|
|
1108
|
+
* @category combining
|
|
1079
1109
|
* @since 2.0.0
|
|
1080
1110
|
*/
|
|
1081
1111
|
<A, B>(self: NonEmptyReadonlyArray<A>, that: Iterable<B>): NonEmptyArray<A | B>
|
|
@@ -1088,7 +1118,7 @@ export const prependAll: {
|
|
|
1088
1118
|
*
|
|
1089
1119
|
* **Details**
|
|
1090
1120
|
*
|
|
1091
|
-
*
|
|
1121
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1092
1122
|
*
|
|
1093
1123
|
* **Example** (Prepending multiple elements)
|
|
1094
1124
|
*
|
|
@@ -1102,7 +1132,7 @@ export const prependAll: {
|
|
|
1102
1132
|
* @see {@link prepend} — add a single element to the front
|
|
1103
1133
|
* @see {@link appendAll} — add elements to the end
|
|
1104
1134
|
*
|
|
1105
|
-
* @category
|
|
1135
|
+
* @category combining
|
|
1106
1136
|
* @since 2.0.0
|
|
1107
1137
|
*/
|
|
1108
1138
|
<A, B>(self: Iterable<A>, that: Iterable<B>): Array<A | B>
|
|
@@ -1116,12 +1146,8 @@ export const prependAll: {
|
|
|
1116
1146
|
*
|
|
1117
1147
|
* **When to use**
|
|
1118
1148
|
*
|
|
1119
|
-
* Use
|
|
1120
|
-
*
|
|
1121
|
-
*
|
|
1122
|
-
* **Details**
|
|
1123
|
-
*
|
|
1124
|
-
* - Always returns a non-empty array.
|
|
1149
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
1150
|
+
* trailing value.
|
|
1125
1151
|
*
|
|
1126
1152
|
* **Example** (Appending an element)
|
|
1127
1153
|
*
|
|
@@ -1135,7 +1161,7 @@ export const prependAll: {
|
|
|
1135
1161
|
* @see {@link prepend} — add to the front
|
|
1136
1162
|
* @see {@link appendAll} — append multiple elements
|
|
1137
1163
|
*
|
|
1138
|
-
* @category
|
|
1164
|
+
* @category combining
|
|
1139
1165
|
* @since 2.0.0
|
|
1140
1166
|
*/
|
|
1141
1167
|
export const append: {
|
|
@@ -1144,12 +1170,8 @@ export const append: {
|
|
|
1144
1170
|
*
|
|
1145
1171
|
* **When to use**
|
|
1146
1172
|
*
|
|
1147
|
-
* Use
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
* **Details**
|
|
1151
|
-
*
|
|
1152
|
-
* - Always returns a non-empty array.
|
|
1173
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
1174
|
+
* trailing value.
|
|
1153
1175
|
*
|
|
1154
1176
|
* **Example** (Appending an element)
|
|
1155
1177
|
*
|
|
@@ -1163,7 +1185,7 @@ export const append: {
|
|
|
1163
1185
|
* @see {@link prepend} — add to the front
|
|
1164
1186
|
* @see {@link appendAll} — append multiple elements
|
|
1165
1187
|
*
|
|
1166
|
-
* @category
|
|
1188
|
+
* @category combining
|
|
1167
1189
|
* @since 2.0.0
|
|
1168
1190
|
*/
|
|
1169
1191
|
<B>(last: B): <A>(self: Iterable<A>) => NonEmptyArray<A | B>
|
|
@@ -1172,12 +1194,8 @@ export const append: {
|
|
|
1172
1194
|
*
|
|
1173
1195
|
* **When to use**
|
|
1174
1196
|
*
|
|
1175
|
-
* Use
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1178
|
-
* **Details**
|
|
1179
|
-
*
|
|
1180
|
-
* - Always returns a non-empty array.
|
|
1197
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
1198
|
+
* trailing value.
|
|
1181
1199
|
*
|
|
1182
1200
|
* **Example** (Appending an element)
|
|
1183
1201
|
*
|
|
@@ -1191,7 +1209,7 @@ export const append: {
|
|
|
1191
1209
|
* @see {@link prepend} — add to the front
|
|
1192
1210
|
* @see {@link appendAll} — append multiple elements
|
|
1193
1211
|
*
|
|
1194
|
-
* @category
|
|
1212
|
+
* @category combining
|
|
1195
1213
|
* @since 2.0.0
|
|
1196
1214
|
*/
|
|
1197
1215
|
<A, B>(self: Iterable<A>, last: B): NonEmptyArray<A | B>
|
|
@@ -1207,7 +1225,7 @@ export const append: {
|
|
|
1207
1225
|
*
|
|
1208
1226
|
* **Details**
|
|
1209
1227
|
*
|
|
1210
|
-
*
|
|
1228
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1211
1229
|
*
|
|
1212
1230
|
* **Example** (Concatenating arrays)
|
|
1213
1231
|
*
|
|
@@ -1221,7 +1239,7 @@ export const append: {
|
|
|
1221
1239
|
* @see {@link append} — add a single element to the end
|
|
1222
1240
|
* @see {@link prependAll} — add elements to the front
|
|
1223
1241
|
*
|
|
1224
|
-
* @category
|
|
1242
|
+
* @category combining
|
|
1225
1243
|
* @since 2.0.0
|
|
1226
1244
|
*/
|
|
1227
1245
|
export const appendAll: {
|
|
@@ -1235,7 +1253,7 @@ export const appendAll: {
|
|
|
1235
1253
|
*
|
|
1236
1254
|
* **Details**
|
|
1237
1255
|
*
|
|
1238
|
-
*
|
|
1256
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1239
1257
|
*
|
|
1240
1258
|
* **Example** (Concatenating arrays)
|
|
1241
1259
|
*
|
|
@@ -1249,7 +1267,7 @@ export const appendAll: {
|
|
|
1249
1267
|
* @see {@link append} — add a single element to the end
|
|
1250
1268
|
* @see {@link prependAll} — add elements to the front
|
|
1251
1269
|
*
|
|
1252
|
-
* @category
|
|
1270
|
+
* @category combining
|
|
1253
1271
|
* @since 2.0.0
|
|
1254
1272
|
*/
|
|
1255
1273
|
<S extends Iterable<any>, T extends Iterable<any>>(that: T): (self: S) => ReadonlyArray.OrNonEmpty<S, T, ReadonlyArray.Infer<S> | ReadonlyArray.Infer<T>>
|
|
@@ -1263,7 +1281,7 @@ export const appendAll: {
|
|
|
1263
1281
|
*
|
|
1264
1282
|
* **Details**
|
|
1265
1283
|
*
|
|
1266
|
-
*
|
|
1284
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1267
1285
|
*
|
|
1268
1286
|
* **Example** (Concatenating arrays)
|
|
1269
1287
|
*
|
|
@@ -1277,7 +1295,7 @@ export const appendAll: {
|
|
|
1277
1295
|
* @see {@link append} — add a single element to the end
|
|
1278
1296
|
* @see {@link prependAll} — add elements to the front
|
|
1279
1297
|
*
|
|
1280
|
-
* @category
|
|
1298
|
+
* @category combining
|
|
1281
1299
|
* @since 2.0.0
|
|
1282
1300
|
*/
|
|
1283
1301
|
<A, B>(self: Iterable<A>, that: NonEmptyReadonlyArray<B>): NonEmptyArray<A | B>
|
|
@@ -1291,7 +1309,7 @@ export const appendAll: {
|
|
|
1291
1309
|
*
|
|
1292
1310
|
* **Details**
|
|
1293
1311
|
*
|
|
1294
|
-
*
|
|
1312
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1295
1313
|
*
|
|
1296
1314
|
* **Example** (Concatenating arrays)
|
|
1297
1315
|
*
|
|
@@ -1305,7 +1323,7 @@ export const appendAll: {
|
|
|
1305
1323
|
* @see {@link append} — add a single element to the end
|
|
1306
1324
|
* @see {@link prependAll} — add elements to the front
|
|
1307
1325
|
*
|
|
1308
|
-
* @category
|
|
1326
|
+
* @category combining
|
|
1309
1327
|
* @since 2.0.0
|
|
1310
1328
|
*/
|
|
1311
1329
|
<A, B>(self: NonEmptyReadonlyArray<A>, that: Iterable<B>): NonEmptyArray<A | B>
|
|
@@ -1319,7 +1337,7 @@ export const appendAll: {
|
|
|
1319
1337
|
*
|
|
1320
1338
|
* **Details**
|
|
1321
1339
|
*
|
|
1322
|
-
*
|
|
1340
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1323
1341
|
*
|
|
1324
1342
|
* **Example** (Concatenating arrays)
|
|
1325
1343
|
*
|
|
@@ -1333,7 +1351,7 @@ export const appendAll: {
|
|
|
1333
1351
|
* @see {@link append} — add a single element to the end
|
|
1334
1352
|
* @see {@link prependAll} — add elements to the front
|
|
1335
1353
|
*
|
|
1336
|
-
* @category
|
|
1354
|
+
* @category combining
|
|
1337
1355
|
* @since 2.0.0
|
|
1338
1356
|
*/
|
|
1339
1357
|
<A, B>(self: Iterable<A>, that: Iterable<B>): Array<A | B>
|
|
@@ -1351,9 +1369,9 @@ export const appendAll: {
|
|
|
1351
1369
|
*
|
|
1352
1370
|
* **Details**
|
|
1353
1371
|
*
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1372
|
+
* The output length is `input.length + 1` because it starts with the initial
|
|
1373
|
+
* value. The result is always a `NonEmptyArray`. Use `reduce` if you only need
|
|
1374
|
+
* the final accumulated value.
|
|
1357
1375
|
*
|
|
1358
1376
|
* **Example** (Running totals)
|
|
1359
1377
|
*
|
|
@@ -1380,9 +1398,9 @@ export const scan: {
|
|
|
1380
1398
|
*
|
|
1381
1399
|
* **Details**
|
|
1382
1400
|
*
|
|
1383
|
-
*
|
|
1384
|
-
*
|
|
1385
|
-
*
|
|
1401
|
+
* The output length is `input.length + 1` because it starts with the initial
|
|
1402
|
+
* value. The result is always a `NonEmptyArray`. Use `reduce` if you only need
|
|
1403
|
+
* the final accumulated value.
|
|
1386
1404
|
*
|
|
1387
1405
|
* **Example** (Running totals)
|
|
1388
1406
|
*
|
|
@@ -1409,9 +1427,9 @@ export const scan: {
|
|
|
1409
1427
|
*
|
|
1410
1428
|
* **Details**
|
|
1411
1429
|
*
|
|
1412
|
-
*
|
|
1413
|
-
*
|
|
1414
|
-
*
|
|
1430
|
+
* The output length is `input.length + 1` because it starts with the initial
|
|
1431
|
+
* value. The result is always a `NonEmptyArray`. Use `reduce` if you only need
|
|
1432
|
+
* the final accumulated value.
|
|
1415
1433
|
*
|
|
1416
1434
|
* **Example** (Running totals)
|
|
1417
1435
|
*
|
|
@@ -1449,8 +1467,8 @@ export const scan: {
|
|
|
1449
1467
|
*
|
|
1450
1468
|
* **Details**
|
|
1451
1469
|
*
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1470
|
+
* The output length is `input.length + 1` because it ends with the initial
|
|
1471
|
+
* value. The result is always a `NonEmptyArray`.
|
|
1454
1472
|
*
|
|
1455
1473
|
* **Example** (Reverse running totals)
|
|
1456
1474
|
*
|
|
@@ -1478,8 +1496,8 @@ export const scanRight: {
|
|
|
1478
1496
|
*
|
|
1479
1497
|
* **Details**
|
|
1480
1498
|
*
|
|
1481
|
-
*
|
|
1482
|
-
*
|
|
1499
|
+
* The output length is `input.length + 1` because it ends with the initial
|
|
1500
|
+
* value. The result is always a `NonEmptyArray`.
|
|
1483
1501
|
*
|
|
1484
1502
|
* **Example** (Reverse running totals)
|
|
1485
1503
|
*
|
|
@@ -1507,8 +1525,8 @@ export const scanRight: {
|
|
|
1507
1525
|
*
|
|
1508
1526
|
* **Details**
|
|
1509
1527
|
*
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1528
|
+
* The output length is `input.length + 1` because it ends with the initial
|
|
1529
|
+
* value. The result is always a `NonEmptyArray`.
|
|
1512
1530
|
*
|
|
1513
1531
|
* **Example** (Reverse running totals)
|
|
1514
1532
|
*
|
|
@@ -1545,8 +1563,8 @@ export const scanRight: {
|
|
|
1545
1563
|
*
|
|
1546
1564
|
* **Details**
|
|
1547
1565
|
*
|
|
1548
|
-
*
|
|
1549
|
-
*
|
|
1566
|
+
* Acts as a type guard narrowing the input to `Array<unknown>` and delegates to
|
|
1567
|
+
* `globalThis.Array.isArray`.
|
|
1550
1568
|
*
|
|
1551
1569
|
* **Example** (Type-guarding an unknown value)
|
|
1552
1570
|
*
|
|
@@ -1573,8 +1591,8 @@ export const isArray: {
|
|
|
1573
1591
|
*
|
|
1574
1592
|
* **Details**
|
|
1575
1593
|
*
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1594
|
+
* Acts as a type guard narrowing the input to `Array<unknown>` and delegates to
|
|
1595
|
+
* `globalThis.Array.isArray`.
|
|
1578
1596
|
*
|
|
1579
1597
|
* **Example** (Type-guarding an unknown value)
|
|
1580
1598
|
*
|
|
@@ -1601,8 +1619,8 @@ export const isArray: {
|
|
|
1601
1619
|
*
|
|
1602
1620
|
* **Details**
|
|
1603
1621
|
*
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1622
|
+
* Acts as a type guard narrowing the input to `Array<unknown>` and delegates to
|
|
1623
|
+
* `globalThis.Array.isArray`.
|
|
1606
1624
|
*
|
|
1607
1625
|
* **Example** (Type-guarding an unknown value)
|
|
1608
1626
|
*
|
|
@@ -1666,6 +1684,11 @@ export const isReadonlyArrayEmpty: <A>(self: ReadonlyArray<A>) => self is readon
|
|
|
1666
1684
|
* Checks whether a mutable `Array` is non-empty, narrowing the type to
|
|
1667
1685
|
* `NonEmptyArray`.
|
|
1668
1686
|
*
|
|
1687
|
+
* **When to use**
|
|
1688
|
+
*
|
|
1689
|
+
* Use when you need the narrowed value to remain a mutable `Array` after proving
|
|
1690
|
+
* it has at least one element.
|
|
1691
|
+
*
|
|
1669
1692
|
* **Example** (Checking for a non-empty array)
|
|
1670
1693
|
*
|
|
1671
1694
|
* ```ts
|
|
@@ -1687,6 +1710,11 @@ export const isArrayNonEmpty: <A>(self: Array<A>) => self is NonEmptyArray<A> =
|
|
|
1687
1710
|
* Checks whether a `ReadonlyArray` is non-empty, narrowing the type to
|
|
1688
1711
|
* `NonEmptyReadonlyArray`.
|
|
1689
1712
|
*
|
|
1713
|
+
* **When to use**
|
|
1714
|
+
*
|
|
1715
|
+
* Use when you need to prove a readonly array has at least one element without
|
|
1716
|
+
* requiring mutable array methods afterward.
|
|
1717
|
+
*
|
|
1690
1718
|
* **Example** (Checking for a non-empty readonly array)
|
|
1691
1719
|
*
|
|
1692
1720
|
* ```ts
|
|
@@ -1743,8 +1771,7 @@ const clamp = <A>(i: number, as: ReadonlyArray<A>): number => Math.floor(Math.mi
|
|
|
1743
1771
|
*
|
|
1744
1772
|
* **Details**
|
|
1745
1773
|
*
|
|
1746
|
-
*
|
|
1747
|
-
* - Never throws.
|
|
1774
|
+
* The index is floored to an integer. This never throws.
|
|
1748
1775
|
*
|
|
1749
1776
|
* **Example** (Safe index access)
|
|
1750
1777
|
*
|
|
@@ -1774,8 +1801,7 @@ export const get: {
|
|
|
1774
1801
|
*
|
|
1775
1802
|
* **Details**
|
|
1776
1803
|
*
|
|
1777
|
-
*
|
|
1778
|
-
* - Never throws.
|
|
1804
|
+
* The index is floored to an integer. This never throws.
|
|
1779
1805
|
*
|
|
1780
1806
|
* **Example** (Safe index access)
|
|
1781
1807
|
*
|
|
@@ -1805,8 +1831,7 @@ export const get: {
|
|
|
1805
1831
|
*
|
|
1806
1832
|
* **Details**
|
|
1807
1833
|
*
|
|
1808
|
-
*
|
|
1809
|
-
* - Never throws.
|
|
1834
|
+
* The index is floored to an integer. This never throws.
|
|
1810
1835
|
*
|
|
1811
1836
|
* **Example** (Safe index access)
|
|
1812
1837
|
*
|
|
@@ -1835,13 +1860,13 @@ export const get: {
|
|
|
1835
1860
|
*
|
|
1836
1861
|
* **When to use**
|
|
1837
1862
|
*
|
|
1838
|
-
* Use to read an element at a known valid index when out-of-bounds would
|
|
1839
|
-
* programming error.
|
|
1863
|
+
* Use to read an array element at a known valid index when out-of-bounds would
|
|
1864
|
+
* be a programming error.
|
|
1840
1865
|
*
|
|
1841
1866
|
* **Details**
|
|
1842
1867
|
*
|
|
1843
|
-
*
|
|
1844
|
-
*
|
|
1868
|
+
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1869
|
+
* `get` for safe access.
|
|
1845
1870
|
*
|
|
1846
1871
|
* **Example** (Unsafe index access)
|
|
1847
1872
|
*
|
|
@@ -1863,13 +1888,13 @@ export const getUnsafe: {
|
|
|
1863
1888
|
*
|
|
1864
1889
|
* **When to use**
|
|
1865
1890
|
*
|
|
1866
|
-
* Use to read an element at a known valid index when out-of-bounds would
|
|
1867
|
-
* programming error.
|
|
1891
|
+
* Use to read an array element at a known valid index when out-of-bounds would
|
|
1892
|
+
* be a programming error.
|
|
1868
1893
|
*
|
|
1869
1894
|
* **Details**
|
|
1870
1895
|
*
|
|
1871
|
-
*
|
|
1872
|
-
*
|
|
1896
|
+
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1897
|
+
* `get` for safe access.
|
|
1873
1898
|
*
|
|
1874
1899
|
* **Example** (Unsafe index access)
|
|
1875
1900
|
*
|
|
@@ -1891,13 +1916,13 @@ export const getUnsafe: {
|
|
|
1891
1916
|
*
|
|
1892
1917
|
* **When to use**
|
|
1893
1918
|
*
|
|
1894
|
-
* Use to read an element at a known valid index when out-of-bounds would
|
|
1895
|
-
* programming error.
|
|
1919
|
+
* Use to read an array element at a known valid index when out-of-bounds would
|
|
1920
|
+
* be a programming error.
|
|
1896
1921
|
*
|
|
1897
1922
|
* **Details**
|
|
1898
1923
|
*
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1924
|
+
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1925
|
+
* `get` for safe access.
|
|
1901
1926
|
*
|
|
1902
1927
|
* **Example** (Unsafe index access)
|
|
1903
1928
|
*
|
|
@@ -1932,8 +1957,7 @@ export const getUnsafe: {
|
|
|
1932
1957
|
*
|
|
1933
1958
|
* **Details**
|
|
1934
1959
|
*
|
|
1935
|
-
*
|
|
1936
|
-
* - Requires a `NonEmptyReadonlyArray`.
|
|
1960
|
+
* Returns a tuple `[head, tail]` and requires a `NonEmptyReadonlyArray`.
|
|
1937
1961
|
*
|
|
1938
1962
|
* **Example** (Destructuring head and tail)
|
|
1939
1963
|
*
|
|
@@ -1961,13 +1985,12 @@ export const unprepend = <A>(
|
|
|
1961
1985
|
*
|
|
1962
1986
|
* **When to use**
|
|
1963
1987
|
*
|
|
1964
|
-
* Use to split a non-empty array
|
|
1965
|
-
*
|
|
1988
|
+
* Use when you need to split a non-empty array into the elements before the
|
|
1989
|
+
* last element and the last element.
|
|
1966
1990
|
*
|
|
1967
1991
|
* **Details**
|
|
1968
1992
|
*
|
|
1969
|
-
*
|
|
1970
|
-
* - Requires a `NonEmptyReadonlyArray`.
|
|
1993
|
+
* Returns a tuple `[init, last]` and requires a `NonEmptyReadonlyArray`.
|
|
1971
1994
|
*
|
|
1972
1995
|
* **Example** (Destructuring init and last)
|
|
1973
1996
|
*
|
|
@@ -2097,8 +2120,7 @@ export const lastNonEmpty = <A>(self: NonEmptyReadonlyArray<A>): A => self[self.
|
|
|
2097
2120
|
*
|
|
2098
2121
|
* **Details**
|
|
2099
2122
|
*
|
|
2100
|
-
*
|
|
2101
|
-
* - Returns `Option.none()` for empty inputs.
|
|
2123
|
+
* Allocates a new array via `slice(1)`. Empty inputs return `Option.none()`.
|
|
2102
2124
|
*
|
|
2103
2125
|
* **Example** (Getting the tail)
|
|
2104
2126
|
*
|
|
@@ -2152,8 +2174,8 @@ export const tailNonEmpty = <A>(self: NonEmptyReadonlyArray<A>): Array<A> => sel
|
|
|
2152
2174
|
*
|
|
2153
2175
|
* **Details**
|
|
2154
2176
|
*
|
|
2155
|
-
*
|
|
2156
|
-
*
|
|
2177
|
+
* Allocates a new array via `slice(0, -1)`. Empty inputs return
|
|
2178
|
+
* `Option.none()`.
|
|
2157
2179
|
*
|
|
2158
2180
|
* **Example** (Getting init)
|
|
2159
2181
|
*
|
|
@@ -2207,8 +2229,7 @@ export const initNonEmpty = <A>(self: NonEmptyReadonlyArray<A>): Array<A> => sel
|
|
|
2207
2229
|
*
|
|
2208
2230
|
* **Details**
|
|
2209
2231
|
*
|
|
2210
|
-
*
|
|
2211
|
-
* - Returns an empty array when `n <= 0`.
|
|
2232
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2212
2233
|
*
|
|
2213
2234
|
* **Example** (Taking from the start)
|
|
2214
2235
|
*
|
|
@@ -2235,8 +2256,7 @@ export const take: {
|
|
|
2235
2256
|
*
|
|
2236
2257
|
* **Details**
|
|
2237
2258
|
*
|
|
2238
|
-
*
|
|
2239
|
-
* - Returns an empty array when `n <= 0`.
|
|
2259
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2240
2260
|
*
|
|
2241
2261
|
* **Example** (Taking from the start)
|
|
2242
2262
|
*
|
|
@@ -2263,8 +2283,7 @@ export const take: {
|
|
|
2263
2283
|
*
|
|
2264
2284
|
* **Details**
|
|
2265
2285
|
*
|
|
2266
|
-
*
|
|
2267
|
-
* - Returns an empty array when `n <= 0`.
|
|
2286
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2268
2287
|
*
|
|
2269
2288
|
* **Example** (Taking from the start)
|
|
2270
2289
|
*
|
|
@@ -2296,8 +2315,7 @@ export const take: {
|
|
|
2296
2315
|
*
|
|
2297
2316
|
* **Details**
|
|
2298
2317
|
*
|
|
2299
|
-
*
|
|
2300
|
-
* - Returns an empty array when `n <= 0`.
|
|
2318
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2301
2319
|
*
|
|
2302
2320
|
* **Example** (Taking from the end)
|
|
2303
2321
|
*
|
|
@@ -2323,8 +2341,7 @@ export const takeRight: {
|
|
|
2323
2341
|
*
|
|
2324
2342
|
* **Details**
|
|
2325
2343
|
*
|
|
2326
|
-
*
|
|
2327
|
-
* - Returns an empty array when `n <= 0`.
|
|
2344
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2328
2345
|
*
|
|
2329
2346
|
* **Example** (Taking from the end)
|
|
2330
2347
|
*
|
|
@@ -2350,8 +2367,7 @@ export const takeRight: {
|
|
|
2350
2367
|
*
|
|
2351
2368
|
* **Details**
|
|
2352
2369
|
*
|
|
2353
|
-
*
|
|
2354
|
-
* - Returns an empty array when `n <= 0`.
|
|
2370
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2355
2371
|
*
|
|
2356
2372
|
* **Example** (Taking from the end)
|
|
2357
2373
|
*
|
|
@@ -2385,8 +2401,8 @@ export const takeRight: {
|
|
|
2385
2401
|
*
|
|
2386
2402
|
* **Details**
|
|
2387
2403
|
*
|
|
2388
|
-
*
|
|
2389
|
-
*
|
|
2404
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2405
|
+
* `(element, index)`.
|
|
2390
2406
|
*
|
|
2391
2407
|
* **Example** (Taking while condition holds)
|
|
2392
2408
|
*
|
|
@@ -2415,8 +2431,8 @@ export const takeWhile: {
|
|
|
2415
2431
|
*
|
|
2416
2432
|
* **Details**
|
|
2417
2433
|
*
|
|
2418
|
-
*
|
|
2419
|
-
*
|
|
2434
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2435
|
+
* `(element, index)`.
|
|
2420
2436
|
*
|
|
2421
2437
|
* **Example** (Taking while condition holds)
|
|
2422
2438
|
*
|
|
@@ -2445,8 +2461,8 @@ export const takeWhile: {
|
|
|
2445
2461
|
*
|
|
2446
2462
|
* **Details**
|
|
2447
2463
|
*
|
|
2448
|
-
*
|
|
2449
|
-
*
|
|
2464
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2465
|
+
* `(element, index)`.
|
|
2450
2466
|
*
|
|
2451
2467
|
* **Example** (Taking while condition holds)
|
|
2452
2468
|
*
|
|
@@ -2475,8 +2491,8 @@ export const takeWhile: {
|
|
|
2475
2491
|
*
|
|
2476
2492
|
* **Details**
|
|
2477
2493
|
*
|
|
2478
|
-
*
|
|
2479
|
-
*
|
|
2494
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2495
|
+
* `(element, index)`.
|
|
2480
2496
|
*
|
|
2481
2497
|
* **Example** (Taking while condition holds)
|
|
2482
2498
|
*
|
|
@@ -2505,8 +2521,8 @@ export const takeWhile: {
|
|
|
2505
2521
|
*
|
|
2506
2522
|
* **Details**
|
|
2507
2523
|
*
|
|
2508
|
-
*
|
|
2509
|
-
*
|
|
2524
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2525
|
+
* `(element, index)`.
|
|
2510
2526
|
*
|
|
2511
2527
|
* **Example** (Taking while condition holds)
|
|
2512
2528
|
*
|
|
@@ -2542,14 +2558,14 @@ export const takeWhile: {
|
|
|
2542
2558
|
*
|
|
2543
2559
|
* **When to use**
|
|
2544
2560
|
*
|
|
2545
|
-
* Use when you need to take a prefix
|
|
2546
|
-
* successfully extract or transform
|
|
2561
|
+
* Use when you need to take a prefix from an iterable while a function can
|
|
2562
|
+
* successfully extract or transform elements, stopping at the first element
|
|
2547
2563
|
* that produces a failure result.
|
|
2548
2564
|
*
|
|
2549
2565
|
* **Details**
|
|
2550
2566
|
*
|
|
2551
|
-
*
|
|
2552
|
-
*
|
|
2567
|
+
* The filter receives `(element, index)` and processing stops at the first
|
|
2568
|
+
* filter failure.
|
|
2553
2569
|
*
|
|
2554
2570
|
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2555
2571
|
*
|
|
@@ -2562,14 +2578,14 @@ export const takeWhileFilter: {
|
|
|
2562
2578
|
*
|
|
2563
2579
|
* **When to use**
|
|
2564
2580
|
*
|
|
2565
|
-
* Use when you need to take a prefix
|
|
2566
|
-
* successfully extract or transform
|
|
2581
|
+
* Use when you need to take a prefix from an iterable while a function can
|
|
2582
|
+
* successfully extract or transform elements, stopping at the first element
|
|
2567
2583
|
* that produces a failure result.
|
|
2568
2584
|
*
|
|
2569
2585
|
* **Details**
|
|
2570
2586
|
*
|
|
2571
|
-
*
|
|
2572
|
-
*
|
|
2587
|
+
* The filter receives `(element, index)` and processing stops at the first
|
|
2588
|
+
* filter failure.
|
|
2573
2589
|
*
|
|
2574
2590
|
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2575
2591
|
*
|
|
@@ -2582,14 +2598,14 @@ export const takeWhileFilter: {
|
|
|
2582
2598
|
*
|
|
2583
2599
|
* **When to use**
|
|
2584
2600
|
*
|
|
2585
|
-
* Use when you need to take a prefix
|
|
2586
|
-
* successfully extract or transform
|
|
2601
|
+
* Use when you need to take a prefix from an iterable while a function can
|
|
2602
|
+
* successfully extract or transform elements, stopping at the first element
|
|
2587
2603
|
* that produces a failure result.
|
|
2588
2604
|
*
|
|
2589
2605
|
* **Details**
|
|
2590
2606
|
*
|
|
2591
|
-
*
|
|
2592
|
-
*
|
|
2607
|
+
* The filter receives `(element, index)` and processing stops at the first
|
|
2608
|
+
* filter failure.
|
|
2593
2609
|
*
|
|
2594
2610
|
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2595
2611
|
*
|
|
@@ -2631,14 +2647,14 @@ const spanIndex = <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean
|
|
|
2631
2647
|
*
|
|
2632
2648
|
* **When to use**
|
|
2633
2649
|
*
|
|
2634
|
-
* Use
|
|
2635
|
-
*
|
|
2650
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2651
|
+
* remaining elements.
|
|
2636
2652
|
*
|
|
2637
2653
|
* **Details**
|
|
2638
2654
|
*
|
|
2639
|
-
*
|
|
2640
|
-
*
|
|
2641
|
-
*
|
|
2655
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2656
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2657
|
+
* the prefix.
|
|
2642
2658
|
*
|
|
2643
2659
|
* **Example** (Splitting at predicate boundary)
|
|
2644
2660
|
*
|
|
@@ -2662,14 +2678,14 @@ export const span: {
|
|
|
2662
2678
|
*
|
|
2663
2679
|
* **When to use**
|
|
2664
2680
|
*
|
|
2665
|
-
* Use
|
|
2666
|
-
*
|
|
2681
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2682
|
+
* remaining elements.
|
|
2667
2683
|
*
|
|
2668
2684
|
* **Details**
|
|
2669
2685
|
*
|
|
2670
|
-
*
|
|
2671
|
-
*
|
|
2672
|
-
*
|
|
2686
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2687
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2688
|
+
* the prefix.
|
|
2673
2689
|
*
|
|
2674
2690
|
* **Example** (Splitting at predicate boundary)
|
|
2675
2691
|
*
|
|
@@ -2693,14 +2709,14 @@ export const span: {
|
|
|
2693
2709
|
*
|
|
2694
2710
|
* **When to use**
|
|
2695
2711
|
*
|
|
2696
|
-
* Use
|
|
2697
|
-
*
|
|
2712
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2713
|
+
* remaining elements.
|
|
2698
2714
|
*
|
|
2699
2715
|
* **Details**
|
|
2700
2716
|
*
|
|
2701
|
-
*
|
|
2702
|
-
*
|
|
2703
|
-
*
|
|
2717
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2718
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2719
|
+
* the prefix.
|
|
2704
2720
|
*
|
|
2705
2721
|
* **Example** (Splitting at predicate boundary)
|
|
2706
2722
|
*
|
|
@@ -2724,14 +2740,14 @@ export const span: {
|
|
|
2724
2740
|
*
|
|
2725
2741
|
* **When to use**
|
|
2726
2742
|
*
|
|
2727
|
-
* Use
|
|
2728
|
-
*
|
|
2743
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2744
|
+
* remaining elements.
|
|
2729
2745
|
*
|
|
2730
2746
|
* **Details**
|
|
2731
2747
|
*
|
|
2732
|
-
*
|
|
2733
|
-
*
|
|
2734
|
-
*
|
|
2748
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2749
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2750
|
+
* the prefix.
|
|
2735
2751
|
*
|
|
2736
2752
|
* **Example** (Splitting at predicate boundary)
|
|
2737
2753
|
*
|
|
@@ -2755,14 +2771,14 @@ export const span: {
|
|
|
2755
2771
|
*
|
|
2756
2772
|
* **When to use**
|
|
2757
2773
|
*
|
|
2758
|
-
* Use
|
|
2759
|
-
*
|
|
2774
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2775
|
+
* remaining elements.
|
|
2760
2776
|
*
|
|
2761
2777
|
* **Details**
|
|
2762
2778
|
*
|
|
2763
|
-
*
|
|
2764
|
-
*
|
|
2765
|
-
*
|
|
2779
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2780
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2781
|
+
* the prefix.
|
|
2766
2782
|
*
|
|
2767
2783
|
* **Example** (Splitting at predicate boundary)
|
|
2768
2784
|
*
|
|
@@ -2798,8 +2814,8 @@ export const span: {
|
|
|
2798
2814
|
*
|
|
2799
2815
|
* **Details**
|
|
2800
2816
|
*
|
|
2801
|
-
*
|
|
2802
|
-
*
|
|
2817
|
+
* `n` is clamped to `[0, length]`. When `n <= 0`, this returns a copy of the
|
|
2818
|
+
* full array.
|
|
2803
2819
|
*
|
|
2804
2820
|
* **Example** (Dropping from the start)
|
|
2805
2821
|
*
|
|
@@ -2827,8 +2843,8 @@ export const drop: {
|
|
|
2827
2843
|
*
|
|
2828
2844
|
* **Details**
|
|
2829
2845
|
*
|
|
2830
|
-
*
|
|
2831
|
-
*
|
|
2846
|
+
* `n` is clamped to `[0, length]`. When `n <= 0`, this returns a copy of the
|
|
2847
|
+
* full array.
|
|
2832
2848
|
*
|
|
2833
2849
|
* **Example** (Dropping from the start)
|
|
2834
2850
|
*
|
|
@@ -2856,8 +2872,8 @@ export const drop: {
|
|
|
2856
2872
|
*
|
|
2857
2873
|
* **Details**
|
|
2858
2874
|
*
|
|
2859
|
-
*
|
|
2860
|
-
*
|
|
2875
|
+
* `n` is clamped to `[0, length]`. When `n <= 0`, this returns a copy of the
|
|
2876
|
+
* full array.
|
|
2861
2877
|
*
|
|
2862
2878
|
* **Example** (Dropping from the start)
|
|
2863
2879
|
*
|
|
@@ -3058,13 +3074,13 @@ export const dropWhile: {
|
|
|
3058
3074
|
*
|
|
3059
3075
|
* **When to use**
|
|
3060
3076
|
*
|
|
3061
|
-
* Use when
|
|
3062
|
-
* of a simple boolean predicate.
|
|
3077
|
+
* Use when you need to drop a prefix from an iterable by computing a `Result`
|
|
3078
|
+
* per element instead of using a simple boolean predicate.
|
|
3063
3079
|
*
|
|
3064
3080
|
* **Details**
|
|
3065
3081
|
*
|
|
3066
|
-
*
|
|
3067
|
-
*
|
|
3082
|
+
* The filter receives `(element, index)`. The result contains the remaining
|
|
3083
|
+
* original elements after the first filter failure.
|
|
3068
3084
|
*
|
|
3069
3085
|
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
3070
3086
|
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
@@ -3078,13 +3094,13 @@ export const dropWhileFilter: {
|
|
|
3078
3094
|
*
|
|
3079
3095
|
* **When to use**
|
|
3080
3096
|
*
|
|
3081
|
-
* Use when
|
|
3082
|
-
* of a simple boolean predicate.
|
|
3097
|
+
* Use when you need to drop a prefix from an iterable by computing a `Result`
|
|
3098
|
+
* per element instead of using a simple boolean predicate.
|
|
3083
3099
|
*
|
|
3084
3100
|
* **Details**
|
|
3085
3101
|
*
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3102
|
+
* The filter receives `(element, index)`. The result contains the remaining
|
|
3103
|
+
* original elements after the first filter failure.
|
|
3088
3104
|
*
|
|
3089
3105
|
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
3090
3106
|
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
@@ -3098,13 +3114,13 @@ export const dropWhileFilter: {
|
|
|
3098
3114
|
*
|
|
3099
3115
|
* **When to use**
|
|
3100
3116
|
*
|
|
3101
|
-
* Use when
|
|
3102
|
-
* of a simple boolean predicate.
|
|
3117
|
+
* Use when you need to drop a prefix from an iterable by computing a `Result`
|
|
3118
|
+
* per element instead of using a simple boolean predicate.
|
|
3103
3119
|
*
|
|
3104
3120
|
* **Details**
|
|
3105
3121
|
*
|
|
3106
|
-
*
|
|
3107
|
-
*
|
|
3122
|
+
* The filter receives `(element, index)`. The result contains the remaining
|
|
3123
|
+
* original elements after the first filter failure.
|
|
3108
3124
|
*
|
|
3109
3125
|
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
3110
3126
|
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
@@ -3301,9 +3317,9 @@ export const findLastIndex: {
|
|
|
3301
3317
|
*
|
|
3302
3318
|
* **Details**
|
|
3303
3319
|
*
|
|
3304
|
-
*
|
|
3305
|
-
*
|
|
3306
|
-
*
|
|
3320
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3321
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3322
|
+
* matches, this returns `Option.none()`.
|
|
3307
3323
|
*
|
|
3308
3324
|
* **Example** (Finding the first match)
|
|
3309
3325
|
*
|
|
@@ -3332,9 +3348,9 @@ export const findFirst: {
|
|
|
3332
3348
|
*
|
|
3333
3349
|
* **Details**
|
|
3334
3350
|
*
|
|
3335
|
-
*
|
|
3336
|
-
*
|
|
3337
|
-
*
|
|
3351
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3352
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3353
|
+
* matches, this returns `Option.none()`.
|
|
3338
3354
|
*
|
|
3339
3355
|
* **Example** (Finding the first match)
|
|
3340
3356
|
*
|
|
@@ -3363,9 +3379,9 @@ export const findFirst: {
|
|
|
3363
3379
|
*
|
|
3364
3380
|
* **Details**
|
|
3365
3381
|
*
|
|
3366
|
-
*
|
|
3367
|
-
*
|
|
3368
|
-
*
|
|
3382
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3383
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3384
|
+
* matches, this returns `Option.none()`.
|
|
3369
3385
|
*
|
|
3370
3386
|
* **Example** (Finding the first match)
|
|
3371
3387
|
*
|
|
@@ -3394,9 +3410,9 @@ export const findFirst: {
|
|
|
3394
3410
|
*
|
|
3395
3411
|
* **Details**
|
|
3396
3412
|
*
|
|
3397
|
-
*
|
|
3398
|
-
*
|
|
3399
|
-
*
|
|
3413
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3414
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3415
|
+
* matches, this returns `Option.none()`.
|
|
3400
3416
|
*
|
|
3401
3417
|
* **Example** (Finding the first match)
|
|
3402
3418
|
*
|
|
@@ -3425,9 +3441,9 @@ export const findFirst: {
|
|
|
3425
3441
|
*
|
|
3426
3442
|
* **Details**
|
|
3427
3443
|
*
|
|
3428
|
-
*
|
|
3429
|
-
*
|
|
3430
|
-
*
|
|
3444
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3445
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3446
|
+
* matches, this returns `Option.none()`.
|
|
3431
3447
|
*
|
|
3432
3448
|
* **Example** (Finding the first match)
|
|
3433
3449
|
*
|
|
@@ -3456,9 +3472,9 @@ export const findFirst: {
|
|
|
3456
3472
|
*
|
|
3457
3473
|
* **Details**
|
|
3458
3474
|
*
|
|
3459
|
-
*
|
|
3460
|
-
*
|
|
3461
|
-
*
|
|
3475
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3476
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3477
|
+
* matches, this returns `Option.none()`.
|
|
3462
3478
|
*
|
|
3463
3479
|
* **Example** (Finding the first match)
|
|
3464
3480
|
*
|
|
@@ -3487,9 +3503,9 @@ export const findFirst: {
|
|
|
3487
3503
|
*
|
|
3488
3504
|
* **Details**
|
|
3489
3505
|
*
|
|
3490
|
-
*
|
|
3491
|
-
*
|
|
3492
|
-
*
|
|
3506
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3507
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3508
|
+
* matches, this returns `Option.none()`.
|
|
3493
3509
|
*
|
|
3494
3510
|
* **Example** (Finding the first match)
|
|
3495
3511
|
*
|
|
@@ -3746,8 +3762,8 @@ export const findFirstWithIndex: {
|
|
|
3746
3762
|
*
|
|
3747
3763
|
* **Details**
|
|
3748
3764
|
*
|
|
3749
|
-
*
|
|
3750
|
-
*
|
|
3765
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3766
|
+
* `Option.none()`.
|
|
3751
3767
|
*
|
|
3752
3768
|
* **Example** (Finding the last match)
|
|
3753
3769
|
*
|
|
@@ -3774,8 +3790,8 @@ export const findLast: {
|
|
|
3774
3790
|
*
|
|
3775
3791
|
* **Details**
|
|
3776
3792
|
*
|
|
3777
|
-
*
|
|
3778
|
-
*
|
|
3793
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3794
|
+
* `Option.none()`.
|
|
3779
3795
|
*
|
|
3780
3796
|
* **Example** (Finding the last match)
|
|
3781
3797
|
*
|
|
@@ -3802,8 +3818,8 @@ export const findLast: {
|
|
|
3802
3818
|
*
|
|
3803
3819
|
* **Details**
|
|
3804
3820
|
*
|
|
3805
|
-
*
|
|
3806
|
-
*
|
|
3821
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3822
|
+
* `Option.none()`.
|
|
3807
3823
|
*
|
|
3808
3824
|
* **Example** (Finding the last match)
|
|
3809
3825
|
*
|
|
@@ -3830,8 +3846,8 @@ export const findLast: {
|
|
|
3830
3846
|
*
|
|
3831
3847
|
* **Details**
|
|
3832
3848
|
*
|
|
3833
|
-
*
|
|
3834
|
-
*
|
|
3849
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3850
|
+
* `Option.none()`.
|
|
3835
3851
|
*
|
|
3836
3852
|
* **Example** (Finding the last match)
|
|
3837
3853
|
*
|
|
@@ -3858,8 +3874,8 @@ export const findLast: {
|
|
|
3858
3874
|
*
|
|
3859
3875
|
* **Details**
|
|
3860
3876
|
*
|
|
3861
|
-
*
|
|
3862
|
-
*
|
|
3877
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3878
|
+
* `Option.none()`.
|
|
3863
3879
|
*
|
|
3864
3880
|
* **Example** (Finding the last match)
|
|
3865
3881
|
*
|
|
@@ -3886,8 +3902,8 @@ export const findLast: {
|
|
|
3886
3902
|
*
|
|
3887
3903
|
* **Details**
|
|
3888
3904
|
*
|
|
3889
|
-
*
|
|
3890
|
-
*
|
|
3905
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3906
|
+
* `Option.none()`.
|
|
3891
3907
|
*
|
|
3892
3908
|
* **Example** (Finding the last match)
|
|
3893
3909
|
*
|
|
@@ -3914,8 +3930,8 @@ export const findLast: {
|
|
|
3914
3930
|
*
|
|
3915
3931
|
* **Details**
|
|
3916
3932
|
*
|
|
3917
|
-
*
|
|
3918
|
-
*
|
|
3933
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3934
|
+
* `Option.none()`.
|
|
3919
3935
|
*
|
|
3920
3936
|
* **Example** (Finding the last match)
|
|
3921
3937
|
*
|
|
@@ -3966,7 +3982,7 @@ export const findLast: {
|
|
|
3966
3982
|
*
|
|
3967
3983
|
* **Details**
|
|
3968
3984
|
*
|
|
3969
|
-
*
|
|
3985
|
+
* Valid indices are `0` to `length`, inclusive. Inserting at `length` appends.
|
|
3970
3986
|
*
|
|
3971
3987
|
* **Example** (Inserting at an index)
|
|
3972
3988
|
*
|
|
@@ -3993,7 +4009,7 @@ export const insertAt: {
|
|
|
3993
4009
|
*
|
|
3994
4010
|
* **Details**
|
|
3995
4011
|
*
|
|
3996
|
-
*
|
|
4012
|
+
* Valid indices are `0` to `length`, inclusive. Inserting at `length` appends.
|
|
3997
4013
|
*
|
|
3998
4014
|
* **Example** (Inserting at an index)
|
|
3999
4015
|
*
|
|
@@ -4020,7 +4036,7 @@ export const insertAt: {
|
|
|
4020
4036
|
*
|
|
4021
4037
|
* **Details**
|
|
4022
4038
|
*
|
|
4023
|
-
*
|
|
4039
|
+
* Valid indices are `0` to `length`, inclusive. Inserting at `length` appends.
|
|
4024
4040
|
*
|
|
4025
4041
|
* **Example** (Inserting at an index)
|
|
4026
4042
|
*
|
|
@@ -4056,7 +4072,7 @@ export const insertAt: {
|
|
|
4056
4072
|
*
|
|
4057
4073
|
* **Details**
|
|
4058
4074
|
*
|
|
4059
|
-
*
|
|
4075
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
4060
4076
|
*
|
|
4061
4077
|
* **Example** (Replacing an element)
|
|
4062
4078
|
*
|
|
@@ -4083,7 +4099,7 @@ export const replace: {
|
|
|
4083
4099
|
*
|
|
4084
4100
|
* **Details**
|
|
4085
4101
|
*
|
|
4086
|
-
*
|
|
4102
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
4087
4103
|
*
|
|
4088
4104
|
* **Example** (Replacing an element)
|
|
4089
4105
|
*
|
|
@@ -4112,7 +4128,7 @@ export const replace: {
|
|
|
4112
4128
|
*
|
|
4113
4129
|
* **Details**
|
|
4114
4130
|
*
|
|
4115
|
-
*
|
|
4131
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
4116
4132
|
*
|
|
4117
4133
|
* **Example** (Replacing an element)
|
|
4118
4134
|
*
|
|
@@ -4140,12 +4156,12 @@ export const replace: {
|
|
|
4140
4156
|
*
|
|
4141
4157
|
* **When to use**
|
|
4142
4158
|
*
|
|
4143
|
-
* Use to derive a replacement value from
|
|
4144
|
-
*
|
|
4159
|
+
* Use to derive a replacement value from an array element at a specific index
|
|
4160
|
+
* while leaving the other elements unchanged.
|
|
4145
4161
|
*
|
|
4146
4162
|
* **Details**
|
|
4147
4163
|
*
|
|
4148
|
-
*
|
|
4164
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
4149
4165
|
*
|
|
4150
4166
|
* **Example** (Modifying an element)
|
|
4151
4167
|
*
|
|
@@ -4170,12 +4186,12 @@ export const modify: {
|
|
|
4170
4186
|
*
|
|
4171
4187
|
* **When to use**
|
|
4172
4188
|
*
|
|
4173
|
-
* Use to derive a replacement value from
|
|
4174
|
-
*
|
|
4189
|
+
* Use to derive a replacement value from an array element at a specific index
|
|
4190
|
+
* while leaving the other elements unchanged.
|
|
4175
4191
|
*
|
|
4176
4192
|
* **Details**
|
|
4177
4193
|
*
|
|
4178
|
-
*
|
|
4194
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
4179
4195
|
*
|
|
4180
4196
|
* **Example** (Modifying an element)
|
|
4181
4197
|
*
|
|
@@ -4200,12 +4216,12 @@ export const modify: {
|
|
|
4200
4216
|
*
|
|
4201
4217
|
* **When to use**
|
|
4202
4218
|
*
|
|
4203
|
-
* Use to derive a replacement value from
|
|
4204
|
-
*
|
|
4219
|
+
* Use to derive a replacement value from an array element at a specific index
|
|
4220
|
+
* while leaving the other elements unchanged.
|
|
4205
4221
|
*
|
|
4206
4222
|
* **Details**
|
|
4207
4223
|
*
|
|
4208
|
-
*
|
|
4224
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
4209
4225
|
*
|
|
4210
4226
|
* **Example** (Modifying an element)
|
|
4211
4227
|
*
|
|
@@ -4241,7 +4257,8 @@ export const modify: {
|
|
|
4241
4257
|
*
|
|
4242
4258
|
* **When to use**
|
|
4243
4259
|
*
|
|
4244
|
-
* Use to
|
|
4260
|
+
* Use when you want a missing index to be a no-op and need a fresh array result
|
|
4261
|
+
* instead of an optional failure.
|
|
4245
4262
|
*
|
|
4246
4263
|
* **Example** (Removing an element)
|
|
4247
4264
|
*
|
|
@@ -4265,7 +4282,8 @@ export const remove: {
|
|
|
4265
4282
|
*
|
|
4266
4283
|
* **When to use**
|
|
4267
4284
|
*
|
|
4268
|
-
* Use to
|
|
4285
|
+
* Use when you want a missing index to be a no-op and need a fresh array result
|
|
4286
|
+
* instead of an optional failure.
|
|
4269
4287
|
*
|
|
4270
4288
|
* **Example** (Removing an element)
|
|
4271
4289
|
*
|
|
@@ -4289,7 +4307,8 @@ export const remove: {
|
|
|
4289
4307
|
*
|
|
4290
4308
|
* **When to use**
|
|
4291
4309
|
*
|
|
4292
|
-
* Use to
|
|
4310
|
+
* Use when you want a missing index to be a no-op and need a fresh array result
|
|
4311
|
+
* instead of an optional failure.
|
|
4293
4312
|
*
|
|
4294
4313
|
* **Example** (Removing an element)
|
|
4295
4314
|
*
|
|
@@ -4321,11 +4340,12 @@ export const remove: {
|
|
|
4321
4340
|
*
|
|
4322
4341
|
* **When to use**
|
|
4323
4342
|
*
|
|
4324
|
-
* Use to reverse
|
|
4343
|
+
* Use to reverse an iterable into a new array without mutating the original
|
|
4344
|
+
* input.
|
|
4325
4345
|
*
|
|
4326
4346
|
* **Details**
|
|
4327
4347
|
*
|
|
4328
|
-
*
|
|
4348
|
+
* Preserves `NonEmptyArray` in the return type.
|
|
4329
4349
|
*
|
|
4330
4350
|
* **Example** (Reversing an array)
|
|
4331
4351
|
*
|
|
@@ -4352,9 +4372,8 @@ export const reverse = <S extends Iterable<any>>(
|
|
|
4352
4372
|
*
|
|
4353
4373
|
* **Details**
|
|
4354
4374
|
*
|
|
4355
|
-
*
|
|
4356
|
-
*
|
|
4357
|
-
* multi-key sorting.
|
|
4375
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4376
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
4358
4377
|
*
|
|
4359
4378
|
* **Example** (Sorting numbers)
|
|
4360
4379
|
*
|
|
@@ -4380,9 +4399,8 @@ export const sort: {
|
|
|
4380
4399
|
*
|
|
4381
4400
|
* **Details**
|
|
4382
4401
|
*
|
|
4383
|
-
*
|
|
4384
|
-
*
|
|
4385
|
-
* multi-key sorting.
|
|
4402
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4403
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
4386
4404
|
*
|
|
4387
4405
|
* **Example** (Sorting numbers)
|
|
4388
4406
|
*
|
|
@@ -4408,9 +4426,8 @@ export const sort: {
|
|
|
4408
4426
|
*
|
|
4409
4427
|
* **Details**
|
|
4410
4428
|
*
|
|
4411
|
-
*
|
|
4412
|
-
*
|
|
4413
|
-
* multi-key sorting.
|
|
4429
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4430
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
4414
4431
|
*
|
|
4415
4432
|
* **Example** (Sorting numbers)
|
|
4416
4433
|
*
|
|
@@ -4436,9 +4453,8 @@ export const sort: {
|
|
|
4436
4453
|
*
|
|
4437
4454
|
* **Details**
|
|
4438
4455
|
*
|
|
4439
|
-
*
|
|
4440
|
-
*
|
|
4441
|
-
* multi-key sorting.
|
|
4456
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4457
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
4442
4458
|
*
|
|
4443
4459
|
* **Example** (Sorting numbers)
|
|
4444
4460
|
*
|
|
@@ -4467,12 +4483,12 @@ export const sort: {
|
|
|
4467
4483
|
*
|
|
4468
4484
|
* **When to use**
|
|
4469
4485
|
*
|
|
4470
|
-
* Use when
|
|
4471
|
-
*
|
|
4486
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4487
|
+
* object field, while keeping the original values.
|
|
4472
4488
|
*
|
|
4473
4489
|
* **Details**
|
|
4474
4490
|
*
|
|
4475
|
-
*
|
|
4491
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4476
4492
|
*
|
|
4477
4493
|
* **Example** (Sorting strings by length)
|
|
4478
4494
|
*
|
|
@@ -4496,12 +4512,12 @@ export const sortWith: {
|
|
|
4496
4512
|
*
|
|
4497
4513
|
* **When to use**
|
|
4498
4514
|
*
|
|
4499
|
-
* Use when
|
|
4500
|
-
*
|
|
4515
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4516
|
+
* object field, while keeping the original values.
|
|
4501
4517
|
*
|
|
4502
4518
|
* **Details**
|
|
4503
4519
|
*
|
|
4504
|
-
*
|
|
4520
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4505
4521
|
*
|
|
4506
4522
|
* **Example** (Sorting strings by length)
|
|
4507
4523
|
*
|
|
@@ -4525,12 +4541,12 @@ export const sortWith: {
|
|
|
4525
4541
|
*
|
|
4526
4542
|
* **When to use**
|
|
4527
4543
|
*
|
|
4528
|
-
* Use when
|
|
4529
|
-
*
|
|
4544
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4545
|
+
* object field, while keeping the original values.
|
|
4530
4546
|
*
|
|
4531
4547
|
* **Details**
|
|
4532
4548
|
*
|
|
4533
|
-
*
|
|
4549
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4534
4550
|
*
|
|
4535
4551
|
* **Example** (Sorting strings by length)
|
|
4536
4552
|
*
|
|
@@ -4554,12 +4570,12 @@ export const sortWith: {
|
|
|
4554
4570
|
*
|
|
4555
4571
|
* **When to use**
|
|
4556
4572
|
*
|
|
4557
|
-
* Use when
|
|
4558
|
-
*
|
|
4573
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4574
|
+
* object field, while keeping the original values.
|
|
4559
4575
|
*
|
|
4560
4576
|
* **Details**
|
|
4561
4577
|
*
|
|
4562
|
-
*
|
|
4578
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4563
4579
|
*
|
|
4564
4580
|
* **Example** (Sorting strings by length)
|
|
4565
4581
|
*
|
|
@@ -4594,8 +4610,8 @@ export const sortWith: {
|
|
|
4594
4610
|
*
|
|
4595
4611
|
* **Details**
|
|
4596
4612
|
*
|
|
4597
|
-
*
|
|
4598
|
-
*
|
|
4613
|
+
* This is data-last only and returns a function. The return type preserves
|
|
4614
|
+
* `NonEmptyArray`.
|
|
4599
4615
|
*
|
|
4600
4616
|
* **Example** (Multi-key sorting)
|
|
4601
4617
|
*
|
|
@@ -4646,11 +4662,11 @@ export const sortBy = <S extends Iterable<any>>(
|
|
|
4646
4662
|
*
|
|
4647
4663
|
* **When to use**
|
|
4648
4664
|
*
|
|
4649
|
-
* Use
|
|
4665
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4650
4666
|
*
|
|
4651
4667
|
* **Details**
|
|
4652
4668
|
*
|
|
4653
|
-
*
|
|
4669
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4654
4670
|
*
|
|
4655
4671
|
* **Example** (Zipping two arrays)
|
|
4656
4672
|
*
|
|
@@ -4673,11 +4689,11 @@ export const zip: {
|
|
|
4673
4689
|
*
|
|
4674
4690
|
* **When to use**
|
|
4675
4691
|
*
|
|
4676
|
-
* Use
|
|
4692
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4677
4693
|
*
|
|
4678
4694
|
* **Details**
|
|
4679
4695
|
*
|
|
4680
|
-
*
|
|
4696
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4681
4697
|
*
|
|
4682
4698
|
* **Example** (Zipping two arrays)
|
|
4683
4699
|
*
|
|
@@ -4700,11 +4716,11 @@ export const zip: {
|
|
|
4700
4716
|
*
|
|
4701
4717
|
* **When to use**
|
|
4702
4718
|
*
|
|
4703
|
-
* Use
|
|
4719
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4704
4720
|
*
|
|
4705
4721
|
* **Details**
|
|
4706
4722
|
*
|
|
4707
|
-
*
|
|
4723
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4708
4724
|
*
|
|
4709
4725
|
* **Example** (Zipping two arrays)
|
|
4710
4726
|
*
|
|
@@ -4727,11 +4743,11 @@ export const zip: {
|
|
|
4727
4743
|
*
|
|
4728
4744
|
* **When to use**
|
|
4729
4745
|
*
|
|
4730
|
-
* Use
|
|
4746
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4731
4747
|
*
|
|
4732
4748
|
* **Details**
|
|
4733
4749
|
*
|
|
4734
|
-
*
|
|
4750
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4735
4751
|
*
|
|
4736
4752
|
* **Example** (Zipping two arrays)
|
|
4737
4753
|
*
|
|
@@ -4754,11 +4770,11 @@ export const zip: {
|
|
|
4754
4770
|
*
|
|
4755
4771
|
* **When to use**
|
|
4756
4772
|
*
|
|
4757
|
-
* Use
|
|
4773
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4758
4774
|
*
|
|
4759
4775
|
* **Details**
|
|
4760
4776
|
*
|
|
4761
|
-
*
|
|
4777
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4762
4778
|
*
|
|
4763
4779
|
* **Example** (Zipping two arrays)
|
|
4764
4780
|
*
|
|
@@ -4784,6 +4800,11 @@ export const zip: {
|
|
|
4784
4800
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4785
4801
|
* iterables differ in length, extra elements are discarded.
|
|
4786
4802
|
*
|
|
4803
|
+
* **When to use**
|
|
4804
|
+
*
|
|
4805
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4806
|
+
* become a computed array element instead of a tuple.
|
|
4807
|
+
*
|
|
4787
4808
|
* **Example** (Zipping with addition)
|
|
4788
4809
|
*
|
|
4789
4810
|
* ```ts
|
|
@@ -4802,6 +4823,11 @@ export const zipWith: {
|
|
|
4802
4823
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4803
4824
|
* iterables differ in length, extra elements are discarded.
|
|
4804
4825
|
*
|
|
4826
|
+
* **When to use**
|
|
4827
|
+
*
|
|
4828
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4829
|
+
* become a computed array element instead of a tuple.
|
|
4830
|
+
*
|
|
4805
4831
|
* **Example** (Zipping with addition)
|
|
4806
4832
|
*
|
|
4807
4833
|
* ```ts
|
|
@@ -4820,6 +4846,11 @@ export const zipWith: {
|
|
|
4820
4846
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4821
4847
|
* iterables differ in length, extra elements are discarded.
|
|
4822
4848
|
*
|
|
4849
|
+
* **When to use**
|
|
4850
|
+
*
|
|
4851
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4852
|
+
* become a computed array element instead of a tuple.
|
|
4853
|
+
*
|
|
4823
4854
|
* **Example** (Zipping with addition)
|
|
4824
4855
|
*
|
|
4825
4856
|
* ```ts
|
|
@@ -4838,6 +4869,11 @@ export const zipWith: {
|
|
|
4838
4869
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4839
4870
|
* iterables differ in length, extra elements are discarded.
|
|
4840
4871
|
*
|
|
4872
|
+
* **When to use**
|
|
4873
|
+
*
|
|
4874
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4875
|
+
* become a computed array element instead of a tuple.
|
|
4876
|
+
*
|
|
4841
4877
|
* **Example** (Zipping with addition)
|
|
4842
4878
|
*
|
|
4843
4879
|
* ```ts
|
|
@@ -4860,6 +4896,11 @@ export const zipWith: {
|
|
|
4860
4896
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4861
4897
|
* iterables differ in length, extra elements are discarded.
|
|
4862
4898
|
*
|
|
4899
|
+
* **When to use**
|
|
4900
|
+
*
|
|
4901
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4902
|
+
* become a computed array element instead of a tuple.
|
|
4903
|
+
*
|
|
4863
4904
|
* **Example** (Zipping with addition)
|
|
4864
4905
|
*
|
|
4865
4906
|
* ```ts
|
|
@@ -4931,8 +4972,8 @@ export const unzip: <S extends Iterable<readonly [any, any]>>(
|
|
|
4931
4972
|
*
|
|
4932
4973
|
* **Details**
|
|
4933
4974
|
*
|
|
4934
|
-
*
|
|
4935
|
-
*
|
|
4975
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
4976
|
+
* result.
|
|
4936
4977
|
*
|
|
4937
4978
|
* **Example** (Interspersing a separator)
|
|
4938
4979
|
*
|
|
@@ -4957,8 +4998,8 @@ export const intersperse: {
|
|
|
4957
4998
|
*
|
|
4958
4999
|
* **Details**
|
|
4959
5000
|
*
|
|
4960
|
-
*
|
|
4961
|
-
*
|
|
5001
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
5002
|
+
* result.
|
|
4962
5003
|
*
|
|
4963
5004
|
* **Example** (Interspersing a separator)
|
|
4964
5005
|
*
|
|
@@ -4983,8 +5024,8 @@ export const intersperse: {
|
|
|
4983
5024
|
*
|
|
4984
5025
|
* **Details**
|
|
4985
5026
|
*
|
|
4986
|
-
*
|
|
4987
|
-
*
|
|
5027
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
5028
|
+
* result.
|
|
4988
5029
|
*
|
|
4989
5030
|
* **Example** (Interspersing a separator)
|
|
4990
5031
|
*
|
|
@@ -5009,8 +5050,8 @@ export const intersperse: {
|
|
|
5009
5050
|
*
|
|
5010
5051
|
* **Details**
|
|
5011
5052
|
*
|
|
5012
|
-
*
|
|
5013
|
-
*
|
|
5053
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
5054
|
+
* result.
|
|
5014
5055
|
*
|
|
5015
5056
|
* **Example** (Interspersing a separator)
|
|
5016
5057
|
*
|
|
@@ -5122,6 +5163,11 @@ export const modifyHeadNonEmpty: {
|
|
|
5122
5163
|
/**
|
|
5123
5164
|
* Replaces the first element of a non-empty array with a new value.
|
|
5124
5165
|
*
|
|
5166
|
+
* **When to use**
|
|
5167
|
+
*
|
|
5168
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
5169
|
+
* does not depend on the current first element.
|
|
5170
|
+
*
|
|
5125
5171
|
* **Example** (Setting the head)
|
|
5126
5172
|
*
|
|
5127
5173
|
* ```ts
|
|
@@ -5140,6 +5186,11 @@ export const setHeadNonEmpty: {
|
|
|
5140
5186
|
/**
|
|
5141
5187
|
* Replaces the first element of a non-empty array with a new value.
|
|
5142
5188
|
*
|
|
5189
|
+
* **When to use**
|
|
5190
|
+
*
|
|
5191
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
5192
|
+
* does not depend on the current first element.
|
|
5193
|
+
*
|
|
5143
5194
|
* **Example** (Setting the head)
|
|
5144
5195
|
*
|
|
5145
5196
|
* ```ts
|
|
@@ -5158,6 +5209,11 @@ export const setHeadNonEmpty: {
|
|
|
5158
5209
|
/**
|
|
5159
5210
|
* Replaces the first element of a non-empty array with a new value.
|
|
5160
5211
|
*
|
|
5212
|
+
* **When to use**
|
|
5213
|
+
*
|
|
5214
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
5215
|
+
* does not depend on the current first element.
|
|
5216
|
+
*
|
|
5161
5217
|
* **Example** (Setting the head)
|
|
5162
5218
|
*
|
|
5163
5219
|
* ```ts
|
|
@@ -5182,6 +5238,11 @@ export const setHeadNonEmpty: {
|
|
|
5182
5238
|
* Applies a function to the last element of a non-empty array, returning a
|
|
5183
5239
|
* new array.
|
|
5184
5240
|
*
|
|
5241
|
+
* **When to use**
|
|
5242
|
+
*
|
|
5243
|
+
* Use when you already know the array is non-empty and the new last element
|
|
5244
|
+
* depends on the current last element.
|
|
5245
|
+
*
|
|
5185
5246
|
* **Example** (Modifying the last element)
|
|
5186
5247
|
*
|
|
5187
5248
|
* ```ts
|
|
@@ -5201,6 +5262,11 @@ export const modifyLastNonEmpty: {
|
|
|
5201
5262
|
* Applies a function to the last element of a non-empty array, returning a
|
|
5202
5263
|
* new array.
|
|
5203
5264
|
*
|
|
5265
|
+
* **When to use**
|
|
5266
|
+
*
|
|
5267
|
+
* Use when you already know the array is non-empty and the new last element
|
|
5268
|
+
* depends on the current last element.
|
|
5269
|
+
*
|
|
5204
5270
|
* **Example** (Modifying the last element)
|
|
5205
5271
|
*
|
|
5206
5272
|
* ```ts
|
|
@@ -5220,6 +5286,11 @@ export const modifyLastNonEmpty: {
|
|
|
5220
5286
|
* Applies a function to the last element of a non-empty array, returning a
|
|
5221
5287
|
* new array.
|
|
5222
5288
|
*
|
|
5289
|
+
* **When to use**
|
|
5290
|
+
*
|
|
5291
|
+
* Use when you already know the array is non-empty and the new last element
|
|
5292
|
+
* depends on the current last element.
|
|
5293
|
+
*
|
|
5223
5294
|
* **Example** (Modifying the last element)
|
|
5224
5295
|
*
|
|
5225
5296
|
* ```ts
|
|
@@ -5244,6 +5315,11 @@ export const modifyLastNonEmpty: {
|
|
|
5244
5315
|
/**
|
|
5245
5316
|
* Replaces the last element of a non-empty array with a new value.
|
|
5246
5317
|
*
|
|
5318
|
+
* **When to use**
|
|
5319
|
+
*
|
|
5320
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
5321
|
+
* does not depend on the current last element.
|
|
5322
|
+
*
|
|
5247
5323
|
* **Example** (Setting the last element)
|
|
5248
5324
|
*
|
|
5249
5325
|
* ```ts
|
|
@@ -5262,6 +5338,11 @@ export const setLastNonEmpty: {
|
|
|
5262
5338
|
/**
|
|
5263
5339
|
* Replaces the last element of a non-empty array with a new value.
|
|
5264
5340
|
*
|
|
5341
|
+
* **When to use**
|
|
5342
|
+
*
|
|
5343
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
5344
|
+
* does not depend on the current last element.
|
|
5345
|
+
*
|
|
5265
5346
|
* **Example** (Setting the last element)
|
|
5266
5347
|
*
|
|
5267
5348
|
* ```ts
|
|
@@ -5280,6 +5361,11 @@ export const setLastNonEmpty: {
|
|
|
5280
5361
|
/**
|
|
5281
5362
|
* Replaces the last element of a non-empty array with a new value.
|
|
5282
5363
|
*
|
|
5364
|
+
* **When to use**
|
|
5365
|
+
*
|
|
5366
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
5367
|
+
* does not depend on the current last element.
|
|
5368
|
+
*
|
|
5283
5369
|
* **Example** (Setting the last element)
|
|
5284
5370
|
*
|
|
5285
5371
|
* ```ts
|
|
@@ -5311,9 +5397,9 @@ export const setLastNonEmpty: {
|
|
|
5311
5397
|
*
|
|
5312
5398
|
* **Details**
|
|
5313
5399
|
*
|
|
5314
|
-
*
|
|
5315
|
-
*
|
|
5316
|
-
*
|
|
5400
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
5401
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
5402
|
+
* return a copy.
|
|
5317
5403
|
*
|
|
5318
5404
|
* **Example** (Rotating elements)
|
|
5319
5405
|
*
|
|
@@ -5341,9 +5427,9 @@ export const rotate: {
|
|
|
5341
5427
|
*
|
|
5342
5428
|
* **Details**
|
|
5343
5429
|
*
|
|
5344
|
-
*
|
|
5345
|
-
*
|
|
5346
|
-
*
|
|
5430
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
5431
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
5432
|
+
* return a copy.
|
|
5347
5433
|
*
|
|
5348
5434
|
* **Example** (Rotating elements)
|
|
5349
5435
|
*
|
|
@@ -5371,9 +5457,9 @@ export const rotate: {
|
|
|
5371
5457
|
*
|
|
5372
5458
|
* **Details**
|
|
5373
5459
|
*
|
|
5374
|
-
*
|
|
5375
|
-
*
|
|
5376
|
-
*
|
|
5460
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
5461
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
5462
|
+
* return a copy.
|
|
5377
5463
|
*
|
|
5378
5464
|
* **Example** (Rotating elements)
|
|
5379
5465
|
*
|
|
@@ -5401,9 +5487,9 @@ export const rotate: {
|
|
|
5401
5487
|
*
|
|
5402
5488
|
* **Details**
|
|
5403
5489
|
*
|
|
5404
|
-
*
|
|
5405
|
-
*
|
|
5406
|
-
*
|
|
5490
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
5491
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
5492
|
+
* return a copy.
|
|
5407
5493
|
*
|
|
5408
5494
|
* **Example** (Rotating elements)
|
|
5409
5495
|
*
|
|
@@ -5479,8 +5565,8 @@ export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
|
|
|
5479
5565
|
*
|
|
5480
5566
|
* **When to use**
|
|
5481
5567
|
*
|
|
5482
|
-
* Use to check
|
|
5483
|
-
* comparison function.
|
|
5568
|
+
* Use to check whether an iterable contains a value using Effect's default
|
|
5569
|
+
* equality instead of providing a comparison function.
|
|
5484
5570
|
*
|
|
5485
5571
|
* **Example** (Checking membership)
|
|
5486
5572
|
*
|
|
@@ -5502,8 +5588,8 @@ export const contains: {
|
|
|
5502
5588
|
*
|
|
5503
5589
|
* **When to use**
|
|
5504
5590
|
*
|
|
5505
|
-
* Use to check
|
|
5506
|
-
* comparison function.
|
|
5591
|
+
* Use to check whether an iterable contains a value using Effect's default
|
|
5592
|
+
* equality instead of providing a comparison function.
|
|
5507
5593
|
*
|
|
5508
5594
|
* **Example** (Checking membership)
|
|
5509
5595
|
*
|
|
@@ -5525,8 +5611,8 @@ export const contains: {
|
|
|
5525
5611
|
*
|
|
5526
5612
|
* **When to use**
|
|
5527
5613
|
*
|
|
5528
|
-
* Use to check
|
|
5529
|
-
* comparison function.
|
|
5614
|
+
* Use to check whether an iterable contains a value using Effect's default
|
|
5615
|
+
* equality instead of providing a comparison function.
|
|
5530
5616
|
*
|
|
5531
5617
|
* **Example** (Checking membership)
|
|
5532
5618
|
*
|
|
@@ -5550,15 +5636,13 @@ export const contains: {
|
|
|
5550
5636
|
*
|
|
5551
5637
|
* **When to use**
|
|
5552
5638
|
*
|
|
5553
|
-
* Use when
|
|
5554
|
-
*
|
|
5639
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5640
|
+
* and the remaining input.
|
|
5555
5641
|
*
|
|
5556
5642
|
* **Details**
|
|
5557
5643
|
*
|
|
5558
|
-
*
|
|
5559
|
-
*
|
|
5560
|
-
* - Continues until the remaining array is empty.
|
|
5561
|
-
* - Useful for custom splitting/grouping logic.
|
|
5644
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5645
|
+
* Processing continues until the remaining array is empty.
|
|
5562
5646
|
*
|
|
5563
5647
|
* **Example** (Chopping an array)
|
|
5564
5648
|
*
|
|
@@ -5585,15 +5669,13 @@ export const chop: {
|
|
|
5585
5669
|
*
|
|
5586
5670
|
* **When to use**
|
|
5587
5671
|
*
|
|
5588
|
-
* Use when
|
|
5589
|
-
*
|
|
5672
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5673
|
+
* and the remaining input.
|
|
5590
5674
|
*
|
|
5591
5675
|
* **Details**
|
|
5592
5676
|
*
|
|
5593
|
-
*
|
|
5594
|
-
*
|
|
5595
|
-
* - Continues until the remaining array is empty.
|
|
5596
|
-
* - Useful for custom splitting/grouping logic.
|
|
5677
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5678
|
+
* Processing continues until the remaining array is empty.
|
|
5597
5679
|
*
|
|
5598
5680
|
* **Example** (Chopping an array)
|
|
5599
5681
|
*
|
|
@@ -5622,15 +5704,13 @@ export const chop: {
|
|
|
5622
5704
|
*
|
|
5623
5705
|
* **When to use**
|
|
5624
5706
|
*
|
|
5625
|
-
* Use when
|
|
5626
|
-
*
|
|
5707
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5708
|
+
* and the remaining input.
|
|
5627
5709
|
*
|
|
5628
5710
|
* **Details**
|
|
5629
5711
|
*
|
|
5630
|
-
*
|
|
5631
|
-
*
|
|
5632
|
-
* - Continues until the remaining array is empty.
|
|
5633
|
-
* - Useful for custom splitting/grouping logic.
|
|
5712
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5713
|
+
* Processing continues until the remaining array is empty.
|
|
5634
5714
|
*
|
|
5635
5715
|
* **Example** (Chopping an array)
|
|
5636
5716
|
*
|
|
@@ -5660,15 +5740,13 @@ export const chop: {
|
|
|
5660
5740
|
*
|
|
5661
5741
|
* **When to use**
|
|
5662
5742
|
*
|
|
5663
|
-
* Use when
|
|
5664
|
-
*
|
|
5743
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5744
|
+
* and the remaining input.
|
|
5665
5745
|
*
|
|
5666
5746
|
* **Details**
|
|
5667
5747
|
*
|
|
5668
|
-
*
|
|
5669
|
-
*
|
|
5670
|
-
* - Continues until the remaining array is empty.
|
|
5671
|
-
* - Useful for custom splitting/grouping logic.
|
|
5748
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5749
|
+
* Processing continues until the remaining array is empty.
|
|
5672
5750
|
*
|
|
5673
5751
|
* **Example** (Chopping an array)
|
|
5674
5752
|
*
|
|
@@ -5720,8 +5798,8 @@ export const chop: {
|
|
|
5720
5798
|
*
|
|
5721
5799
|
* **Details**
|
|
5722
5800
|
*
|
|
5723
|
-
*
|
|
5724
|
-
*
|
|
5801
|
+
* `n` can be `0`, in which case all elements are placed in the second array.
|
|
5802
|
+
* The index is floored to an integer.
|
|
5725
5803
|
*
|
|
5726
5804
|
* **Example** (Splitting at an index)
|
|
5727
5805
|
*
|
|
@@ -5747,8 +5825,8 @@ export const splitAt: {
|
|
|
5747
5825
|
*
|
|
5748
5826
|
* **Details**
|
|
5749
5827
|
*
|
|
5750
|
-
*
|
|
5751
|
-
*
|
|
5828
|
+
* `n` can be `0`, in which case all elements are placed in the second array.
|
|
5829
|
+
* The index is floored to an integer.
|
|
5752
5830
|
*
|
|
5753
5831
|
* **Example** (Splitting at an index)
|
|
5754
5832
|
*
|
|
@@ -5774,8 +5852,8 @@ export const splitAt: {
|
|
|
5774
5852
|
*
|
|
5775
5853
|
* **Details**
|
|
5776
5854
|
*
|
|
5777
|
-
*
|
|
5778
|
-
*
|
|
5855
|
+
* `n` can be `0`, in which case all elements are placed in the second array.
|
|
5856
|
+
* The index is floored to an integer.
|
|
5779
5857
|
*
|
|
5780
5858
|
* **Example** (Splitting at an index)
|
|
5781
5859
|
*
|
|
@@ -5808,6 +5886,11 @@ export const splitAt: {
|
|
|
5808
5886
|
* Splits a non-empty array into two parts at the given index. The first part
|
|
5809
5887
|
* is guaranteed to be non-empty (`n` is clamped to >= 1).
|
|
5810
5888
|
*
|
|
5889
|
+
* **When to use**
|
|
5890
|
+
*
|
|
5891
|
+
* Use when downstream code requires the left side of the split to contain at
|
|
5892
|
+
* least one element.
|
|
5893
|
+
*
|
|
5811
5894
|
* **Example** (Splitting a non-empty array)
|
|
5812
5895
|
*
|
|
5813
5896
|
* ```ts
|
|
@@ -5827,6 +5910,11 @@ export const splitAtNonEmpty: {
|
|
|
5827
5910
|
* Splits a non-empty array into two parts at the given index. The first part
|
|
5828
5911
|
* is guaranteed to be non-empty (`n` is clamped to >= 1).
|
|
5829
5912
|
*
|
|
5913
|
+
* **When to use**
|
|
5914
|
+
*
|
|
5915
|
+
* Use when downstream code requires the left side of the split to contain at
|
|
5916
|
+
* least one element.
|
|
5917
|
+
*
|
|
5830
5918
|
* **Example** (Splitting a non-empty array)
|
|
5831
5919
|
*
|
|
5832
5920
|
* ```ts
|
|
@@ -5846,6 +5934,11 @@ export const splitAtNonEmpty: {
|
|
|
5846
5934
|
* Splits a non-empty array into two parts at the given index. The first part
|
|
5847
5935
|
* is guaranteed to be non-empty (`n` is clamped to >= 1).
|
|
5848
5936
|
*
|
|
5937
|
+
* **When to use**
|
|
5938
|
+
*
|
|
5939
|
+
* Use when downstream code requires the left side of the split to contain at
|
|
5940
|
+
* least one element.
|
|
5941
|
+
*
|
|
5849
5942
|
* **Example** (Splitting a non-empty array)
|
|
5850
5943
|
*
|
|
5851
5944
|
* ```ts
|
|
@@ -5877,8 +5970,7 @@ export const splitAtNonEmpty: {
|
|
|
5877
5970
|
*
|
|
5878
5971
|
* **Details**
|
|
5879
5972
|
*
|
|
5880
|
-
*
|
|
5881
|
-
* - The last chunk may be shorter.
|
|
5973
|
+
* Uses `chunksOf(ceil(length / n))` internally. The last chunk may be shorter.
|
|
5882
5974
|
*
|
|
5883
5975
|
* **Example** (Splitting into groups)
|
|
5884
5976
|
*
|
|
@@ -5903,8 +5995,7 @@ export const split: {
|
|
|
5903
5995
|
*
|
|
5904
5996
|
* **Details**
|
|
5905
5997
|
*
|
|
5906
|
-
*
|
|
5907
|
-
* - The last chunk may be shorter.
|
|
5998
|
+
* Uses `chunksOf(ceil(length / n))` internally. The last chunk may be shorter.
|
|
5908
5999
|
*
|
|
5909
6000
|
* **Example** (Splitting into groups)
|
|
5910
6001
|
*
|
|
@@ -5929,8 +6020,7 @@ export const split: {
|
|
|
5929
6020
|
*
|
|
5930
6021
|
* **Details**
|
|
5931
6022
|
*
|
|
5932
|
-
*
|
|
5933
|
-
* - The last chunk may be shorter.
|
|
6023
|
+
* Uses `chunksOf(ceil(length / n))` internally. The last chunk may be shorter.
|
|
5934
6024
|
*
|
|
5935
6025
|
* **Example** (Splitting into groups)
|
|
5936
6026
|
*
|
|
@@ -5957,7 +6047,8 @@ export const split: {
|
|
|
5957
6047
|
*
|
|
5958
6048
|
* **When to use**
|
|
5959
6049
|
*
|
|
5960
|
-
* Use to split an array at
|
|
6050
|
+
* Use when you need to split an array at the first element that marks a
|
|
6051
|
+
* condition boundary.
|
|
5961
6052
|
*
|
|
5962
6053
|
* **Example** (Splitting at a condition)
|
|
5963
6054
|
*
|
|
@@ -5980,7 +6071,8 @@ export const splitWhere: {
|
|
|
5980
6071
|
*
|
|
5981
6072
|
* **When to use**
|
|
5982
6073
|
*
|
|
5983
|
-
* Use to split an array at
|
|
6074
|
+
* Use when you need to split an array at the first element that marks a
|
|
6075
|
+
* condition boundary.
|
|
5984
6076
|
*
|
|
5985
6077
|
* **Example** (Splitting at a condition)
|
|
5986
6078
|
*
|
|
@@ -6003,7 +6095,8 @@ export const splitWhere: {
|
|
|
6003
6095
|
*
|
|
6004
6096
|
* **When to use**
|
|
6005
6097
|
*
|
|
6006
|
-
* Use to split an array at
|
|
6098
|
+
* Use when you need to split an array at the first element that marks a
|
|
6099
|
+
* condition boundary.
|
|
6007
6100
|
*
|
|
6008
6101
|
* **Example** (Splitting at a condition)
|
|
6009
6102
|
*
|
|
@@ -6036,8 +6129,8 @@ export const splitWhere: {
|
|
|
6036
6129
|
*
|
|
6037
6130
|
* **Details**
|
|
6038
6131
|
*
|
|
6039
|
-
*
|
|
6040
|
-
*
|
|
6132
|
+
* The return type preserves `NonEmptyArray`. Use this when you need a distinct
|
|
6133
|
+
* reference, for example before mutating the returned array.
|
|
6041
6134
|
*
|
|
6042
6135
|
* **Example** (Copying an array)
|
|
6043
6136
|
*
|
|
@@ -6066,8 +6159,8 @@ export const copy: {
|
|
|
6066
6159
|
*
|
|
6067
6160
|
* **Details**
|
|
6068
6161
|
*
|
|
6069
|
-
*
|
|
6070
|
-
*
|
|
6162
|
+
* The return type preserves `NonEmptyArray`. Use this when you need a distinct
|
|
6163
|
+
* reference, for example before mutating the returned array.
|
|
6071
6164
|
*
|
|
6072
6165
|
* **Example** (Copying an array)
|
|
6073
6166
|
*
|
|
@@ -6096,8 +6189,8 @@ export const copy: {
|
|
|
6096
6189
|
*
|
|
6097
6190
|
* **Details**
|
|
6098
6191
|
*
|
|
6099
|
-
*
|
|
6100
|
-
*
|
|
6192
|
+
* The return type preserves `NonEmptyArray`. Use this when you need a distinct
|
|
6193
|
+
* reference, for example before mutating the returned array.
|
|
6101
6194
|
*
|
|
6102
6195
|
* **Example** (Copying an array)
|
|
6103
6196
|
*
|
|
@@ -6128,7 +6221,7 @@ export const copy: {
|
|
|
6128
6221
|
*
|
|
6129
6222
|
* **Details**
|
|
6130
6223
|
*
|
|
6131
|
-
*
|
|
6224
|
+
* Returns an empty array when `n <= 0`.
|
|
6132
6225
|
*
|
|
6133
6226
|
* **Example** (Padding an array)
|
|
6134
6227
|
*
|
|
@@ -6155,7 +6248,7 @@ export const pad: {
|
|
|
6155
6248
|
*
|
|
6156
6249
|
* **Details**
|
|
6157
6250
|
*
|
|
6158
|
-
*
|
|
6251
|
+
* Returns an empty array when `n <= 0`.
|
|
6159
6252
|
*
|
|
6160
6253
|
* **Example** (Padding an array)
|
|
6161
6254
|
*
|
|
@@ -6184,7 +6277,7 @@ export const pad: {
|
|
|
6184
6277
|
*
|
|
6185
6278
|
* **Details**
|
|
6186
6279
|
*
|
|
6187
|
-
*
|
|
6280
|
+
* Returns an empty array when `n <= 0`.
|
|
6188
6281
|
*
|
|
6189
6282
|
* **Example** (Padding an array)
|
|
6190
6283
|
*
|
|
@@ -6217,14 +6310,13 @@ export const pad: {
|
|
|
6217
6310
|
*
|
|
6218
6311
|
* **When to use**
|
|
6219
6312
|
*
|
|
6220
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
6221
|
-
* size.
|
|
6313
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
6314
|
+
* maximum chunk size.
|
|
6222
6315
|
*
|
|
6223
6316
|
* **Details**
|
|
6224
6317
|
*
|
|
6225
|
-
*
|
|
6226
|
-
*
|
|
6227
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
6318
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
6319
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
6228
6320
|
*
|
|
6229
6321
|
* **Example** (Chunking an array)
|
|
6230
6322
|
*
|
|
@@ -6247,14 +6339,13 @@ export const chunksOf: {
|
|
|
6247
6339
|
*
|
|
6248
6340
|
* **When to use**
|
|
6249
6341
|
*
|
|
6250
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
6251
|
-
* size.
|
|
6342
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
6343
|
+
* maximum chunk size.
|
|
6252
6344
|
*
|
|
6253
6345
|
* **Details**
|
|
6254
6346
|
*
|
|
6255
|
-
*
|
|
6256
|
-
*
|
|
6257
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
6347
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
6348
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
6258
6349
|
*
|
|
6259
6350
|
* **Example** (Chunking an array)
|
|
6260
6351
|
*
|
|
@@ -6279,14 +6370,13 @@ export const chunksOf: {
|
|
|
6279
6370
|
*
|
|
6280
6371
|
* **When to use**
|
|
6281
6372
|
*
|
|
6282
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
6283
|
-
* size.
|
|
6373
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
6374
|
+
* maximum chunk size.
|
|
6284
6375
|
*
|
|
6285
6376
|
* **Details**
|
|
6286
6377
|
*
|
|
6287
|
-
*
|
|
6288
|
-
*
|
|
6289
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
6378
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
6379
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
6290
6380
|
*
|
|
6291
6381
|
* **Example** (Chunking an array)
|
|
6292
6382
|
*
|
|
@@ -6309,14 +6399,13 @@ export const chunksOf: {
|
|
|
6309
6399
|
*
|
|
6310
6400
|
* **When to use**
|
|
6311
6401
|
*
|
|
6312
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
6313
|
-
* size.
|
|
6402
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
6403
|
+
* maximum chunk size.
|
|
6314
6404
|
*
|
|
6315
6405
|
* **Details**
|
|
6316
6406
|
*
|
|
6317
|
-
*
|
|
6318
|
-
*
|
|
6319
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
6407
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
6408
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
6320
6409
|
*
|
|
6321
6410
|
* **Example** (Chunking an array)
|
|
6322
6411
|
*
|
|
@@ -6350,8 +6439,8 @@ export const chunksOf: {
|
|
|
6350
6439
|
*
|
|
6351
6440
|
* **Details**
|
|
6352
6441
|
*
|
|
6353
|
-
*
|
|
6354
|
-
*
|
|
6442
|
+
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
6443
|
+
* Each window is a tuple of exactly `n` elements.
|
|
6355
6444
|
*
|
|
6356
6445
|
* **Example** (Sliding windows)
|
|
6357
6446
|
*
|
|
@@ -6377,8 +6466,8 @@ export const window: {
|
|
|
6377
6466
|
*
|
|
6378
6467
|
* **Details**
|
|
6379
6468
|
*
|
|
6380
|
-
*
|
|
6381
|
-
*
|
|
6469
|
+
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
6470
|
+
* Each window is a tuple of exactly `n` elements.
|
|
6382
6471
|
*
|
|
6383
6472
|
* **Example** (Sliding windows)
|
|
6384
6473
|
*
|
|
@@ -6404,8 +6493,8 @@ export const window: {
|
|
|
6404
6493
|
*
|
|
6405
6494
|
* **Details**
|
|
6406
6495
|
*
|
|
6407
|
-
*
|
|
6408
|
-
*
|
|
6496
|
+
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
6497
|
+
* Each window is a tuple of exactly `n` elements.
|
|
6409
6498
|
*
|
|
6410
6499
|
* **Example** (Sliding windows)
|
|
6411
6500
|
*
|
|
@@ -6438,13 +6527,13 @@ export const window: {
|
|
|
6438
6527
|
*
|
|
6439
6528
|
* **When to use**
|
|
6440
6529
|
*
|
|
6441
|
-
* Use when a non-empty array
|
|
6442
|
-
* adjacent and
|
|
6530
|
+
* Use when you already have a non-empty array arranged so matching elements are
|
|
6531
|
+
* adjacent and need a custom equivalence function.
|
|
6443
6532
|
*
|
|
6444
6533
|
* **Details**
|
|
6445
6534
|
*
|
|
6446
|
-
*
|
|
6447
|
-
*
|
|
6535
|
+
* Only adjacent elements are grouped. Non-adjacent duplicates stay separate.
|
|
6536
|
+
* Requires a `NonEmptyReadonlyArray`.
|
|
6448
6537
|
*
|
|
6449
6538
|
* **Example** (Grouping consecutive equal elements)
|
|
6450
6539
|
*
|
|
@@ -6467,13 +6556,13 @@ export const groupWith: {
|
|
|
6467
6556
|
*
|
|
6468
6557
|
* **When to use**
|
|
6469
6558
|
*
|
|
6470
|
-
* Use when a non-empty array
|
|
6471
|
-
* adjacent and
|
|
6559
|
+
* Use when you already have a non-empty array arranged so matching elements are
|
|
6560
|
+
* adjacent and need a custom equivalence function.
|
|
6472
6561
|
*
|
|
6473
6562
|
* **Details**
|
|
6474
6563
|
*
|
|
6475
|
-
*
|
|
6476
|
-
*
|
|
6564
|
+
* Only adjacent elements are grouped. Non-adjacent duplicates stay separate.
|
|
6565
|
+
* Requires a `NonEmptyReadonlyArray`.
|
|
6477
6566
|
*
|
|
6478
6567
|
* **Example** (Grouping consecutive equal elements)
|
|
6479
6568
|
*
|
|
@@ -6496,13 +6585,13 @@ export const groupWith: {
|
|
|
6496
6585
|
*
|
|
6497
6586
|
* **When to use**
|
|
6498
6587
|
*
|
|
6499
|
-
* Use when a non-empty array
|
|
6500
|
-
* adjacent and
|
|
6588
|
+
* Use when you already have a non-empty array arranged so matching elements are
|
|
6589
|
+
* adjacent and need a custom equivalence function.
|
|
6501
6590
|
*
|
|
6502
6591
|
* **Details**
|
|
6503
6592
|
*
|
|
6504
|
-
*
|
|
6505
|
-
*
|
|
6593
|
+
* Only adjacent elements are grouped. Non-adjacent duplicates stay separate.
|
|
6594
|
+
* Requires a `NonEmptyReadonlyArray`.
|
|
6506
6595
|
*
|
|
6507
6596
|
* **Example** (Grouping consecutive equal elements)
|
|
6508
6597
|
*
|
|
@@ -6547,12 +6636,12 @@ export const groupWith: {
|
|
|
6547
6636
|
*
|
|
6548
6637
|
* **When to use**
|
|
6549
6638
|
*
|
|
6550
|
-
* Use when
|
|
6551
|
-
* the right comparison.
|
|
6639
|
+
* Use when you already have adjacent equal values and Effect's default equality
|
|
6640
|
+
* is the right comparison.
|
|
6552
6641
|
*
|
|
6553
6642
|
* **Details**
|
|
6554
6643
|
*
|
|
6555
|
-
*
|
|
6644
|
+
* Only adjacent elements are grouped.
|
|
6556
6645
|
*
|
|
6557
6646
|
* **Example** (Grouping adjacent equal elements)
|
|
6558
6647
|
*
|
|
@@ -6582,9 +6671,8 @@ export const group: <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyArray<NonEmpt
|
|
|
6582
6671
|
*
|
|
6583
6672
|
* **Details**
|
|
6584
6673
|
*
|
|
6585
|
-
*
|
|
6586
|
-
*
|
|
6587
|
-
* - Key function must return a `string` or `symbol`.
|
|
6674
|
+
* Unlike `group` and `groupWith`, elements do not need to be adjacent to be
|
|
6675
|
+
* grouped together. The key function must return a `string` or `symbol`.
|
|
6588
6676
|
*
|
|
6589
6677
|
* **Example** (Grouping by a property)
|
|
6590
6678
|
*
|
|
@@ -6619,9 +6707,8 @@ export const groupBy: {
|
|
|
6619
6707
|
*
|
|
6620
6708
|
* **Details**
|
|
6621
6709
|
*
|
|
6622
|
-
*
|
|
6623
|
-
*
|
|
6624
|
-
* - Key function must return a `string` or `symbol`.
|
|
6710
|
+
* Unlike `group` and `groupWith`, elements do not need to be adjacent to be
|
|
6711
|
+
* grouped together. The key function must return a `string` or `symbol`.
|
|
6625
6712
|
*
|
|
6626
6713
|
* **Example** (Grouping by a property)
|
|
6627
6714
|
*
|
|
@@ -6656,9 +6743,8 @@ export const groupBy: {
|
|
|
6656
6743
|
*
|
|
6657
6744
|
* **Details**
|
|
6658
6745
|
*
|
|
6659
|
-
*
|
|
6660
|
-
*
|
|
6661
|
-
* - Key function must return a `string` or `symbol`.
|
|
6746
|
+
* Unlike `group` and `groupWith`, elements do not need to be adjacent to be
|
|
6747
|
+
* grouped together. The key function must return a `string` or `symbol`.
|
|
6662
6748
|
*
|
|
6663
6749
|
* **Example** (Grouping by a property)
|
|
6664
6750
|
*
|
|
@@ -6984,8 +7070,8 @@ export const union: {
|
|
|
6984
7070
|
*
|
|
6985
7071
|
* **When to use**
|
|
6986
7072
|
*
|
|
6987
|
-
* Use when
|
|
6988
|
-
* defined by a custom comparator, such as matching objects by id.
|
|
7073
|
+
* Use when you need to keep only values present in both arrays and equality
|
|
7074
|
+
* must be defined by a custom comparator, such as matching objects by id.
|
|
6989
7075
|
*
|
|
6990
7076
|
* **Example** (Intersection with custom equality)
|
|
6991
7077
|
*
|
|
@@ -7023,6 +7109,11 @@ export const intersectionWith = <A>(isEquivalent: (self: A, that: A) => boolean)
|
|
|
7023
7109
|
* Computes the intersection of two arrays using `Equal.equivalence()`. Order is
|
|
7024
7110
|
* determined by the first array.
|
|
7025
7111
|
*
|
|
7112
|
+
* **When to use**
|
|
7113
|
+
*
|
|
7114
|
+
* Use when Effect equality is the right membership test and you want to keep
|
|
7115
|
+
* values present in both inputs while preserving the first input's order.
|
|
7116
|
+
*
|
|
7026
7117
|
* **Example** (Array intersection)
|
|
7027
7118
|
*
|
|
7028
7119
|
* ```ts
|
|
@@ -7043,6 +7134,11 @@ export const intersection: {
|
|
|
7043
7134
|
* Computes the intersection of two arrays using `Equal.equivalence()`. Order is
|
|
7044
7135
|
* determined by the first array.
|
|
7045
7136
|
*
|
|
7137
|
+
* **When to use**
|
|
7138
|
+
*
|
|
7139
|
+
* Use when Effect equality is the right membership test and you want to keep
|
|
7140
|
+
* values present in both inputs while preserving the first input's order.
|
|
7141
|
+
*
|
|
7046
7142
|
* **Example** (Array intersection)
|
|
7047
7143
|
*
|
|
7048
7144
|
* ```ts
|
|
@@ -7063,6 +7159,11 @@ export const intersection: {
|
|
|
7063
7159
|
* Computes the intersection of two arrays using `Equal.equivalence()`. Order is
|
|
7064
7160
|
* determined by the first array.
|
|
7065
7161
|
*
|
|
7162
|
+
* **When to use**
|
|
7163
|
+
*
|
|
7164
|
+
* Use when Effect equality is the right membership test and you want to keep
|
|
7165
|
+
* values present in both inputs while preserving the first input's order.
|
|
7166
|
+
*
|
|
7066
7167
|
* **Example** (Array intersection)
|
|
7067
7168
|
*
|
|
7068
7169
|
* ```ts
|
|
@@ -7087,8 +7188,8 @@ export const intersection: {
|
|
|
7087
7188
|
*
|
|
7088
7189
|
* **When to use**
|
|
7089
7190
|
*
|
|
7090
|
-
* Use when
|
|
7091
|
-
* defined by a custom comparator, such as matching objects by id.
|
|
7191
|
+
* Use when you need to keep only values from the first array and equality must
|
|
7192
|
+
* be defined by a custom comparator, such as matching objects by id.
|
|
7092
7193
|
*
|
|
7093
7194
|
* **Example** (Difference with custom equality)
|
|
7094
7195
|
*
|
|
@@ -7368,8 +7469,8 @@ export declare namespace ReadonlyArray {
|
|
|
7368
7469
|
*
|
|
7369
7470
|
* **Details**
|
|
7370
7471
|
*
|
|
7371
|
-
*
|
|
7372
|
-
*
|
|
7472
|
+
* The function receives `(element, index)`. The return type preserves
|
|
7473
|
+
* `NonEmptyArray`.
|
|
7373
7474
|
*
|
|
7374
7475
|
* **Example** (Doubling values)
|
|
7375
7476
|
*
|
|
@@ -7394,8 +7495,8 @@ export const map: {
|
|
|
7394
7495
|
*
|
|
7395
7496
|
* **Details**
|
|
7396
7497
|
*
|
|
7397
|
-
*
|
|
7398
|
-
*
|
|
7498
|
+
* The function receives `(element, index)`. The return type preserves
|
|
7499
|
+
* `NonEmptyArray`.
|
|
7399
7500
|
*
|
|
7400
7501
|
* **Example** (Doubling values)
|
|
7401
7502
|
*
|
|
@@ -7420,8 +7521,8 @@ export const map: {
|
|
|
7420
7521
|
*
|
|
7421
7522
|
* **Details**
|
|
7422
7523
|
*
|
|
7423
|
-
*
|
|
7424
|
-
*
|
|
7524
|
+
* The function receives `(element, index)`. The return type preserves
|
|
7525
|
+
* `NonEmptyArray`.
|
|
7425
7526
|
*
|
|
7426
7527
|
* **Example** (Doubling values)
|
|
7427
7528
|
*
|
|
@@ -7444,13 +7545,13 @@ export const map: {
|
|
|
7444
7545
|
*
|
|
7445
7546
|
* **When to use**
|
|
7446
7547
|
*
|
|
7447
|
-
* Use to map each element to zero or more values and concatenate the
|
|
7448
|
-
* one pass.
|
|
7548
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
7549
|
+
* results in one pass.
|
|
7449
7550
|
*
|
|
7450
7551
|
* **Details**
|
|
7451
7552
|
*
|
|
7452
|
-
*
|
|
7453
|
-
*
|
|
7553
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
7554
|
+
* both the input and mapped arrays are non-empty.
|
|
7454
7555
|
*
|
|
7455
7556
|
* **Example** (FlatMapping an array)
|
|
7456
7557
|
*
|
|
@@ -7472,13 +7573,13 @@ export const flatMap: {
|
|
|
7472
7573
|
*
|
|
7473
7574
|
* **When to use**
|
|
7474
7575
|
*
|
|
7475
|
-
* Use to map each element to zero or more values and concatenate the
|
|
7476
|
-
* one pass.
|
|
7576
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
7577
|
+
* results in one pass.
|
|
7477
7578
|
*
|
|
7478
7579
|
* **Details**
|
|
7479
7580
|
*
|
|
7480
|
-
*
|
|
7481
|
-
*
|
|
7581
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
7582
|
+
* both the input and mapped arrays are non-empty.
|
|
7482
7583
|
*
|
|
7483
7584
|
* **Example** (FlatMapping an array)
|
|
7484
7585
|
*
|
|
@@ -7500,13 +7601,13 @@ export const flatMap: {
|
|
|
7500
7601
|
*
|
|
7501
7602
|
* **When to use**
|
|
7502
7603
|
*
|
|
7503
|
-
* Use to map each element to zero or more values and concatenate the
|
|
7504
|
-
* one pass.
|
|
7604
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
7605
|
+
* results in one pass.
|
|
7505
7606
|
*
|
|
7506
7607
|
* **Details**
|
|
7507
7608
|
*
|
|
7508
|
-
*
|
|
7509
|
-
*
|
|
7609
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
7610
|
+
* both the input and mapped arrays are non-empty.
|
|
7510
7611
|
*
|
|
7511
7612
|
* **Example** (FlatMapping an array)
|
|
7512
7613
|
*
|
|
@@ -7531,13 +7632,13 @@ export const flatMap: {
|
|
|
7531
7632
|
*
|
|
7532
7633
|
* **When to use**
|
|
7533
7634
|
*
|
|
7534
|
-
* Use to map each element to zero or more values and concatenate the
|
|
7535
|
-
* one pass.
|
|
7635
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
7636
|
+
* results in one pass.
|
|
7536
7637
|
*
|
|
7537
7638
|
* **Details**
|
|
7538
7639
|
*
|
|
7539
|
-
*
|
|
7540
|
-
*
|
|
7640
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
7641
|
+
* both the input and mapped arrays are non-empty.
|
|
7541
7642
|
*
|
|
7542
7643
|
* **Example** (FlatMapping an array)
|
|
7543
7644
|
*
|
|
@@ -7600,8 +7701,8 @@ export const flatten: <const S extends ReadonlyArray<ReadonlyArray<any>>>(self:
|
|
|
7600
7701
|
*
|
|
7601
7702
|
* **When to use**
|
|
7602
7703
|
*
|
|
7603
|
-
* Use to collect only present values from `Option` values while
|
|
7604
|
-
* `None` values.
|
|
7704
|
+
* Use to collect only present values from an iterable of `Option` values while
|
|
7705
|
+
* discarding `None` values.
|
|
7605
7706
|
*
|
|
7606
7707
|
* **Example** (Extracting Some values)
|
|
7607
7708
|
*
|
|
@@ -7636,8 +7737,8 @@ export const getSomes: <T extends Iterable<Option.Option<X>>, X = any>(
|
|
|
7636
7737
|
*
|
|
7637
7738
|
* **When to use**
|
|
7638
7739
|
*
|
|
7639
|
-
* Use
|
|
7640
|
-
*
|
|
7740
|
+
* Use when you can drop the success channel and only need the failure
|
|
7741
|
+
* payloads, not the original result wrappers.
|
|
7641
7742
|
*
|
|
7642
7743
|
* **Example** (Extracting failures)
|
|
7643
7744
|
*
|
|
@@ -7673,8 +7774,8 @@ export const getFailures = <T extends Iterable<Result.Result<any, any>>>(
|
|
|
7673
7774
|
*
|
|
7674
7775
|
* **When to use**
|
|
7675
7776
|
*
|
|
7676
|
-
* Use
|
|
7677
|
-
*
|
|
7777
|
+
* Use when you can drop the failure channel and only need the success
|
|
7778
|
+
* payloads, not the original result wrappers.
|
|
7678
7779
|
*
|
|
7679
7780
|
* **Example** (Extracting successes)
|
|
7680
7781
|
*
|
|
@@ -7709,13 +7810,12 @@ export const getSuccesses = <T extends Iterable<Result.Result<any, any>>>(
|
|
|
7709
7810
|
*
|
|
7710
7811
|
* **When to use**
|
|
7711
7812
|
*
|
|
7712
|
-
* Use to
|
|
7713
|
-
* failures.
|
|
7813
|
+
* Use to filter an iterable with a `Result`-returning transformation while
|
|
7814
|
+
* discarding failures.
|
|
7714
7815
|
*
|
|
7715
7816
|
* **Details**
|
|
7716
7817
|
*
|
|
7717
|
-
*
|
|
7718
|
-
* - Failures are discarded.
|
|
7818
|
+
* The filter receives `(element, index)`. Failures are discarded.
|
|
7719
7819
|
*
|
|
7720
7820
|
* **Example** (Filter and transform)
|
|
7721
7821
|
*
|
|
@@ -7738,13 +7838,12 @@ export const filterMap: {
|
|
|
7738
7838
|
*
|
|
7739
7839
|
* **When to use**
|
|
7740
7840
|
*
|
|
7741
|
-
* Use to
|
|
7742
|
-
* failures.
|
|
7841
|
+
* Use to filter an iterable with a `Result`-returning transformation while
|
|
7842
|
+
* discarding failures.
|
|
7743
7843
|
*
|
|
7744
7844
|
* **Details**
|
|
7745
7845
|
*
|
|
7746
|
-
*
|
|
7747
|
-
* - Failures are discarded.
|
|
7846
|
+
* The filter receives `(element, index)`. Failures are discarded.
|
|
7748
7847
|
*
|
|
7749
7848
|
* **Example** (Filter and transform)
|
|
7750
7849
|
*
|
|
@@ -7767,13 +7866,12 @@ export const filterMap: {
|
|
|
7767
7866
|
*
|
|
7768
7867
|
* **When to use**
|
|
7769
7868
|
*
|
|
7770
|
-
* Use to
|
|
7771
|
-
* failures.
|
|
7869
|
+
* Use to filter an iterable with a `Result`-returning transformation while
|
|
7870
|
+
* discarding failures.
|
|
7772
7871
|
*
|
|
7773
7872
|
* **Details**
|
|
7774
7873
|
*
|
|
7775
|
-
*
|
|
7776
|
-
* - Failures are discarded.
|
|
7874
|
+
* The filter receives `(element, index)`. Failures are discarded.
|
|
7777
7875
|
*
|
|
7778
7876
|
* **Example** (Filter and transform)
|
|
7779
7877
|
*
|
|
@@ -7808,12 +7906,13 @@ export const filterMap: {
|
|
|
7808
7906
|
*
|
|
7809
7907
|
* **When to use**
|
|
7810
7908
|
*
|
|
7811
|
-
* Use to
|
|
7909
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7910
|
+
* a boolean predicate or refinement.
|
|
7812
7911
|
*
|
|
7813
7912
|
* **Details**
|
|
7814
7913
|
*
|
|
7815
|
-
*
|
|
7816
|
-
*
|
|
7914
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7915
|
+
* narrowing.
|
|
7817
7916
|
*
|
|
7818
7917
|
* **Example** (Filtering even numbers)
|
|
7819
7918
|
*
|
|
@@ -7835,12 +7934,13 @@ export const filter: {
|
|
|
7835
7934
|
*
|
|
7836
7935
|
* **When to use**
|
|
7837
7936
|
*
|
|
7838
|
-
* Use to
|
|
7937
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7938
|
+
* a boolean predicate or refinement.
|
|
7839
7939
|
*
|
|
7840
7940
|
* **Details**
|
|
7841
7941
|
*
|
|
7842
|
-
*
|
|
7843
|
-
*
|
|
7942
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7943
|
+
* narrowing.
|
|
7844
7944
|
*
|
|
7845
7945
|
* **Example** (Filtering even numbers)
|
|
7846
7946
|
*
|
|
@@ -7862,12 +7962,13 @@ export const filter: {
|
|
|
7862
7962
|
*
|
|
7863
7963
|
* **When to use**
|
|
7864
7964
|
*
|
|
7865
|
-
* Use to
|
|
7965
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7966
|
+
* a boolean predicate or refinement.
|
|
7866
7967
|
*
|
|
7867
7968
|
* **Details**
|
|
7868
7969
|
*
|
|
7869
|
-
*
|
|
7870
|
-
*
|
|
7970
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7971
|
+
* narrowing.
|
|
7871
7972
|
*
|
|
7872
7973
|
* **Example** (Filtering even numbers)
|
|
7873
7974
|
*
|
|
@@ -7889,12 +7990,13 @@ export const filter: {
|
|
|
7889
7990
|
*
|
|
7890
7991
|
* **When to use**
|
|
7891
7992
|
*
|
|
7892
|
-
* Use to
|
|
7993
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7994
|
+
* a boolean predicate or refinement.
|
|
7893
7995
|
*
|
|
7894
7996
|
* **Details**
|
|
7895
7997
|
*
|
|
7896
|
-
*
|
|
7897
|
-
*
|
|
7998
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7999
|
+
* narrowing.
|
|
7898
8000
|
*
|
|
7899
8001
|
* **Example** (Filtering even numbers)
|
|
7900
8002
|
*
|
|
@@ -7916,12 +8018,13 @@ export const filter: {
|
|
|
7916
8018
|
*
|
|
7917
8019
|
* **When to use**
|
|
7918
8020
|
*
|
|
7919
|
-
* Use to
|
|
8021
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
8022
|
+
* a boolean predicate or refinement.
|
|
7920
8023
|
*
|
|
7921
8024
|
* **Details**
|
|
7922
8025
|
*
|
|
7923
|
-
*
|
|
7924
|
-
*
|
|
8026
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
8027
|
+
* narrowing.
|
|
7925
8028
|
*
|
|
7926
8029
|
* **Example** (Filtering even numbers)
|
|
7927
8030
|
*
|
|
@@ -7957,13 +8060,12 @@ export const filter: {
|
|
|
7957
8060
|
*
|
|
7958
8061
|
* **When to use**
|
|
7959
8062
|
*
|
|
7960
|
-
* Use to
|
|
7961
|
-
* failure and success values.
|
|
8063
|
+
* Use to partition an iterable by evaluating each element with a
|
|
8064
|
+
* `Result`-returning filter and keeping both failure and success values.
|
|
7962
8065
|
*
|
|
7963
8066
|
* **Details**
|
|
7964
8067
|
*
|
|
7965
|
-
*
|
|
7966
|
-
* - The filter receives `(element, index)`.
|
|
8068
|
+
* Returns `[excluded, satisfying]`. The filter receives `(element, index)`.
|
|
7967
8069
|
*
|
|
7968
8070
|
* **Example** (Partitioning with a filter)
|
|
7969
8071
|
*
|
|
@@ -7989,13 +8091,12 @@ export const partition: {
|
|
|
7989
8091
|
*
|
|
7990
8092
|
* **When to use**
|
|
7991
8093
|
*
|
|
7992
|
-
* Use to
|
|
7993
|
-
* failure and success values.
|
|
8094
|
+
* Use to partition an iterable by evaluating each element with a
|
|
8095
|
+
* `Result`-returning filter and keeping both failure and success values.
|
|
7994
8096
|
*
|
|
7995
8097
|
* **Details**
|
|
7996
8098
|
*
|
|
7997
|
-
*
|
|
7998
|
-
* - The filter receives `(element, index)`.
|
|
8099
|
+
* Returns `[excluded, satisfying]`. The filter receives `(element, index)`.
|
|
7999
8100
|
*
|
|
8000
8101
|
* **Example** (Partitioning with a filter)
|
|
8001
8102
|
*
|
|
@@ -8021,13 +8122,12 @@ export const partition: {
|
|
|
8021
8122
|
*
|
|
8022
8123
|
* **When to use**
|
|
8023
8124
|
*
|
|
8024
|
-
* Use to
|
|
8025
|
-
* failure and success values.
|
|
8125
|
+
* Use to partition an iterable by evaluating each element with a
|
|
8126
|
+
* `Result`-returning filter and keeping both failure and success values.
|
|
8026
8127
|
*
|
|
8027
8128
|
* **Details**
|
|
8028
8129
|
*
|
|
8029
|
-
*
|
|
8030
|
-
* - The filter receives `(element, index)`.
|
|
8130
|
+
* Returns `[excluded, satisfying]`. The filter receives `(element, index)`.
|
|
8031
8131
|
*
|
|
8032
8132
|
* **Example** (Partitioning with a filter)
|
|
8033
8133
|
*
|
|
@@ -8074,12 +8174,12 @@ export const partition: {
|
|
|
8074
8174
|
*
|
|
8075
8175
|
* **When to use**
|
|
8076
8176
|
*
|
|
8077
|
-
* Use to split
|
|
8177
|
+
* Use to split an iterable of `Result` values into failure and success arrays.
|
|
8078
8178
|
*
|
|
8079
8179
|
* **Details**
|
|
8080
8180
|
*
|
|
8081
|
-
*
|
|
8082
|
-
*
|
|
8181
|
+
* Returns `[failures, successes]`. This is equivalent to
|
|
8182
|
+
* `partition(identity)`.
|
|
8083
8183
|
*
|
|
8084
8184
|
* **Example** (Separating Results)
|
|
8085
8185
|
*
|
|
@@ -8116,7 +8216,7 @@ export const separate: <T extends Iterable<Result.Result<any, any>>>(
|
|
|
8116
8216
|
*
|
|
8117
8217
|
* **Details**
|
|
8118
8218
|
*
|
|
8119
|
-
*
|
|
8219
|
+
* The function receives `(accumulator, element, index)`.
|
|
8120
8220
|
*
|
|
8121
8221
|
* **Example** (Summing an array)
|
|
8122
8222
|
*
|
|
@@ -8142,7 +8242,7 @@ export const reduce: {
|
|
|
8142
8242
|
*
|
|
8143
8243
|
* **Details**
|
|
8144
8244
|
*
|
|
8145
|
-
*
|
|
8245
|
+
* The function receives `(accumulator, element, index)`.
|
|
8146
8246
|
*
|
|
8147
8247
|
* **Example** (Summing an array)
|
|
8148
8248
|
*
|
|
@@ -8168,7 +8268,7 @@ export const reduce: {
|
|
|
8168
8268
|
*
|
|
8169
8269
|
* **Details**
|
|
8170
8270
|
*
|
|
8171
|
-
*
|
|
8271
|
+
* The function receives `(accumulator, element, index)`.
|
|
8172
8272
|
*
|
|
8173
8273
|
* **Example** (Summing an array)
|
|
8174
8274
|
*
|
|
@@ -8196,12 +8296,11 @@ export const reduce: {
|
|
|
8196
8296
|
*
|
|
8197
8297
|
* **When to use**
|
|
8198
8298
|
*
|
|
8199
|
-
* Use when
|
|
8200
|
-
* left.
|
|
8299
|
+
* Use when you need to fold values from right to left.
|
|
8201
8300
|
*
|
|
8202
8301
|
* **Details**
|
|
8203
8302
|
*
|
|
8204
|
-
*
|
|
8303
|
+
* The function receives `(accumulator, element, index)`.
|
|
8205
8304
|
*
|
|
8206
8305
|
* **Example** (Right-to-left fold)
|
|
8207
8306
|
*
|
|
@@ -8223,12 +8322,11 @@ export const reduceRight: {
|
|
|
8223
8322
|
*
|
|
8224
8323
|
* **When to use**
|
|
8225
8324
|
*
|
|
8226
|
-
* Use when
|
|
8227
|
-
* left.
|
|
8325
|
+
* Use when you need to fold values from right to left.
|
|
8228
8326
|
*
|
|
8229
8327
|
* **Details**
|
|
8230
8328
|
*
|
|
8231
|
-
*
|
|
8329
|
+
* The function receives `(accumulator, element, index)`.
|
|
8232
8330
|
*
|
|
8233
8331
|
* **Example** (Right-to-left fold)
|
|
8234
8332
|
*
|
|
@@ -8250,12 +8348,11 @@ export const reduceRight: {
|
|
|
8250
8348
|
*
|
|
8251
8349
|
* **When to use**
|
|
8252
8350
|
*
|
|
8253
|
-
* Use when
|
|
8254
|
-
* left.
|
|
8351
|
+
* Use when you need to fold values from right to left.
|
|
8255
8352
|
*
|
|
8256
8353
|
* **Details**
|
|
8257
8354
|
*
|
|
8258
|
-
*
|
|
8355
|
+
* The function receives `(accumulator, element, index)`.
|
|
8259
8356
|
*
|
|
8260
8357
|
* **Example** (Right-to-left fold)
|
|
8261
8358
|
*
|
|
@@ -8327,6 +8424,11 @@ export const liftPredicate: { // Note: I intentionally avoid using the NoInfer p
|
|
|
8327
8424
|
* Lifts an `Option`-returning function into one that returns an array:
|
|
8328
8425
|
* `Some(a)` becomes `[a]`, `None` becomes `[]`.
|
|
8329
8426
|
*
|
|
8427
|
+
* **When to use**
|
|
8428
|
+
*
|
|
8429
|
+
* Use when an optional parser or lookup should participate in array pipelines
|
|
8430
|
+
* as zero-or-one results.
|
|
8431
|
+
*
|
|
8330
8432
|
* **Example** (Lifting an Option function)
|
|
8331
8433
|
*
|
|
8332
8434
|
* ```ts
|
|
@@ -8411,7 +8513,7 @@ export const liftNullishOr = <A extends Array<unknown>, B>(
|
|
|
8411
8513
|
*
|
|
8412
8514
|
* **When to use**
|
|
8413
8515
|
*
|
|
8414
|
-
* Use when
|
|
8516
|
+
* Use when you need to map and filter in one step, where the mapper can return
|
|
8415
8517
|
* `null` or `undefined` to skip elements.
|
|
8416
8518
|
*
|
|
8417
8519
|
* **Example** (FlatMapping with nullable)
|
|
@@ -8436,7 +8538,7 @@ export const flatMapNullishOr: {
|
|
|
8436
8538
|
*
|
|
8437
8539
|
* **When to use**
|
|
8438
8540
|
*
|
|
8439
|
-
* Use when
|
|
8541
|
+
* Use when you need to map and filter in one step, where the mapper can return
|
|
8440
8542
|
* `null` or `undefined` to skip elements.
|
|
8441
8543
|
*
|
|
8442
8544
|
* **Example** (FlatMapping with nullable)
|
|
@@ -8461,7 +8563,7 @@ export const flatMapNullishOr: {
|
|
|
8461
8563
|
*
|
|
8462
8564
|
* **When to use**
|
|
8463
8565
|
*
|
|
8464
|
-
* Use when
|
|
8566
|
+
* Use when you need to map and filter in one step, where the mapper can return
|
|
8465
8567
|
* `null` or `undefined` to skip elements.
|
|
8466
8568
|
*
|
|
8467
8569
|
* **Example** (FlatMapping with nullable)
|
|
@@ -8489,6 +8591,11 @@ export const flatMapNullishOr: {
|
|
|
8489
8591
|
* Lifts a `Result`-returning function into one that returns an array: failures
|
|
8490
8592
|
* produce `[]`, successes produce `[value]`.
|
|
8491
8593
|
*
|
|
8594
|
+
* **When to use**
|
|
8595
|
+
*
|
|
8596
|
+
* Use when a fallible parser or lookup should participate in array pipelines as
|
|
8597
|
+
* zero-or-one results and the failure value should be discarded.
|
|
8598
|
+
*
|
|
8492
8599
|
* **Example** (Lifting a Result function)
|
|
8493
8600
|
*
|
|
8494
8601
|
* ```ts
|
|
@@ -8524,7 +8631,7 @@ export const liftResult = <A extends Array<unknown>, E, B>(
|
|
|
8524
8631
|
*
|
|
8525
8632
|
* **When to use**
|
|
8526
8633
|
*
|
|
8527
|
-
* Use to check
|
|
8634
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
8528
8635
|
* refinement-based type narrowing.
|
|
8529
8636
|
*
|
|
8530
8637
|
* **Example** (Testing all elements)
|
|
@@ -8548,7 +8655,7 @@ export const every: {
|
|
|
8548
8655
|
*
|
|
8549
8656
|
* **When to use**
|
|
8550
8657
|
*
|
|
8551
|
-
* Use to check
|
|
8658
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
8552
8659
|
* refinement-based type narrowing.
|
|
8553
8660
|
*
|
|
8554
8661
|
* **Example** (Testing all elements)
|
|
@@ -8572,7 +8679,7 @@ export const every: {
|
|
|
8572
8679
|
*
|
|
8573
8680
|
* **When to use**
|
|
8574
8681
|
*
|
|
8575
|
-
* Use to check
|
|
8682
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
8576
8683
|
* refinement-based type narrowing.
|
|
8577
8684
|
*
|
|
8578
8685
|
* **Example** (Testing all elements)
|
|
@@ -8596,7 +8703,7 @@ export const every: {
|
|
|
8596
8703
|
*
|
|
8597
8704
|
* **When to use**
|
|
8598
8705
|
*
|
|
8599
|
-
* Use to check
|
|
8706
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
8600
8707
|
* refinement-based type narrowing.
|
|
8601
8708
|
*
|
|
8602
8709
|
* **Example** (Testing all elements)
|
|
@@ -8620,7 +8727,7 @@ export const every: {
|
|
|
8620
8727
|
*
|
|
8621
8728
|
* **When to use**
|
|
8622
8729
|
*
|
|
8623
|
-
* Use to check
|
|
8730
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
8624
8731
|
* refinement-based type narrowing.
|
|
8625
8732
|
*
|
|
8626
8733
|
* **Example** (Testing all elements)
|
|
@@ -8716,12 +8823,12 @@ export const some: {
|
|
|
8716
8823
|
*
|
|
8717
8824
|
* **When to use**
|
|
8718
8825
|
*
|
|
8719
|
-
* Use when a
|
|
8826
|
+
* Use when you need to compute a result from every suffix of an array, such as
|
|
8720
8827
|
* cumulative aggregations from each position.
|
|
8721
8828
|
*
|
|
8722
8829
|
* **Details**
|
|
8723
8830
|
*
|
|
8724
|
-
*
|
|
8831
|
+
* For index `i`, the function receives `self.slice(i)`.
|
|
8725
8832
|
*
|
|
8726
8833
|
* **Example** (Suffix lengths)
|
|
8727
8834
|
*
|
|
@@ -8743,12 +8850,12 @@ export const extend: {
|
|
|
8743
8850
|
*
|
|
8744
8851
|
* **When to use**
|
|
8745
8852
|
*
|
|
8746
|
-
* Use when a
|
|
8853
|
+
* Use when you need to compute a result from every suffix of an array, such as
|
|
8747
8854
|
* cumulative aggregations from each position.
|
|
8748
8855
|
*
|
|
8749
8856
|
* **Details**
|
|
8750
8857
|
*
|
|
8751
|
-
*
|
|
8858
|
+
* For index `i`, the function receives `self.slice(i)`.
|
|
8752
8859
|
*
|
|
8753
8860
|
* **Example** (Suffix lengths)
|
|
8754
8861
|
*
|
|
@@ -8770,12 +8877,12 @@ export const extend: {
|
|
|
8770
8877
|
*
|
|
8771
8878
|
* **When to use**
|
|
8772
8879
|
*
|
|
8773
|
-
* Use when a
|
|
8880
|
+
* Use when you need to compute a result from every suffix of an array, such as
|
|
8774
8881
|
* cumulative aggregations from each position.
|
|
8775
8882
|
*
|
|
8776
8883
|
* **Details**
|
|
8777
8884
|
*
|
|
8778
|
-
*
|
|
8885
|
+
* For index `i`, the function receives `self.slice(i)`.
|
|
8779
8886
|
*
|
|
8780
8887
|
* **Example** (Suffix lengths)
|
|
8781
8888
|
*
|
|
@@ -9219,7 +9326,7 @@ export const dedupe = <S extends Iterable<any>>(
|
|
|
9219
9326
|
*
|
|
9220
9327
|
* **Details**
|
|
9221
9328
|
*
|
|
9222
|
-
*
|
|
9329
|
+
* Non-adjacent duplicates are preserved.
|
|
9223
9330
|
*
|
|
9224
9331
|
* **Example** (Deduplicating adjacent elements)
|
|
9225
9332
|
*
|
|
@@ -9248,7 +9355,7 @@ export const dedupeAdjacentWith: {
|
|
|
9248
9355
|
*
|
|
9249
9356
|
* **Details**
|
|
9250
9357
|
*
|
|
9251
|
-
*
|
|
9358
|
+
* Non-adjacent duplicates are preserved.
|
|
9252
9359
|
*
|
|
9253
9360
|
* **Example** (Deduplicating adjacent elements)
|
|
9254
9361
|
*
|
|
@@ -9277,7 +9384,7 @@ export const dedupeAdjacentWith: {
|
|
|
9277
9384
|
*
|
|
9278
9385
|
* **Details**
|
|
9279
9386
|
*
|
|
9280
|
-
*
|
|
9387
|
+
* Non-adjacent duplicates are preserved.
|
|
9281
9388
|
*
|
|
9282
9389
|
* **Example** (Deduplicating adjacent elements)
|
|
9283
9390
|
*
|
|
@@ -9389,15 +9496,15 @@ export const join: {
|
|
|
9389
9496
|
*
|
|
9390
9497
|
* **When to use**
|
|
9391
9498
|
*
|
|
9392
|
-
* Use when
|
|
9393
|
-
*
|
|
9499
|
+
* Use when you need to map while threading state through each element and keep
|
|
9500
|
+
* the final state.
|
|
9394
9501
|
*
|
|
9395
9502
|
* **Details**
|
|
9396
9503
|
*
|
|
9397
|
-
*
|
|
9398
|
-
*
|
|
9399
|
-
*
|
|
9400
|
-
*
|
|
9504
|
+
* Combines `map` and `reduce` in a single pass. The callback receives the
|
|
9505
|
+
* current state, element, and index, and returns `[nextState, mappedValue]`.
|
|
9506
|
+
* The result is `[finalState, mappedArray]`. This can be used in both
|
|
9507
|
+
* data-first and data-last style.
|
|
9401
9508
|
*
|
|
9402
9509
|
* **Example** (Running sum alongside mapped values)
|
|
9403
9510
|
*
|
|
@@ -9420,15 +9527,15 @@ export const mapAccum: {
|
|
|
9420
9527
|
*
|
|
9421
9528
|
* **When to use**
|
|
9422
9529
|
*
|
|
9423
|
-
* Use when
|
|
9424
|
-
*
|
|
9530
|
+
* Use when you need to map while threading state through each element and keep
|
|
9531
|
+
* the final state.
|
|
9425
9532
|
*
|
|
9426
9533
|
* **Details**
|
|
9427
9534
|
*
|
|
9428
|
-
*
|
|
9429
|
-
*
|
|
9430
|
-
*
|
|
9431
|
-
*
|
|
9535
|
+
* Combines `map` and `reduce` in a single pass. The callback receives the
|
|
9536
|
+
* current state, element, and index, and returns `[nextState, mappedValue]`.
|
|
9537
|
+
* The result is `[finalState, mappedArray]`. This can be used in both
|
|
9538
|
+
* data-first and data-last style.
|
|
9432
9539
|
*
|
|
9433
9540
|
* **Example** (Running sum alongside mapped values)
|
|
9434
9541
|
*
|
|
@@ -9451,15 +9558,15 @@ export const mapAccum: {
|
|
|
9451
9558
|
*
|
|
9452
9559
|
* **When to use**
|
|
9453
9560
|
*
|
|
9454
|
-
* Use when
|
|
9455
|
-
*
|
|
9561
|
+
* Use when you need to map while threading state through each element and keep
|
|
9562
|
+
* the final state.
|
|
9456
9563
|
*
|
|
9457
9564
|
* **Details**
|
|
9458
9565
|
*
|
|
9459
|
-
*
|
|
9460
|
-
*
|
|
9461
|
-
*
|
|
9462
|
-
*
|
|
9566
|
+
* Combines `map` and `reduce` in a single pass. The callback receives the
|
|
9567
|
+
* current state, element, and index, and returns `[nextState, mappedValue]`.
|
|
9568
|
+
* The result is `[finalState, mappedArray]`. This can be used in both
|
|
9569
|
+
* data-first and data-last style.
|
|
9463
9570
|
*
|
|
9464
9571
|
* **Example** (Running sum alongside mapped values)
|
|
9465
9572
|
*
|
|
@@ -9507,9 +9614,9 @@ export const mapAccum: {
|
|
|
9507
9614
|
*
|
|
9508
9615
|
* **Details**
|
|
9509
9616
|
*
|
|
9510
|
-
*
|
|
9511
|
-
*
|
|
9512
|
-
*
|
|
9617
|
+
* Produces every combination of an element from `self` with an element from
|
|
9618
|
+
* `that`, so the result length is `self.length * that.length`. Iteration visits
|
|
9619
|
+
* every element of `that` for each element of `self`.
|
|
9513
9620
|
*
|
|
9514
9621
|
* **Example** (Combining numbers and letters)
|
|
9515
9622
|
*
|
|
@@ -9536,9 +9643,9 @@ export const cartesianWith: {
|
|
|
9536
9643
|
*
|
|
9537
9644
|
* **Details**
|
|
9538
9645
|
*
|
|
9539
|
-
*
|
|
9540
|
-
*
|
|
9541
|
-
*
|
|
9646
|
+
* Produces every combination of an element from `self` with an element from
|
|
9647
|
+
* `that`, so the result length is `self.length * that.length`. Iteration visits
|
|
9648
|
+
* every element of `that` for each element of `self`.
|
|
9542
9649
|
*
|
|
9543
9650
|
* **Example** (Combining numbers and letters)
|
|
9544
9651
|
*
|
|
@@ -9565,9 +9672,9 @@ export const cartesianWith: {
|
|
|
9565
9672
|
*
|
|
9566
9673
|
* **Details**
|
|
9567
9674
|
*
|
|
9568
|
-
*
|
|
9569
|
-
*
|
|
9570
|
-
*
|
|
9675
|
+
* Produces every combination of an element from `self` with an element from
|
|
9676
|
+
* `that`, so the result length is `self.length * that.length`. Iteration visits
|
|
9677
|
+
* every element of `that` for each element of `self`.
|
|
9571
9678
|
*
|
|
9572
9679
|
* **Example** (Combining numbers and letters)
|
|
9573
9680
|
*
|
|
@@ -9599,8 +9706,8 @@ export const cartesianWith: {
|
|
|
9599
9706
|
*
|
|
9600
9707
|
* **Details**
|
|
9601
9708
|
*
|
|
9602
|
-
*
|
|
9603
|
-
*
|
|
9709
|
+
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
9710
|
+
* from `that`, so the result length is `self.length * that.length`.
|
|
9604
9711
|
*
|
|
9605
9712
|
* **Example** (All pairs of two arrays)
|
|
9606
9713
|
*
|
|
@@ -9626,8 +9733,8 @@ export const cartesian: {
|
|
|
9626
9733
|
*
|
|
9627
9734
|
* **Details**
|
|
9628
9735
|
*
|
|
9629
|
-
*
|
|
9630
|
-
*
|
|
9736
|
+
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
9737
|
+
* from `that`, so the result length is `self.length * that.length`.
|
|
9631
9738
|
*
|
|
9632
9739
|
* **Example** (All pairs of two arrays)
|
|
9633
9740
|
*
|
|
@@ -9653,8 +9760,8 @@ export const cartesian: {
|
|
|
9653
9760
|
*
|
|
9654
9761
|
* **Details**
|
|
9655
9762
|
*
|
|
9656
|
-
*
|
|
9657
|
-
*
|
|
9763
|
+
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
9764
|
+
* from `that`, so the result length is `self.length * that.length`.
|
|
9658
9765
|
*
|
|
9659
9766
|
* **Example** (All pairs of two arrays)
|
|
9660
9767
|
*
|
|
@@ -9685,9 +9792,14 @@ export const cartesian: {
|
|
|
9685
9792
|
*
|
|
9686
9793
|
* **When to use**
|
|
9687
9794
|
*
|
|
9688
|
-
* Use when
|
|
9689
|
-
*
|
|
9690
|
-
*
|
|
9795
|
+
* Use when you want array-comprehension style code with do notation.
|
|
9796
|
+
*
|
|
9797
|
+
* **Details**
|
|
9798
|
+
*
|
|
9799
|
+
* Use {@link bind} to introduce array variables and {@link let_ let} for plain
|
|
9800
|
+
* values. Each `bind` produces the cartesian product of all bound variables,
|
|
9801
|
+
* like nested loops. Use `filter` and `map` in the pipeline to add conditions
|
|
9802
|
+
* and transformations.
|
|
9691
9803
|
*
|
|
9692
9804
|
* **Example** (Array comprehension with do notation)
|
|
9693
9805
|
*
|
|
@@ -9723,9 +9835,9 @@ export const Do: ReadonlyArray<{}> = of({})
|
|
|
9723
9835
|
*
|
|
9724
9836
|
* **Details**
|
|
9725
9837
|
*
|
|
9726
|
-
*
|
|
9727
|
-
*
|
|
9728
|
-
*
|
|
9838
|
+
* Each `bind` call adds a named property to the accumulated object. The
|
|
9839
|
+
* callback receives the current scope and must return an array. This is
|
|
9840
|
+
* equivalent to `flatMap` plus merging the new value into the scope object.
|
|
9729
9841
|
*
|
|
9730
9842
|
* **Example** (Binding two arrays)
|
|
9731
9843
|
*
|
|
@@ -9759,9 +9871,9 @@ export const bind: {
|
|
|
9759
9871
|
*
|
|
9760
9872
|
* **Details**
|
|
9761
9873
|
*
|
|
9762
|
-
*
|
|
9763
|
-
*
|
|
9764
|
-
*
|
|
9874
|
+
* Each `bind` call adds a named property to the accumulated object. The
|
|
9875
|
+
* callback receives the current scope and must return an array. This is
|
|
9876
|
+
* equivalent to `flatMap` plus merging the new value into the scope object.
|
|
9765
9877
|
*
|
|
9766
9878
|
* **Example** (Binding two arrays)
|
|
9767
9879
|
*
|
|
@@ -9797,9 +9909,9 @@ export const bind: {
|
|
|
9797
9909
|
*
|
|
9798
9910
|
* **Details**
|
|
9799
9911
|
*
|
|
9800
|
-
*
|
|
9801
|
-
*
|
|
9802
|
-
*
|
|
9912
|
+
* Each `bind` call adds a named property to the accumulated object. The
|
|
9913
|
+
* callback receives the current scope and must return an array. This is
|
|
9914
|
+
* equivalent to `flatMap` plus merging the new value into the scope object.
|
|
9803
9915
|
*
|
|
9804
9916
|
* **Example** (Binding two arrays)
|
|
9805
9917
|
*
|
|
@@ -9839,8 +9951,8 @@ export const bind: {
|
|
|
9839
9951
|
*
|
|
9840
9952
|
* **Details**
|
|
9841
9953
|
*
|
|
9842
|
-
*
|
|
9843
|
-
*
|
|
9954
|
+
* Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`. This is an
|
|
9955
|
+
* alternative to starting with `Do` plus `bind` when you already have an array.
|
|
9844
9956
|
*
|
|
9845
9957
|
* **Example** (Naming an existing array)
|
|
9846
9958
|
*
|
|
@@ -9871,8 +9983,8 @@ export const bindTo: {
|
|
|
9871
9983
|
*
|
|
9872
9984
|
* **Details**
|
|
9873
9985
|
*
|
|
9874
|
-
*
|
|
9875
|
-
*
|
|
9986
|
+
* Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`. This is an
|
|
9987
|
+
* alternative to starting with `Do` plus `bind` when you already have an array.
|
|
9876
9988
|
*
|
|
9877
9989
|
* **Example** (Naming an existing array)
|
|
9878
9990
|
*
|
|
@@ -9903,8 +10015,8 @@ export const bindTo: {
|
|
|
9903
10015
|
*
|
|
9904
10016
|
* **Details**
|
|
9905
10017
|
*
|
|
9906
|
-
*
|
|
9907
|
-
*
|
|
10018
|
+
* Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`. This is an
|
|
10019
|
+
* alternative to starting with `Do` plus `bind` when you already have an array.
|
|
9908
10020
|
*
|
|
9909
10021
|
* **Example** (Naming an existing array)
|
|
9910
10022
|
*
|
|
@@ -9943,10 +10055,16 @@ export {
|
|
|
9943
10055
|
/**
|
|
9944
10056
|
* Adds a computed plain value to the do-notation scope without introducing a new array dimension.
|
|
9945
10057
|
*
|
|
10058
|
+
* **When to use**
|
|
10059
|
+
*
|
|
10060
|
+
* Use when each do-notation branch needs a derived field from the current
|
|
10061
|
+
* bindings without multiplying the number of branches.
|
|
10062
|
+
*
|
|
9946
10063
|
* **Details**
|
|
9947
10064
|
*
|
|
9948
|
-
*
|
|
9949
|
-
*
|
|
10065
|
+
* Unlike `bind`, the callback returns a single value instead of an array, so
|
|
10066
|
+
* no cartesian product occurs. Use this for derived or intermediate values
|
|
10067
|
+
* that depend on previously bound variables.
|
|
9950
10068
|
*
|
|
9951
10069
|
* **Example** (Adding a computed value)
|
|
9952
10070
|
*
|
|
@@ -10002,13 +10120,13 @@ export function makeReducerConcat<A>(): Reducer.Reducer<Array<A>> {
|
|
|
10002
10120
|
*
|
|
10003
10121
|
* **When to use**
|
|
10004
10122
|
*
|
|
10005
|
-
* Use to count how many elements
|
|
10006
|
-
*
|
|
10123
|
+
* Use when you need to count how many elements of an iterable satisfy a
|
|
10124
|
+
* predicate.
|
|
10007
10125
|
*
|
|
10008
10126
|
* **Details**
|
|
10009
10127
|
*
|
|
10010
|
-
*
|
|
10011
|
-
*
|
|
10128
|
+
* The predicate receives both the element and its index. Empty iterables return
|
|
10129
|
+
* `0`.
|
|
10012
10130
|
*
|
|
10013
10131
|
* **Example** (Counting even numbers)
|
|
10014
10132
|
*
|
|
@@ -10030,13 +10148,13 @@ export const countBy: {
|
|
|
10030
10148
|
*
|
|
10031
10149
|
* **When to use**
|
|
10032
10150
|
*
|
|
10033
|
-
* Use to count how many elements
|
|
10034
|
-
*
|
|
10151
|
+
* Use when you need to count how many elements of an iterable satisfy a
|
|
10152
|
+
* predicate.
|
|
10035
10153
|
*
|
|
10036
10154
|
* **Details**
|
|
10037
10155
|
*
|
|
10038
|
-
*
|
|
10039
|
-
*
|
|
10156
|
+
* The predicate receives both the element and its index. Empty iterables return
|
|
10157
|
+
* `0`.
|
|
10040
10158
|
*
|
|
10041
10159
|
* **Example** (Counting even numbers)
|
|
10042
10160
|
*
|
|
@@ -10058,13 +10176,13 @@ export const countBy: {
|
|
|
10058
10176
|
*
|
|
10059
10177
|
* **When to use**
|
|
10060
10178
|
*
|
|
10061
|
-
* Use to count how many elements
|
|
10062
|
-
*
|
|
10179
|
+
* Use when you need to count how many elements of an iterable satisfy a
|
|
10180
|
+
* predicate.
|
|
10063
10181
|
*
|
|
10064
10182
|
* **Details**
|
|
10065
10183
|
*
|
|
10066
|
-
*
|
|
10067
|
-
*
|
|
10184
|
+
* The predicate receives both the element and its index. Empty iterables return
|
|
10185
|
+
* `0`.
|
|
10068
10186
|
*
|
|
10069
10187
|
* **Example** (Counting even numbers)
|
|
10070
10188
|
*
|