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/dist/Array.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ export interface ReadonlyArrayTypeLambda extends TypeLambda {
|
|
|
43
43
|
*
|
|
44
44
|
* **When to use**
|
|
45
45
|
*
|
|
46
|
-
* Use when
|
|
47
|
-
*
|
|
46
|
+
* Use when non-emptiness must be tracked at the type level while preventing mutation.
|
|
47
|
+
* Many Array module functions accept or return this type.
|
|
48
48
|
*
|
|
49
49
|
* **Example** (Typing a non-empty array)
|
|
50
50
|
*
|
|
@@ -97,9 +97,12 @@ export type NonEmptyArray<A> = [A, ...Array<A>];
|
|
|
97
97
|
*
|
|
98
98
|
* **When to use**
|
|
99
99
|
*
|
|
100
|
-
* Use when you
|
|
101
|
-
*
|
|
102
|
-
*
|
|
100
|
+
* Use when you need to create a typed non-empty array from literal values.
|
|
101
|
+
*
|
|
102
|
+
* **Details**
|
|
103
|
+
*
|
|
104
|
+
* The element type is inferred as the union of all arguments. Because at least
|
|
105
|
+
* one argument is required, this always returns a `NonEmptyArray`.
|
|
103
106
|
*
|
|
104
107
|
* **Example** (Creating an array from values)
|
|
105
108
|
*
|
|
@@ -122,9 +125,11 @@ export declare const make: <Elements extends NonEmptyArray<unknown>>(...elements
|
|
|
122
125
|
*
|
|
123
126
|
* **When to use**
|
|
124
127
|
*
|
|
125
|
-
* Use when you need a pre-sized array
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
+
* Use when you need a pre-sized array that will be filled imperatively.
|
|
129
|
+
*
|
|
130
|
+
* **Details**
|
|
131
|
+
*
|
|
132
|
+
* Elements are typed as `A | undefined` because the slots are empty.
|
|
128
133
|
*
|
|
129
134
|
* **Example** (Allocating a fixed-size array)
|
|
130
135
|
*
|
|
@@ -146,9 +151,13 @@ export declare const allocate: <A = never>(n: number) => Array<A | undefined>;
|
|
|
146
151
|
*
|
|
147
152
|
* **When to use**
|
|
148
153
|
*
|
|
149
|
-
* Use when you need
|
|
150
|
-
*
|
|
151
|
-
*
|
|
154
|
+
* Use when you need to compute each array element from its index.
|
|
155
|
+
*
|
|
156
|
+
* **Details**
|
|
157
|
+
*
|
|
158
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
159
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
160
|
+
* usage.
|
|
152
161
|
*
|
|
153
162
|
* **Example** (Generating values from indices)
|
|
154
163
|
*
|
|
@@ -171,9 +180,13 @@ export declare const makeBy: {
|
|
|
171
180
|
*
|
|
172
181
|
* **When to use**
|
|
173
182
|
*
|
|
174
|
-
* Use when you need
|
|
175
|
-
*
|
|
176
|
-
*
|
|
183
|
+
* Use when you need to compute each array element from its index.
|
|
184
|
+
*
|
|
185
|
+
* **Details**
|
|
186
|
+
*
|
|
187
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
188
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
189
|
+
* usage.
|
|
177
190
|
*
|
|
178
191
|
* **Example** (Generating values from indices)
|
|
179
192
|
*
|
|
@@ -196,9 +209,13 @@ export declare const makeBy: {
|
|
|
196
209
|
*
|
|
197
210
|
* **When to use**
|
|
198
211
|
*
|
|
199
|
-
* Use when you need
|
|
200
|
-
*
|
|
201
|
-
*
|
|
212
|
+
* Use when you need to compute each array element from its index.
|
|
213
|
+
*
|
|
214
|
+
* **Details**
|
|
215
|
+
*
|
|
216
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
217
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
218
|
+
* usage.
|
|
202
219
|
*
|
|
203
220
|
* **Example** (Generating values from indices)
|
|
204
221
|
*
|
|
@@ -223,9 +240,11 @@ export declare const makeBy: {
|
|
|
223
240
|
*
|
|
224
241
|
* **When to use**
|
|
225
242
|
*
|
|
226
|
-
* Use when you need a sequence of consecutive integers.
|
|
227
|
-
*
|
|
228
|
-
*
|
|
243
|
+
* Use when you need a non-empty sequence of consecutive integers.
|
|
244
|
+
*
|
|
245
|
+
* **Details**
|
|
246
|
+
*
|
|
247
|
+
* If `start > end`, returns `[start]`.
|
|
229
248
|
*
|
|
230
249
|
* **Example** (Creating a range)
|
|
231
250
|
*
|
|
@@ -247,9 +266,13 @@ export declare const range: (start: number, end: number) => NonEmptyArray<number
|
|
|
247
266
|
*
|
|
248
267
|
* **When to use**
|
|
249
268
|
*
|
|
250
|
-
* Use when you need
|
|
251
|
-
*
|
|
252
|
-
*
|
|
269
|
+
* Use when you need a non-empty array containing repeated copies of one value.
|
|
270
|
+
*
|
|
271
|
+
* **Details**
|
|
272
|
+
*
|
|
273
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
274
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
275
|
+
* usage.
|
|
253
276
|
*
|
|
254
277
|
* **Example** (Repeating a value)
|
|
255
278
|
*
|
|
@@ -271,9 +294,13 @@ export declare const replicate: {
|
|
|
271
294
|
*
|
|
272
295
|
* **When to use**
|
|
273
296
|
*
|
|
274
|
-
* Use when you need
|
|
275
|
-
*
|
|
276
|
-
*
|
|
297
|
+
* Use when you need a non-empty array containing repeated copies of one value.
|
|
298
|
+
*
|
|
299
|
+
* **Details**
|
|
300
|
+
*
|
|
301
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
302
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
303
|
+
* usage.
|
|
277
304
|
*
|
|
278
305
|
* **Example** (Repeating a value)
|
|
279
306
|
*
|
|
@@ -295,9 +322,13 @@ export declare const replicate: {
|
|
|
295
322
|
*
|
|
296
323
|
* **When to use**
|
|
297
324
|
*
|
|
298
|
-
* Use when you need
|
|
299
|
-
*
|
|
300
|
-
*
|
|
325
|
+
* Use when you need a non-empty array containing repeated copies of one value.
|
|
326
|
+
*
|
|
327
|
+
* **Details**
|
|
328
|
+
*
|
|
329
|
+
* `n` is normalized to an integer greater than or equal to 1, so this function
|
|
330
|
+
* always returns at least one element. Supports both data-first and data-last
|
|
331
|
+
* usage.
|
|
301
332
|
*
|
|
302
333
|
* **Example** (Repeating a value)
|
|
303
334
|
*
|
|
@@ -324,10 +355,9 @@ export declare const replicate: {
|
|
|
324
355
|
*
|
|
325
356
|
* **Details**
|
|
326
357
|
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
* an array.
|
|
358
|
+
* If the input is already an array, this returns it by reference without
|
|
359
|
+
* copying. Otherwise, it creates a new array from the iterable. Use `copy` if
|
|
360
|
+
* you need a fresh array even when the input is already an array.
|
|
331
361
|
*
|
|
332
362
|
* **Example** (Converting a Set to an array)
|
|
333
363
|
*
|
|
@@ -355,9 +385,9 @@ export declare const fromIterable: <A>(collection: Iterable<A>) => Array<A>;
|
|
|
355
385
|
*
|
|
356
386
|
* **Details**
|
|
357
387
|
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
388
|
+
* If the input is already an array, this returns it by reference. If the input
|
|
389
|
+
* is a single value, this wraps it in a one-element array. This is useful for
|
|
390
|
+
* APIs that accept `A | Array<A>`.
|
|
361
391
|
*
|
|
362
392
|
* **Example** (Normalizing input)
|
|
363
393
|
*
|
|
@@ -385,8 +415,8 @@ export declare const ensure: <A>(self: ReadonlyArray<A> | A) => Array<A>;
|
|
|
385
415
|
*
|
|
386
416
|
* **Details**
|
|
387
417
|
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
418
|
+
* Key order follows `Object.entries` semantics. Empty records produce an empty
|
|
419
|
+
* array.
|
|
390
420
|
*
|
|
391
421
|
* **Example** (Record to entries)
|
|
392
422
|
*
|
|
@@ -431,9 +461,12 @@ export declare const fromOption: <A>(self: Option.Option<A>) => Array<A>;
|
|
|
431
461
|
*
|
|
432
462
|
* **When to use**
|
|
433
463
|
*
|
|
434
|
-
* Use when you need to branch on whether an array
|
|
435
|
-
*
|
|
436
|
-
*
|
|
464
|
+
* Use when you need to branch on whether an array is empty.
|
|
465
|
+
*
|
|
466
|
+
* **Details**
|
|
467
|
+
*
|
|
468
|
+
* `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
|
|
469
|
+
* data-last usage.
|
|
437
470
|
*
|
|
438
471
|
* **Example** (Branching on emptiness)
|
|
439
472
|
*
|
|
@@ -460,9 +493,12 @@ export declare const match: {
|
|
|
460
493
|
*
|
|
461
494
|
* **When to use**
|
|
462
495
|
*
|
|
463
|
-
* Use when you need to branch on whether an array
|
|
464
|
-
*
|
|
465
|
-
*
|
|
496
|
+
* Use when you need to branch on whether an array is empty.
|
|
497
|
+
*
|
|
498
|
+
* **Details**
|
|
499
|
+
*
|
|
500
|
+
* `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
|
|
501
|
+
* data-last usage.
|
|
466
502
|
*
|
|
467
503
|
* **Example** (Branching on emptiness)
|
|
468
504
|
*
|
|
@@ -492,9 +528,12 @@ export declare const match: {
|
|
|
492
528
|
*
|
|
493
529
|
* **When to use**
|
|
494
530
|
*
|
|
495
|
-
* Use when you need to branch on whether an array
|
|
496
|
-
*
|
|
497
|
-
*
|
|
531
|
+
* Use when you need to branch on whether an array is empty.
|
|
532
|
+
*
|
|
533
|
+
* **Details**
|
|
534
|
+
*
|
|
535
|
+
* `onNonEmpty` receives a `NonEmptyReadonlyArray`. Supports both data-first and
|
|
536
|
+
* data-last usage.
|
|
498
537
|
*
|
|
499
538
|
* **Example** (Branching on emptiness)
|
|
500
539
|
*
|
|
@@ -526,8 +565,8 @@ export declare const match: {
|
|
|
526
565
|
*
|
|
527
566
|
* **When to use**
|
|
528
567
|
*
|
|
529
|
-
* Use
|
|
530
|
-
*
|
|
568
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
569
|
+
* first element plus the remaining elements.
|
|
531
570
|
*
|
|
532
571
|
* **Details**
|
|
533
572
|
*
|
|
@@ -559,8 +598,8 @@ export declare const matchLeft: {
|
|
|
559
598
|
*
|
|
560
599
|
* **When to use**
|
|
561
600
|
*
|
|
562
|
-
* Use
|
|
563
|
-
*
|
|
601
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
602
|
+
* first element plus the remaining elements.
|
|
564
603
|
*
|
|
565
604
|
* **Details**
|
|
566
605
|
*
|
|
@@ -595,8 +634,8 @@ export declare const matchLeft: {
|
|
|
595
634
|
*
|
|
596
635
|
* **When to use**
|
|
597
636
|
*
|
|
598
|
-
* Use
|
|
599
|
-
*
|
|
637
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
638
|
+
* first element plus the remaining elements.
|
|
600
639
|
*
|
|
601
640
|
* **Details**
|
|
602
641
|
*
|
|
@@ -632,8 +671,8 @@ export declare const matchLeft: {
|
|
|
632
671
|
*
|
|
633
672
|
* **When to use**
|
|
634
673
|
*
|
|
635
|
-
* Use
|
|
636
|
-
*
|
|
674
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
675
|
+
* elements before the last plus the last element.
|
|
637
676
|
*
|
|
638
677
|
* **Details**
|
|
639
678
|
*
|
|
@@ -665,8 +704,8 @@ export declare const matchRight: {
|
|
|
665
704
|
*
|
|
666
705
|
* **When to use**
|
|
667
706
|
*
|
|
668
|
-
* Use
|
|
669
|
-
*
|
|
707
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
708
|
+
* elements before the last plus the last element.
|
|
670
709
|
*
|
|
671
710
|
* **Details**
|
|
672
711
|
*
|
|
@@ -701,8 +740,8 @@ export declare const matchRight: {
|
|
|
701
740
|
*
|
|
702
741
|
* **When to use**
|
|
703
742
|
*
|
|
704
|
-
* Use
|
|
705
|
-
*
|
|
743
|
+
* Use when you need to branch on an array and handle the non-empty case as the
|
|
744
|
+
* elements before the last plus the last element.
|
|
706
745
|
*
|
|
707
746
|
* **Details**
|
|
708
747
|
*
|
|
@@ -737,11 +776,8 @@ export declare const matchRight: {
|
|
|
737
776
|
*
|
|
738
777
|
* **When to use**
|
|
739
778
|
*
|
|
740
|
-
* Use
|
|
741
|
-
*
|
|
742
|
-
* **Details**
|
|
743
|
-
*
|
|
744
|
-
* - Always returns a non-empty array.
|
|
779
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
780
|
+
* leading value.
|
|
745
781
|
*
|
|
746
782
|
* **Example** (Prepending an element)
|
|
747
783
|
*
|
|
@@ -755,7 +791,7 @@ export declare const matchRight: {
|
|
|
755
791
|
* @see {@link append} — add to the end
|
|
756
792
|
* @see {@link prependAll} — prepend multiple elements
|
|
757
793
|
*
|
|
758
|
-
* @category
|
|
794
|
+
* @category combining
|
|
759
795
|
* @since 2.0.0
|
|
760
796
|
*/
|
|
761
797
|
export declare const prepend: {
|
|
@@ -764,11 +800,8 @@ export declare const prepend: {
|
|
|
764
800
|
*
|
|
765
801
|
* **When to use**
|
|
766
802
|
*
|
|
767
|
-
* Use
|
|
768
|
-
*
|
|
769
|
-
* **Details**
|
|
770
|
-
*
|
|
771
|
-
* - Always returns a non-empty array.
|
|
803
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
804
|
+
* leading value.
|
|
772
805
|
*
|
|
773
806
|
* **Example** (Prepending an element)
|
|
774
807
|
*
|
|
@@ -782,7 +815,7 @@ export declare const prepend: {
|
|
|
782
815
|
* @see {@link append} — add to the end
|
|
783
816
|
* @see {@link prependAll} — prepend multiple elements
|
|
784
817
|
*
|
|
785
|
-
* @category
|
|
818
|
+
* @category combining
|
|
786
819
|
* @since 2.0.0
|
|
787
820
|
*/
|
|
788
821
|
<B>(head: B): <A>(self: Iterable<A>) => NonEmptyArray<A | B>;
|
|
@@ -791,11 +824,8 @@ export declare const prepend: {
|
|
|
791
824
|
*
|
|
792
825
|
* **When to use**
|
|
793
826
|
*
|
|
794
|
-
* Use
|
|
795
|
-
*
|
|
796
|
-
* **Details**
|
|
797
|
-
*
|
|
798
|
-
* - Always returns a non-empty array.
|
|
827
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
828
|
+
* leading value.
|
|
799
829
|
*
|
|
800
830
|
* **Example** (Prepending an element)
|
|
801
831
|
*
|
|
@@ -809,7 +839,7 @@ export declare const prepend: {
|
|
|
809
839
|
* @see {@link append} — add to the end
|
|
810
840
|
* @see {@link prependAll} — prepend multiple elements
|
|
811
841
|
*
|
|
812
|
-
* @category
|
|
842
|
+
* @category combining
|
|
813
843
|
* @since 2.0.0
|
|
814
844
|
*/
|
|
815
845
|
<A, B>(self: Iterable<A>, head: B): NonEmptyArray<A | B>;
|
|
@@ -823,7 +853,7 @@ export declare const prepend: {
|
|
|
823
853
|
*
|
|
824
854
|
* **Details**
|
|
825
855
|
*
|
|
826
|
-
*
|
|
856
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
827
857
|
*
|
|
828
858
|
* **Example** (Prepending multiple elements)
|
|
829
859
|
*
|
|
@@ -837,7 +867,7 @@ export declare const prepend: {
|
|
|
837
867
|
* @see {@link prepend} — add a single element to the front
|
|
838
868
|
* @see {@link appendAll} — add elements to the end
|
|
839
869
|
*
|
|
840
|
-
* @category
|
|
870
|
+
* @category combining
|
|
841
871
|
* @since 2.0.0
|
|
842
872
|
*/
|
|
843
873
|
export declare const prependAll: {
|
|
@@ -850,7 +880,7 @@ export declare const prependAll: {
|
|
|
850
880
|
*
|
|
851
881
|
* **Details**
|
|
852
882
|
*
|
|
853
|
-
*
|
|
883
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
854
884
|
*
|
|
855
885
|
* **Example** (Prepending multiple elements)
|
|
856
886
|
*
|
|
@@ -864,7 +894,7 @@ export declare const prependAll: {
|
|
|
864
894
|
* @see {@link prepend} — add a single element to the front
|
|
865
895
|
* @see {@link appendAll} — add elements to the end
|
|
866
896
|
*
|
|
867
|
-
* @category
|
|
897
|
+
* @category combining
|
|
868
898
|
* @since 2.0.0
|
|
869
899
|
*/
|
|
870
900
|
<S extends Iterable<any>, T extends Iterable<any>>(that: T): (self: S) => ReadonlyArray.OrNonEmpty<S, T, ReadonlyArray.Infer<S> | ReadonlyArray.Infer<T>>;
|
|
@@ -877,7 +907,7 @@ export declare const prependAll: {
|
|
|
877
907
|
*
|
|
878
908
|
* **Details**
|
|
879
909
|
*
|
|
880
|
-
*
|
|
910
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
881
911
|
*
|
|
882
912
|
* **Example** (Prepending multiple elements)
|
|
883
913
|
*
|
|
@@ -891,7 +921,7 @@ export declare const prependAll: {
|
|
|
891
921
|
* @see {@link prepend} — add a single element to the front
|
|
892
922
|
* @see {@link appendAll} — add elements to the end
|
|
893
923
|
*
|
|
894
|
-
* @category
|
|
924
|
+
* @category combining
|
|
895
925
|
* @since 2.0.0
|
|
896
926
|
*/
|
|
897
927
|
<A, B>(self: Iterable<A>, that: NonEmptyReadonlyArray<B>): NonEmptyArray<A | B>;
|
|
@@ -904,7 +934,7 @@ export declare const prependAll: {
|
|
|
904
934
|
*
|
|
905
935
|
* **Details**
|
|
906
936
|
*
|
|
907
|
-
*
|
|
937
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
908
938
|
*
|
|
909
939
|
* **Example** (Prepending multiple elements)
|
|
910
940
|
*
|
|
@@ -918,7 +948,7 @@ export declare const prependAll: {
|
|
|
918
948
|
* @see {@link prepend} — add a single element to the front
|
|
919
949
|
* @see {@link appendAll} — add elements to the end
|
|
920
950
|
*
|
|
921
|
-
* @category
|
|
951
|
+
* @category combining
|
|
922
952
|
* @since 2.0.0
|
|
923
953
|
*/
|
|
924
954
|
<A, B>(self: NonEmptyReadonlyArray<A>, that: Iterable<B>): NonEmptyArray<A | B>;
|
|
@@ -931,7 +961,7 @@ export declare const prependAll: {
|
|
|
931
961
|
*
|
|
932
962
|
* **Details**
|
|
933
963
|
*
|
|
934
|
-
*
|
|
964
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
935
965
|
*
|
|
936
966
|
* **Example** (Prepending multiple elements)
|
|
937
967
|
*
|
|
@@ -945,7 +975,7 @@ export declare const prependAll: {
|
|
|
945
975
|
* @see {@link prepend} — add a single element to the front
|
|
946
976
|
* @see {@link appendAll} — add elements to the end
|
|
947
977
|
*
|
|
948
|
-
* @category
|
|
978
|
+
* @category combining
|
|
949
979
|
* @since 2.0.0
|
|
950
980
|
*/
|
|
951
981
|
<A, B>(self: Iterable<A>, that: Iterable<B>): Array<A | B>;
|
|
@@ -955,12 +985,8 @@ export declare const prependAll: {
|
|
|
955
985
|
*
|
|
956
986
|
* **When to use**
|
|
957
987
|
*
|
|
958
|
-
* Use
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
* **Details**
|
|
962
|
-
*
|
|
963
|
-
* - Always returns a non-empty array.
|
|
988
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
989
|
+
* trailing value.
|
|
964
990
|
*
|
|
965
991
|
* **Example** (Appending an element)
|
|
966
992
|
*
|
|
@@ -974,7 +1000,7 @@ export declare const prependAll: {
|
|
|
974
1000
|
* @see {@link prepend} — add to the front
|
|
975
1001
|
* @see {@link appendAll} — append multiple elements
|
|
976
1002
|
*
|
|
977
|
-
* @category
|
|
1003
|
+
* @category combining
|
|
978
1004
|
* @since 2.0.0
|
|
979
1005
|
*/
|
|
980
1006
|
export declare const append: {
|
|
@@ -983,12 +1009,8 @@ export declare const append: {
|
|
|
983
1009
|
*
|
|
984
1010
|
* **When to use**
|
|
985
1011
|
*
|
|
986
|
-
* Use
|
|
987
|
-
*
|
|
988
|
-
*
|
|
989
|
-
* **Details**
|
|
990
|
-
*
|
|
991
|
-
* - Always returns a non-empty array.
|
|
1012
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
1013
|
+
* trailing value.
|
|
992
1014
|
*
|
|
993
1015
|
* **Example** (Appending an element)
|
|
994
1016
|
*
|
|
@@ -1002,7 +1024,7 @@ export declare const append: {
|
|
|
1002
1024
|
* @see {@link prepend} — add to the front
|
|
1003
1025
|
* @see {@link appendAll} — append multiple elements
|
|
1004
1026
|
*
|
|
1005
|
-
* @category
|
|
1027
|
+
* @category combining
|
|
1006
1028
|
* @since 2.0.0
|
|
1007
1029
|
*/
|
|
1008
1030
|
<B>(last: B): <A>(self: Iterable<A>) => NonEmptyArray<A | B>;
|
|
@@ -1011,12 +1033,8 @@ export declare const append: {
|
|
|
1011
1033
|
*
|
|
1012
1034
|
* **When to use**
|
|
1013
1035
|
*
|
|
1014
|
-
* Use
|
|
1015
|
-
*
|
|
1016
|
-
*
|
|
1017
|
-
* **Details**
|
|
1018
|
-
*
|
|
1019
|
-
* - Always returns a non-empty array.
|
|
1036
|
+
* Use when you need to guarantee a non-empty result after adding a required
|
|
1037
|
+
* trailing value.
|
|
1020
1038
|
*
|
|
1021
1039
|
* **Example** (Appending an element)
|
|
1022
1040
|
*
|
|
@@ -1030,7 +1048,7 @@ export declare const append: {
|
|
|
1030
1048
|
* @see {@link prepend} — add to the front
|
|
1031
1049
|
* @see {@link appendAll} — append multiple elements
|
|
1032
1050
|
*
|
|
1033
|
-
* @category
|
|
1051
|
+
* @category combining
|
|
1034
1052
|
* @since 2.0.0
|
|
1035
1053
|
*/
|
|
1036
1054
|
<A, B>(self: Iterable<A>, last: B): NonEmptyArray<A | B>;
|
|
@@ -1045,7 +1063,7 @@ export declare const append: {
|
|
|
1045
1063
|
*
|
|
1046
1064
|
* **Details**
|
|
1047
1065
|
*
|
|
1048
|
-
*
|
|
1066
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1049
1067
|
*
|
|
1050
1068
|
* **Example** (Concatenating arrays)
|
|
1051
1069
|
*
|
|
@@ -1059,7 +1077,7 @@ export declare const append: {
|
|
|
1059
1077
|
* @see {@link append} — add a single element to the end
|
|
1060
1078
|
* @see {@link prependAll} — add elements to the front
|
|
1061
1079
|
*
|
|
1062
|
-
* @category
|
|
1080
|
+
* @category combining
|
|
1063
1081
|
* @since 2.0.0
|
|
1064
1082
|
*/
|
|
1065
1083
|
export declare const appendAll: {
|
|
@@ -1073,7 +1091,7 @@ export declare const appendAll: {
|
|
|
1073
1091
|
*
|
|
1074
1092
|
* **Details**
|
|
1075
1093
|
*
|
|
1076
|
-
*
|
|
1094
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1077
1095
|
*
|
|
1078
1096
|
* **Example** (Concatenating arrays)
|
|
1079
1097
|
*
|
|
@@ -1087,7 +1105,7 @@ export declare const appendAll: {
|
|
|
1087
1105
|
* @see {@link append} — add a single element to the end
|
|
1088
1106
|
* @see {@link prependAll} — add elements to the front
|
|
1089
1107
|
*
|
|
1090
|
-
* @category
|
|
1108
|
+
* @category combining
|
|
1091
1109
|
* @since 2.0.0
|
|
1092
1110
|
*/
|
|
1093
1111
|
<S extends Iterable<any>, T extends Iterable<any>>(that: T): (self: S) => ReadonlyArray.OrNonEmpty<S, T, ReadonlyArray.Infer<S> | ReadonlyArray.Infer<T>>;
|
|
@@ -1101,7 +1119,7 @@ export declare const appendAll: {
|
|
|
1101
1119
|
*
|
|
1102
1120
|
* **Details**
|
|
1103
1121
|
*
|
|
1104
|
-
*
|
|
1122
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1105
1123
|
*
|
|
1106
1124
|
* **Example** (Concatenating arrays)
|
|
1107
1125
|
*
|
|
@@ -1115,7 +1133,7 @@ export declare const appendAll: {
|
|
|
1115
1133
|
* @see {@link append} — add a single element to the end
|
|
1116
1134
|
* @see {@link prependAll} — add elements to the front
|
|
1117
1135
|
*
|
|
1118
|
-
* @category
|
|
1136
|
+
* @category combining
|
|
1119
1137
|
* @since 2.0.0
|
|
1120
1138
|
*/
|
|
1121
1139
|
<A, B>(self: Iterable<A>, that: NonEmptyReadonlyArray<B>): NonEmptyArray<A | B>;
|
|
@@ -1129,7 +1147,7 @@ export declare const appendAll: {
|
|
|
1129
1147
|
*
|
|
1130
1148
|
* **Details**
|
|
1131
1149
|
*
|
|
1132
|
-
*
|
|
1150
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1133
1151
|
*
|
|
1134
1152
|
* **Example** (Concatenating arrays)
|
|
1135
1153
|
*
|
|
@@ -1143,7 +1161,7 @@ export declare const appendAll: {
|
|
|
1143
1161
|
* @see {@link append} — add a single element to the end
|
|
1144
1162
|
* @see {@link prependAll} — add elements to the front
|
|
1145
1163
|
*
|
|
1146
|
-
* @category
|
|
1164
|
+
* @category combining
|
|
1147
1165
|
* @since 2.0.0
|
|
1148
1166
|
*/
|
|
1149
1167
|
<A, B>(self: NonEmptyReadonlyArray<A>, that: Iterable<B>): NonEmptyArray<A | B>;
|
|
@@ -1157,7 +1175,7 @@ export declare const appendAll: {
|
|
|
1157
1175
|
*
|
|
1158
1176
|
* **Details**
|
|
1159
1177
|
*
|
|
1160
|
-
*
|
|
1178
|
+
* If either input is non-empty, the result is a `NonEmptyArray`.
|
|
1161
1179
|
*
|
|
1162
1180
|
* **Example** (Concatenating arrays)
|
|
1163
1181
|
*
|
|
@@ -1171,7 +1189,7 @@ export declare const appendAll: {
|
|
|
1171
1189
|
* @see {@link append} — add a single element to the end
|
|
1172
1190
|
* @see {@link prependAll} — add elements to the front
|
|
1173
1191
|
*
|
|
1174
|
-
* @category
|
|
1192
|
+
* @category combining
|
|
1175
1193
|
* @since 2.0.0
|
|
1176
1194
|
*/
|
|
1177
1195
|
<A, B>(self: Iterable<A>, that: Iterable<B>): Array<A | B>;
|
|
@@ -1185,9 +1203,9 @@ export declare const appendAll: {
|
|
|
1185
1203
|
*
|
|
1186
1204
|
* **Details**
|
|
1187
1205
|
*
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
1206
|
+
* The output length is `input.length + 1` because it starts with the initial
|
|
1207
|
+
* value. The result is always a `NonEmptyArray`. Use `reduce` if you only need
|
|
1208
|
+
* the final accumulated value.
|
|
1191
1209
|
*
|
|
1192
1210
|
* **Example** (Running totals)
|
|
1193
1211
|
*
|
|
@@ -1214,9 +1232,9 @@ export declare const scan: {
|
|
|
1214
1232
|
*
|
|
1215
1233
|
* **Details**
|
|
1216
1234
|
*
|
|
1217
|
-
*
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1235
|
+
* The output length is `input.length + 1` because it starts with the initial
|
|
1236
|
+
* value. The result is always a `NonEmptyArray`. Use `reduce` if you only need
|
|
1237
|
+
* the final accumulated value.
|
|
1220
1238
|
*
|
|
1221
1239
|
* **Example** (Running totals)
|
|
1222
1240
|
*
|
|
@@ -1243,9 +1261,9 @@ export declare const scan: {
|
|
|
1243
1261
|
*
|
|
1244
1262
|
* **Details**
|
|
1245
1263
|
*
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1264
|
+
* The output length is `input.length + 1` because it starts with the initial
|
|
1265
|
+
* value. The result is always a `NonEmptyArray`. Use `reduce` if you only need
|
|
1266
|
+
* the final accumulated value.
|
|
1249
1267
|
*
|
|
1250
1268
|
* **Example** (Running totals)
|
|
1251
1269
|
*
|
|
@@ -1274,8 +1292,8 @@ export declare const scan: {
|
|
|
1274
1292
|
*
|
|
1275
1293
|
* **Details**
|
|
1276
1294
|
*
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1295
|
+
* The output length is `input.length + 1` because it ends with the initial
|
|
1296
|
+
* value. The result is always a `NonEmptyArray`.
|
|
1279
1297
|
*
|
|
1280
1298
|
* **Example** (Reverse running totals)
|
|
1281
1299
|
*
|
|
@@ -1303,8 +1321,8 @@ export declare const scanRight: {
|
|
|
1303
1321
|
*
|
|
1304
1322
|
* **Details**
|
|
1305
1323
|
*
|
|
1306
|
-
*
|
|
1307
|
-
*
|
|
1324
|
+
* The output length is `input.length + 1` because it ends with the initial
|
|
1325
|
+
* value. The result is always a `NonEmptyArray`.
|
|
1308
1326
|
*
|
|
1309
1327
|
* **Example** (Reverse running totals)
|
|
1310
1328
|
*
|
|
@@ -1332,8 +1350,8 @@ export declare const scanRight: {
|
|
|
1332
1350
|
*
|
|
1333
1351
|
* **Details**
|
|
1334
1352
|
*
|
|
1335
|
-
*
|
|
1336
|
-
*
|
|
1353
|
+
* The output length is `input.length + 1` because it ends with the initial
|
|
1354
|
+
* value. The result is always a `NonEmptyArray`.
|
|
1337
1355
|
*
|
|
1338
1356
|
* **Example** (Reverse running totals)
|
|
1339
1357
|
*
|
|
@@ -1361,8 +1379,8 @@ export declare const scanRight: {
|
|
|
1361
1379
|
*
|
|
1362
1380
|
* **Details**
|
|
1363
1381
|
*
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1382
|
+
* Acts as a type guard narrowing the input to `Array<unknown>` and delegates to
|
|
1383
|
+
* `globalThis.Array.isArray`.
|
|
1366
1384
|
*
|
|
1367
1385
|
* **Example** (Type-guarding an unknown value)
|
|
1368
1386
|
*
|
|
@@ -1389,8 +1407,8 @@ export declare const isArray: {
|
|
|
1389
1407
|
*
|
|
1390
1408
|
* **Details**
|
|
1391
1409
|
*
|
|
1392
|
-
*
|
|
1393
|
-
*
|
|
1410
|
+
* Acts as a type guard narrowing the input to `Array<unknown>` and delegates to
|
|
1411
|
+
* `globalThis.Array.isArray`.
|
|
1394
1412
|
*
|
|
1395
1413
|
* **Example** (Type-guarding an unknown value)
|
|
1396
1414
|
*
|
|
@@ -1417,8 +1435,8 @@ export declare const isArray: {
|
|
|
1417
1435
|
*
|
|
1418
1436
|
* **Details**
|
|
1419
1437
|
*
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1438
|
+
* Acts as a type guard narrowing the input to `Array<unknown>` and delegates to
|
|
1439
|
+
* `globalThis.Array.isArray`.
|
|
1422
1440
|
*
|
|
1423
1441
|
* **Example** (Type-guarding an unknown value)
|
|
1424
1442
|
*
|
|
@@ -1479,6 +1497,11 @@ export declare const isReadonlyArrayEmpty: <A>(self: ReadonlyArray<A>) => self i
|
|
|
1479
1497
|
* Checks whether a mutable `Array` is non-empty, narrowing the type to
|
|
1480
1498
|
* `NonEmptyArray`.
|
|
1481
1499
|
*
|
|
1500
|
+
* **When to use**
|
|
1501
|
+
*
|
|
1502
|
+
* Use when you need the narrowed value to remain a mutable `Array` after proving
|
|
1503
|
+
* it has at least one element.
|
|
1504
|
+
*
|
|
1482
1505
|
* **Example** (Checking for a non-empty array)
|
|
1483
1506
|
*
|
|
1484
1507
|
* ```ts
|
|
@@ -1499,6 +1522,11 @@ export declare const isArrayNonEmpty: <A>(self: Array<A>) => self is NonEmptyArr
|
|
|
1499
1522
|
* Checks whether a `ReadonlyArray` is non-empty, narrowing the type to
|
|
1500
1523
|
* `NonEmptyReadonlyArray`.
|
|
1501
1524
|
*
|
|
1525
|
+
* **When to use**
|
|
1526
|
+
*
|
|
1527
|
+
* Use when you need to prove a readonly array has at least one element without
|
|
1528
|
+
* requiring mutable array methods afterward.
|
|
1529
|
+
*
|
|
1502
1530
|
* **Example** (Checking for a non-empty readonly array)
|
|
1503
1531
|
*
|
|
1504
1532
|
* ```ts
|
|
@@ -1545,8 +1573,7 @@ export declare const length: <A>(self: ReadonlyArray<A>) => number;
|
|
|
1545
1573
|
*
|
|
1546
1574
|
* **Details**
|
|
1547
1575
|
*
|
|
1548
|
-
*
|
|
1549
|
-
* - Never throws.
|
|
1576
|
+
* The index is floored to an integer. This never throws.
|
|
1550
1577
|
*
|
|
1551
1578
|
* **Example** (Safe index access)
|
|
1552
1579
|
*
|
|
@@ -1576,8 +1603,7 @@ export declare const get: {
|
|
|
1576
1603
|
*
|
|
1577
1604
|
* **Details**
|
|
1578
1605
|
*
|
|
1579
|
-
*
|
|
1580
|
-
* - Never throws.
|
|
1606
|
+
* The index is floored to an integer. This never throws.
|
|
1581
1607
|
*
|
|
1582
1608
|
* **Example** (Safe index access)
|
|
1583
1609
|
*
|
|
@@ -1607,8 +1633,7 @@ export declare const get: {
|
|
|
1607
1633
|
*
|
|
1608
1634
|
* **Details**
|
|
1609
1635
|
*
|
|
1610
|
-
*
|
|
1611
|
-
* - Never throws.
|
|
1636
|
+
* The index is floored to an integer. This never throws.
|
|
1612
1637
|
*
|
|
1613
1638
|
* **Example** (Safe index access)
|
|
1614
1639
|
*
|
|
@@ -1633,13 +1658,13 @@ export declare const get: {
|
|
|
1633
1658
|
*
|
|
1634
1659
|
* **When to use**
|
|
1635
1660
|
*
|
|
1636
|
-
* Use to read an element at a known valid index when out-of-bounds would
|
|
1637
|
-
* programming error.
|
|
1661
|
+
* Use to read an array element at a known valid index when out-of-bounds would
|
|
1662
|
+
* be a programming error.
|
|
1638
1663
|
*
|
|
1639
1664
|
* **Details**
|
|
1640
1665
|
*
|
|
1641
|
-
*
|
|
1642
|
-
*
|
|
1666
|
+
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1667
|
+
* `get` for safe access.
|
|
1643
1668
|
*
|
|
1644
1669
|
* **Example** (Unsafe index access)
|
|
1645
1670
|
*
|
|
@@ -1661,13 +1686,13 @@ export declare const getUnsafe: {
|
|
|
1661
1686
|
*
|
|
1662
1687
|
* **When to use**
|
|
1663
1688
|
*
|
|
1664
|
-
* Use to read an element at a known valid index when out-of-bounds would
|
|
1665
|
-
* programming error.
|
|
1689
|
+
* Use to read an array element at a known valid index when out-of-bounds would
|
|
1690
|
+
* be a programming error.
|
|
1666
1691
|
*
|
|
1667
1692
|
* **Details**
|
|
1668
1693
|
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1694
|
+
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1695
|
+
* `get` for safe access.
|
|
1671
1696
|
*
|
|
1672
1697
|
* **Example** (Unsafe index access)
|
|
1673
1698
|
*
|
|
@@ -1689,13 +1714,13 @@ export declare const getUnsafe: {
|
|
|
1689
1714
|
*
|
|
1690
1715
|
* **When to use**
|
|
1691
1716
|
*
|
|
1692
|
-
* Use to read an element at a known valid index when out-of-bounds would
|
|
1693
|
-
* programming error.
|
|
1717
|
+
* Use to read an array element at a known valid index when out-of-bounds would
|
|
1718
|
+
* be a programming error.
|
|
1694
1719
|
*
|
|
1695
1720
|
* **Details**
|
|
1696
1721
|
*
|
|
1697
|
-
*
|
|
1698
|
-
*
|
|
1722
|
+
* Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
|
|
1723
|
+
* `get` for safe access.
|
|
1699
1724
|
*
|
|
1700
1725
|
* **Example** (Unsafe index access)
|
|
1701
1726
|
*
|
|
@@ -1723,8 +1748,7 @@ export declare const getUnsafe: {
|
|
|
1723
1748
|
*
|
|
1724
1749
|
* **Details**
|
|
1725
1750
|
*
|
|
1726
|
-
*
|
|
1727
|
-
* - Requires a `NonEmptyReadonlyArray`.
|
|
1751
|
+
* Returns a tuple `[head, tail]` and requires a `NonEmptyReadonlyArray`.
|
|
1728
1752
|
*
|
|
1729
1753
|
* **Example** (Destructuring head and tail)
|
|
1730
1754
|
*
|
|
@@ -1749,13 +1773,12 @@ export declare const unprepend: <A>(self: NonEmptyReadonlyArray<A>) => [firstEle
|
|
|
1749
1773
|
*
|
|
1750
1774
|
* **When to use**
|
|
1751
1775
|
*
|
|
1752
|
-
* Use to split a non-empty array
|
|
1753
|
-
*
|
|
1776
|
+
* Use when you need to split a non-empty array into the elements before the
|
|
1777
|
+
* last element and the last element.
|
|
1754
1778
|
*
|
|
1755
1779
|
* **Details**
|
|
1756
1780
|
*
|
|
1757
|
-
*
|
|
1758
|
-
* - Requires a `NonEmptyReadonlyArray`.
|
|
1781
|
+
* Returns a tuple `[init, last]` and requires a `NonEmptyReadonlyArray`.
|
|
1759
1782
|
*
|
|
1760
1783
|
* **Example** (Destructuring init and last)
|
|
1761
1784
|
*
|
|
@@ -1877,8 +1900,7 @@ export declare const lastNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => A;
|
|
|
1877
1900
|
*
|
|
1878
1901
|
* **Details**
|
|
1879
1902
|
*
|
|
1880
|
-
*
|
|
1881
|
-
* - Returns `Option.none()` for empty inputs.
|
|
1903
|
+
* Allocates a new array via `slice(1)`. Empty inputs return `Option.none()`.
|
|
1882
1904
|
*
|
|
1883
1905
|
* **Example** (Getting the tail)
|
|
1884
1906
|
*
|
|
@@ -1927,8 +1949,8 @@ export declare const tailNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => Array<
|
|
|
1927
1949
|
*
|
|
1928
1950
|
* **Details**
|
|
1929
1951
|
*
|
|
1930
|
-
*
|
|
1931
|
-
*
|
|
1952
|
+
* Allocates a new array via `slice(0, -1)`. Empty inputs return
|
|
1953
|
+
* `Option.none()`.
|
|
1932
1954
|
*
|
|
1933
1955
|
* **Example** (Getting init)
|
|
1934
1956
|
*
|
|
@@ -1977,8 +1999,7 @@ export declare const initNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => Array<
|
|
|
1977
1999
|
*
|
|
1978
2000
|
* **Details**
|
|
1979
2001
|
*
|
|
1980
|
-
*
|
|
1981
|
-
* - Returns an empty array when `n <= 0`.
|
|
2002
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
1982
2003
|
*
|
|
1983
2004
|
* **Example** (Taking from the start)
|
|
1984
2005
|
*
|
|
@@ -2005,8 +2026,7 @@ export declare const take: {
|
|
|
2005
2026
|
*
|
|
2006
2027
|
* **Details**
|
|
2007
2028
|
*
|
|
2008
|
-
*
|
|
2009
|
-
* - Returns an empty array when `n <= 0`.
|
|
2029
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2010
2030
|
*
|
|
2011
2031
|
* **Example** (Taking from the start)
|
|
2012
2032
|
*
|
|
@@ -2033,8 +2053,7 @@ export declare const take: {
|
|
|
2033
2053
|
*
|
|
2034
2054
|
* **Details**
|
|
2035
2055
|
*
|
|
2036
|
-
*
|
|
2037
|
-
* - Returns an empty array when `n <= 0`.
|
|
2056
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2038
2057
|
*
|
|
2039
2058
|
* **Example** (Taking from the start)
|
|
2040
2059
|
*
|
|
@@ -2062,8 +2081,7 @@ export declare const take: {
|
|
|
2062
2081
|
*
|
|
2063
2082
|
* **Details**
|
|
2064
2083
|
*
|
|
2065
|
-
*
|
|
2066
|
-
* - Returns an empty array when `n <= 0`.
|
|
2084
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2067
2085
|
*
|
|
2068
2086
|
* **Example** (Taking from the end)
|
|
2069
2087
|
*
|
|
@@ -2089,8 +2107,7 @@ export declare const takeRight: {
|
|
|
2089
2107
|
*
|
|
2090
2108
|
* **Details**
|
|
2091
2109
|
*
|
|
2092
|
-
*
|
|
2093
|
-
* - Returns an empty array when `n <= 0`.
|
|
2110
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2094
2111
|
*
|
|
2095
2112
|
* **Example** (Taking from the end)
|
|
2096
2113
|
*
|
|
@@ -2116,8 +2133,7 @@ export declare const takeRight: {
|
|
|
2116
2133
|
*
|
|
2117
2134
|
* **Details**
|
|
2118
2135
|
*
|
|
2119
|
-
*
|
|
2120
|
-
* - Returns an empty array when `n <= 0`.
|
|
2136
|
+
* `n` is clamped to `[0, length]`. Returns an empty array when `n <= 0`.
|
|
2121
2137
|
*
|
|
2122
2138
|
* **Example** (Taking from the end)
|
|
2123
2139
|
*
|
|
@@ -2146,8 +2162,8 @@ export declare const takeRight: {
|
|
|
2146
2162
|
*
|
|
2147
2163
|
* **Details**
|
|
2148
2164
|
*
|
|
2149
|
-
*
|
|
2150
|
-
*
|
|
2165
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2166
|
+
* `(element, index)`.
|
|
2151
2167
|
*
|
|
2152
2168
|
* **Example** (Taking while condition holds)
|
|
2153
2169
|
*
|
|
@@ -2176,8 +2192,8 @@ export declare const takeWhile: {
|
|
|
2176
2192
|
*
|
|
2177
2193
|
* **Details**
|
|
2178
2194
|
*
|
|
2179
|
-
*
|
|
2180
|
-
*
|
|
2195
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2196
|
+
* `(element, index)`.
|
|
2181
2197
|
*
|
|
2182
2198
|
* **Example** (Taking while condition holds)
|
|
2183
2199
|
*
|
|
@@ -2206,8 +2222,8 @@ export declare const takeWhile: {
|
|
|
2206
2222
|
*
|
|
2207
2223
|
* **Details**
|
|
2208
2224
|
*
|
|
2209
|
-
*
|
|
2210
|
-
*
|
|
2225
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2226
|
+
* `(element, index)`.
|
|
2211
2227
|
*
|
|
2212
2228
|
* **Example** (Taking while condition holds)
|
|
2213
2229
|
*
|
|
@@ -2236,8 +2252,8 @@ export declare const takeWhile: {
|
|
|
2236
2252
|
*
|
|
2237
2253
|
* **Details**
|
|
2238
2254
|
*
|
|
2239
|
-
*
|
|
2240
|
-
*
|
|
2255
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2256
|
+
* `(element, index)`.
|
|
2241
2257
|
*
|
|
2242
2258
|
* **Example** (Taking while condition holds)
|
|
2243
2259
|
*
|
|
@@ -2266,8 +2282,8 @@ export declare const takeWhile: {
|
|
|
2266
2282
|
*
|
|
2267
2283
|
* **Details**
|
|
2268
2284
|
*
|
|
2269
|
-
*
|
|
2270
|
-
*
|
|
2285
|
+
* Supports refinements for type narrowing. The predicate receives
|
|
2286
|
+
* `(element, index)`.
|
|
2271
2287
|
*
|
|
2272
2288
|
* **Example** (Taking while condition holds)
|
|
2273
2289
|
*
|
|
@@ -2291,14 +2307,14 @@ export declare const takeWhile: {
|
|
|
2291
2307
|
*
|
|
2292
2308
|
* **When to use**
|
|
2293
2309
|
*
|
|
2294
|
-
* Use when you need to take a prefix
|
|
2295
|
-
* successfully extract or transform
|
|
2310
|
+
* Use when you need to take a prefix from an iterable while a function can
|
|
2311
|
+
* successfully extract or transform elements, stopping at the first element
|
|
2296
2312
|
* that produces a failure result.
|
|
2297
2313
|
*
|
|
2298
2314
|
* **Details**
|
|
2299
2315
|
*
|
|
2300
|
-
*
|
|
2301
|
-
*
|
|
2316
|
+
* The filter receives `(element, index)` and processing stops at the first
|
|
2317
|
+
* filter failure.
|
|
2302
2318
|
*
|
|
2303
2319
|
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2304
2320
|
*
|
|
@@ -2311,14 +2327,14 @@ export declare const takeWhileFilter: {
|
|
|
2311
2327
|
*
|
|
2312
2328
|
* **When to use**
|
|
2313
2329
|
*
|
|
2314
|
-
* Use when you need to take a prefix
|
|
2315
|
-
* successfully extract or transform
|
|
2330
|
+
* Use when you need to take a prefix from an iterable while a function can
|
|
2331
|
+
* successfully extract or transform elements, stopping at the first element
|
|
2316
2332
|
* that produces a failure result.
|
|
2317
2333
|
*
|
|
2318
2334
|
* **Details**
|
|
2319
2335
|
*
|
|
2320
|
-
*
|
|
2321
|
-
*
|
|
2336
|
+
* The filter receives `(element, index)` and processing stops at the first
|
|
2337
|
+
* filter failure.
|
|
2322
2338
|
*
|
|
2323
2339
|
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2324
2340
|
*
|
|
@@ -2331,14 +2347,14 @@ export declare const takeWhileFilter: {
|
|
|
2331
2347
|
*
|
|
2332
2348
|
* **When to use**
|
|
2333
2349
|
*
|
|
2334
|
-
* Use when you need to take a prefix
|
|
2335
|
-
* successfully extract or transform
|
|
2350
|
+
* Use when you need to take a prefix from an iterable while a function can
|
|
2351
|
+
* successfully extract or transform elements, stopping at the first element
|
|
2336
2352
|
* that produces a failure result.
|
|
2337
2353
|
*
|
|
2338
2354
|
* **Details**
|
|
2339
2355
|
*
|
|
2340
|
-
*
|
|
2341
|
-
*
|
|
2356
|
+
* The filter receives `(element, index)` and processing stops at the first
|
|
2357
|
+
* filter failure.
|
|
2342
2358
|
*
|
|
2343
2359
|
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
2344
2360
|
*
|
|
@@ -2353,14 +2369,14 @@ export declare const takeWhileFilter: {
|
|
|
2353
2369
|
*
|
|
2354
2370
|
* **When to use**
|
|
2355
2371
|
*
|
|
2356
|
-
* Use
|
|
2357
|
-
*
|
|
2372
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2373
|
+
* remaining elements.
|
|
2358
2374
|
*
|
|
2359
2375
|
* **Details**
|
|
2360
2376
|
*
|
|
2361
|
-
*
|
|
2362
|
-
*
|
|
2363
|
-
*
|
|
2377
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2378
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2379
|
+
* the prefix.
|
|
2364
2380
|
*
|
|
2365
2381
|
* **Example** (Splitting at predicate boundary)
|
|
2366
2382
|
*
|
|
@@ -2384,14 +2400,14 @@ export declare const span: {
|
|
|
2384
2400
|
*
|
|
2385
2401
|
* **When to use**
|
|
2386
2402
|
*
|
|
2387
|
-
* Use
|
|
2388
|
-
*
|
|
2403
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2404
|
+
* remaining elements.
|
|
2389
2405
|
*
|
|
2390
2406
|
* **Details**
|
|
2391
2407
|
*
|
|
2392
|
-
*
|
|
2393
|
-
*
|
|
2394
|
-
*
|
|
2408
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2409
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2410
|
+
* the prefix.
|
|
2395
2411
|
*
|
|
2396
2412
|
* **Example** (Splitting at predicate boundary)
|
|
2397
2413
|
*
|
|
@@ -2415,14 +2431,14 @@ export declare const span: {
|
|
|
2415
2431
|
*
|
|
2416
2432
|
* **When to use**
|
|
2417
2433
|
*
|
|
2418
|
-
* Use
|
|
2419
|
-
*
|
|
2434
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2435
|
+
* remaining elements.
|
|
2420
2436
|
*
|
|
2421
2437
|
* **Details**
|
|
2422
2438
|
*
|
|
2423
|
-
*
|
|
2424
|
-
*
|
|
2425
|
-
*
|
|
2439
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2440
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2441
|
+
* the prefix.
|
|
2426
2442
|
*
|
|
2427
2443
|
* **Example** (Splitting at predicate boundary)
|
|
2428
2444
|
*
|
|
@@ -2446,14 +2462,14 @@ export declare const span: {
|
|
|
2446
2462
|
*
|
|
2447
2463
|
* **When to use**
|
|
2448
2464
|
*
|
|
2449
|
-
* Use
|
|
2450
|
-
*
|
|
2465
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2466
|
+
* remaining elements.
|
|
2451
2467
|
*
|
|
2452
2468
|
* **Details**
|
|
2453
2469
|
*
|
|
2454
|
-
*
|
|
2455
|
-
*
|
|
2456
|
-
*
|
|
2470
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2471
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2472
|
+
* the prefix.
|
|
2457
2473
|
*
|
|
2458
2474
|
* **Example** (Splitting at predicate boundary)
|
|
2459
2475
|
*
|
|
@@ -2477,14 +2493,14 @@ export declare const span: {
|
|
|
2477
2493
|
*
|
|
2478
2494
|
* **When to use**
|
|
2479
2495
|
*
|
|
2480
|
-
* Use
|
|
2481
|
-
*
|
|
2496
|
+
* Use when you need both the longest predicate-matching prefix and the
|
|
2497
|
+
* remaining elements.
|
|
2482
2498
|
*
|
|
2483
2499
|
* **Details**
|
|
2484
2500
|
*
|
|
2485
|
-
*
|
|
2486
|
-
*
|
|
2487
|
-
*
|
|
2501
|
+
* Equivalent to `[takeWhile(pred), dropWhile(pred)]`, but more efficient
|
|
2502
|
+
* because it runs in a single pass. Supports refinements for type narrowing of
|
|
2503
|
+
* the prefix.
|
|
2488
2504
|
*
|
|
2489
2505
|
* **Example** (Splitting at predicate boundary)
|
|
2490
2506
|
*
|
|
@@ -2513,8 +2529,8 @@ export declare const span: {
|
|
|
2513
2529
|
*
|
|
2514
2530
|
* **Details**
|
|
2515
2531
|
*
|
|
2516
|
-
*
|
|
2517
|
-
*
|
|
2532
|
+
* `n` is clamped to `[0, length]`. When `n <= 0`, this returns a copy of the
|
|
2533
|
+
* full array.
|
|
2518
2534
|
*
|
|
2519
2535
|
* **Example** (Dropping from the start)
|
|
2520
2536
|
*
|
|
@@ -2542,8 +2558,8 @@ export declare const drop: {
|
|
|
2542
2558
|
*
|
|
2543
2559
|
* **Details**
|
|
2544
2560
|
*
|
|
2545
|
-
*
|
|
2546
|
-
*
|
|
2561
|
+
* `n` is clamped to `[0, length]`. When `n <= 0`, this returns a copy of the
|
|
2562
|
+
* full array.
|
|
2547
2563
|
*
|
|
2548
2564
|
* **Example** (Dropping from the start)
|
|
2549
2565
|
*
|
|
@@ -2571,8 +2587,8 @@ export declare const drop: {
|
|
|
2571
2587
|
*
|
|
2572
2588
|
* **Details**
|
|
2573
2589
|
*
|
|
2574
|
-
*
|
|
2575
|
-
*
|
|
2590
|
+
* `n` is clamped to `[0, length]`. When `n <= 0`, this returns a copy of the
|
|
2591
|
+
* full array.
|
|
2576
2592
|
*
|
|
2577
2593
|
* **Example** (Dropping from the start)
|
|
2578
2594
|
*
|
|
@@ -2754,13 +2770,13 @@ export declare const dropWhile: {
|
|
|
2754
2770
|
*
|
|
2755
2771
|
* **When to use**
|
|
2756
2772
|
*
|
|
2757
|
-
* Use when
|
|
2758
|
-
* of a simple boolean predicate.
|
|
2773
|
+
* Use when you need to drop a prefix from an iterable by computing a `Result`
|
|
2774
|
+
* per element instead of using a simple boolean predicate.
|
|
2759
2775
|
*
|
|
2760
2776
|
* **Details**
|
|
2761
2777
|
*
|
|
2762
|
-
*
|
|
2763
|
-
*
|
|
2778
|
+
* The filter receives `(element, index)`. The result contains the remaining
|
|
2779
|
+
* original elements after the first filter failure.
|
|
2764
2780
|
*
|
|
2765
2781
|
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
2766
2782
|
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
@@ -2774,13 +2790,13 @@ export declare const dropWhileFilter: {
|
|
|
2774
2790
|
*
|
|
2775
2791
|
* **When to use**
|
|
2776
2792
|
*
|
|
2777
|
-
* Use when
|
|
2778
|
-
* of a simple boolean predicate.
|
|
2793
|
+
* Use when you need to drop a prefix from an iterable by computing a `Result`
|
|
2794
|
+
* per element instead of using a simple boolean predicate.
|
|
2779
2795
|
*
|
|
2780
2796
|
* **Details**
|
|
2781
2797
|
*
|
|
2782
|
-
*
|
|
2783
|
-
*
|
|
2798
|
+
* The filter receives `(element, index)`. The result contains the remaining
|
|
2799
|
+
* original elements after the first filter failure.
|
|
2784
2800
|
*
|
|
2785
2801
|
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
2786
2802
|
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
@@ -2794,13 +2810,13 @@ export declare const dropWhileFilter: {
|
|
|
2794
2810
|
*
|
|
2795
2811
|
* **When to use**
|
|
2796
2812
|
*
|
|
2797
|
-
* Use when
|
|
2798
|
-
* of a simple boolean predicate.
|
|
2813
|
+
* Use when you need to drop a prefix from an iterable by computing a `Result`
|
|
2814
|
+
* per element instead of using a simple boolean predicate.
|
|
2799
2815
|
*
|
|
2800
2816
|
* **Details**
|
|
2801
2817
|
*
|
|
2802
|
-
*
|
|
2803
|
-
*
|
|
2818
|
+
* The filter receives `(element, index)`. The result contains the remaining
|
|
2819
|
+
* original elements after the first filter failure.
|
|
2804
2820
|
*
|
|
2805
2821
|
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
2806
2822
|
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
@@ -2964,9 +2980,9 @@ export declare const findLastIndex: {
|
|
|
2964
2980
|
*
|
|
2965
2981
|
* **Details**
|
|
2966
2982
|
*
|
|
2967
|
-
*
|
|
2968
|
-
*
|
|
2969
|
-
*
|
|
2983
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
2984
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
2985
|
+
* matches, this returns `Option.none()`.
|
|
2970
2986
|
*
|
|
2971
2987
|
* **Example** (Finding the first match)
|
|
2972
2988
|
*
|
|
@@ -2995,9 +3011,9 @@ export declare const findFirst: {
|
|
|
2995
3011
|
*
|
|
2996
3012
|
* **Details**
|
|
2997
3013
|
*
|
|
2998
|
-
*
|
|
2999
|
-
*
|
|
3000
|
-
*
|
|
3014
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3015
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3016
|
+
* matches, this returns `Option.none()`.
|
|
3001
3017
|
*
|
|
3002
3018
|
* **Example** (Finding the first match)
|
|
3003
3019
|
*
|
|
@@ -3026,9 +3042,9 @@ export declare const findFirst: {
|
|
|
3026
3042
|
*
|
|
3027
3043
|
* **Details**
|
|
3028
3044
|
*
|
|
3029
|
-
*
|
|
3030
|
-
*
|
|
3031
|
-
*
|
|
3045
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3046
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3047
|
+
* matches, this returns `Option.none()`.
|
|
3032
3048
|
*
|
|
3033
3049
|
* **Example** (Finding the first match)
|
|
3034
3050
|
*
|
|
@@ -3057,9 +3073,9 @@ export declare const findFirst: {
|
|
|
3057
3073
|
*
|
|
3058
3074
|
* **Details**
|
|
3059
3075
|
*
|
|
3060
|
-
*
|
|
3061
|
-
*
|
|
3062
|
-
*
|
|
3076
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3077
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3078
|
+
* matches, this returns `Option.none()`.
|
|
3063
3079
|
*
|
|
3064
3080
|
* **Example** (Finding the first match)
|
|
3065
3081
|
*
|
|
@@ -3088,9 +3104,9 @@ export declare const findFirst: {
|
|
|
3088
3104
|
*
|
|
3089
3105
|
* **Details**
|
|
3090
3106
|
*
|
|
3091
|
-
*
|
|
3092
|
-
*
|
|
3093
|
-
*
|
|
3107
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3108
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3109
|
+
* matches, this returns `Option.none()`.
|
|
3094
3110
|
*
|
|
3095
3111
|
* **Example** (Finding the first match)
|
|
3096
3112
|
*
|
|
@@ -3119,9 +3135,9 @@ export declare const findFirst: {
|
|
|
3119
3135
|
*
|
|
3120
3136
|
* **Details**
|
|
3121
3137
|
*
|
|
3122
|
-
*
|
|
3123
|
-
*
|
|
3124
|
-
*
|
|
3138
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3139
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3140
|
+
* matches, this returns `Option.none()`.
|
|
3125
3141
|
*
|
|
3126
3142
|
* **Example** (Finding the first match)
|
|
3127
3143
|
*
|
|
@@ -3150,9 +3166,9 @@ export declare const findFirst: {
|
|
|
3150
3166
|
*
|
|
3151
3167
|
* **Details**
|
|
3152
3168
|
*
|
|
3153
|
-
*
|
|
3154
|
-
*
|
|
3155
|
-
*
|
|
3169
|
+
* Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
3170
|
+
* `(a, i) => Option<B>` for simultaneous find-and-transform. If no element
|
|
3171
|
+
* matches, this returns `Option.none()`.
|
|
3156
3172
|
*
|
|
3157
3173
|
* **Example** (Finding the first match)
|
|
3158
3174
|
*
|
|
@@ -3385,8 +3401,8 @@ export declare const findFirstWithIndex: {
|
|
|
3385
3401
|
*
|
|
3386
3402
|
* **Details**
|
|
3387
3403
|
*
|
|
3388
|
-
*
|
|
3389
|
-
*
|
|
3404
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3405
|
+
* `Option.none()`.
|
|
3390
3406
|
*
|
|
3391
3407
|
* **Example** (Finding the last match)
|
|
3392
3408
|
*
|
|
@@ -3413,8 +3429,8 @@ export declare const findLast: {
|
|
|
3413
3429
|
*
|
|
3414
3430
|
* **Details**
|
|
3415
3431
|
*
|
|
3416
|
-
*
|
|
3417
|
-
*
|
|
3432
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3433
|
+
* `Option.none()`.
|
|
3418
3434
|
*
|
|
3419
3435
|
* **Example** (Finding the last match)
|
|
3420
3436
|
*
|
|
@@ -3441,8 +3457,8 @@ export declare const findLast: {
|
|
|
3441
3457
|
*
|
|
3442
3458
|
* **Details**
|
|
3443
3459
|
*
|
|
3444
|
-
*
|
|
3445
|
-
*
|
|
3460
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3461
|
+
* `Option.none()`.
|
|
3446
3462
|
*
|
|
3447
3463
|
* **Example** (Finding the last match)
|
|
3448
3464
|
*
|
|
@@ -3469,8 +3485,8 @@ export declare const findLast: {
|
|
|
3469
3485
|
*
|
|
3470
3486
|
* **Details**
|
|
3471
3487
|
*
|
|
3472
|
-
*
|
|
3473
|
-
*
|
|
3488
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3489
|
+
* `Option.none()`.
|
|
3474
3490
|
*
|
|
3475
3491
|
* **Example** (Finding the last match)
|
|
3476
3492
|
*
|
|
@@ -3497,8 +3513,8 @@ export declare const findLast: {
|
|
|
3497
3513
|
*
|
|
3498
3514
|
* **Details**
|
|
3499
3515
|
*
|
|
3500
|
-
*
|
|
3501
|
-
*
|
|
3516
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3517
|
+
* `Option.none()`.
|
|
3502
3518
|
*
|
|
3503
3519
|
* **Example** (Finding the last match)
|
|
3504
3520
|
*
|
|
@@ -3525,8 +3541,8 @@ export declare const findLast: {
|
|
|
3525
3541
|
*
|
|
3526
3542
|
* **Details**
|
|
3527
3543
|
*
|
|
3528
|
-
*
|
|
3529
|
-
*
|
|
3544
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3545
|
+
* `Option.none()`.
|
|
3530
3546
|
*
|
|
3531
3547
|
* **Example** (Finding the last match)
|
|
3532
3548
|
*
|
|
@@ -3553,8 +3569,8 @@ export declare const findLast: {
|
|
|
3553
3569
|
*
|
|
3554
3570
|
* **Details**
|
|
3555
3571
|
*
|
|
3556
|
-
*
|
|
3557
|
-
*
|
|
3572
|
+
* Searches from the end of the array. If no element matches, this returns
|
|
3573
|
+
* `Option.none()`.
|
|
3558
3574
|
*
|
|
3559
3575
|
* **Example** (Finding the last match)
|
|
3560
3576
|
*
|
|
@@ -3582,7 +3598,7 @@ export declare const findLast: {
|
|
|
3582
3598
|
*
|
|
3583
3599
|
* **Details**
|
|
3584
3600
|
*
|
|
3585
|
-
*
|
|
3601
|
+
* Valid indices are `0` to `length`, inclusive. Inserting at `length` appends.
|
|
3586
3602
|
*
|
|
3587
3603
|
* **Example** (Inserting at an index)
|
|
3588
3604
|
*
|
|
@@ -3609,7 +3625,7 @@ export declare const insertAt: {
|
|
|
3609
3625
|
*
|
|
3610
3626
|
* **Details**
|
|
3611
3627
|
*
|
|
3612
|
-
*
|
|
3628
|
+
* Valid indices are `0` to `length`, inclusive. Inserting at `length` appends.
|
|
3613
3629
|
*
|
|
3614
3630
|
* **Example** (Inserting at an index)
|
|
3615
3631
|
*
|
|
@@ -3636,7 +3652,7 @@ export declare const insertAt: {
|
|
|
3636
3652
|
*
|
|
3637
3653
|
* **Details**
|
|
3638
3654
|
*
|
|
3639
|
-
*
|
|
3655
|
+
* Valid indices are `0` to `length`, inclusive. Inserting at `length` appends.
|
|
3640
3656
|
*
|
|
3641
3657
|
* **Example** (Inserting at an index)
|
|
3642
3658
|
*
|
|
@@ -3664,7 +3680,7 @@ export declare const insertAt: {
|
|
|
3664
3680
|
*
|
|
3665
3681
|
* **Details**
|
|
3666
3682
|
*
|
|
3667
|
-
*
|
|
3683
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
3668
3684
|
*
|
|
3669
3685
|
* **Example** (Replacing an element)
|
|
3670
3686
|
*
|
|
@@ -3691,7 +3707,7 @@ export declare const replace: {
|
|
|
3691
3707
|
*
|
|
3692
3708
|
* **Details**
|
|
3693
3709
|
*
|
|
3694
|
-
*
|
|
3710
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
3695
3711
|
*
|
|
3696
3712
|
* **Example** (Replacing an element)
|
|
3697
3713
|
*
|
|
@@ -3718,7 +3734,7 @@ export declare const replace: {
|
|
|
3718
3734
|
*
|
|
3719
3735
|
* **Details**
|
|
3720
3736
|
*
|
|
3721
|
-
*
|
|
3737
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
3722
3738
|
*
|
|
3723
3739
|
* **Example** (Replacing an element)
|
|
3724
3740
|
*
|
|
@@ -3742,12 +3758,12 @@ export declare const replace: {
|
|
|
3742
3758
|
*
|
|
3743
3759
|
* **When to use**
|
|
3744
3760
|
*
|
|
3745
|
-
* Use to derive a replacement value from
|
|
3746
|
-
*
|
|
3761
|
+
* Use to derive a replacement value from an array element at a specific index
|
|
3762
|
+
* while leaving the other elements unchanged.
|
|
3747
3763
|
*
|
|
3748
3764
|
* **Details**
|
|
3749
3765
|
*
|
|
3750
|
-
*
|
|
3766
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
3751
3767
|
*
|
|
3752
3768
|
* **Example** (Modifying an element)
|
|
3753
3769
|
*
|
|
@@ -3772,12 +3788,12 @@ export declare const modify: {
|
|
|
3772
3788
|
*
|
|
3773
3789
|
* **When to use**
|
|
3774
3790
|
*
|
|
3775
|
-
* Use to derive a replacement value from
|
|
3776
|
-
*
|
|
3791
|
+
* Use to derive a replacement value from an array element at a specific index
|
|
3792
|
+
* while leaving the other elements unchanged.
|
|
3777
3793
|
*
|
|
3778
3794
|
* **Details**
|
|
3779
3795
|
*
|
|
3780
|
-
*
|
|
3796
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
3781
3797
|
*
|
|
3782
3798
|
* **Example** (Modifying an element)
|
|
3783
3799
|
*
|
|
@@ -3802,12 +3818,12 @@ export declare const modify: {
|
|
|
3802
3818
|
*
|
|
3803
3819
|
* **When to use**
|
|
3804
3820
|
*
|
|
3805
|
-
* Use to derive a replacement value from
|
|
3806
|
-
*
|
|
3821
|
+
* Use to derive a replacement value from an array element at a specific index
|
|
3822
|
+
* while leaving the other elements unchanged.
|
|
3807
3823
|
*
|
|
3808
3824
|
* **Details**
|
|
3809
3825
|
*
|
|
3810
|
-
*
|
|
3826
|
+
* Returns `Option.none()` when the index is out of bounds.
|
|
3811
3827
|
*
|
|
3812
3828
|
* **Example** (Modifying an element)
|
|
3813
3829
|
*
|
|
@@ -3833,7 +3849,8 @@ export declare const modify: {
|
|
|
3833
3849
|
*
|
|
3834
3850
|
* **When to use**
|
|
3835
3851
|
*
|
|
3836
|
-
* Use to
|
|
3852
|
+
* Use when you want a missing index to be a no-op and need a fresh array result
|
|
3853
|
+
* instead of an optional failure.
|
|
3837
3854
|
*
|
|
3838
3855
|
* **Example** (Removing an element)
|
|
3839
3856
|
*
|
|
@@ -3857,7 +3874,8 @@ export declare const remove: {
|
|
|
3857
3874
|
*
|
|
3858
3875
|
* **When to use**
|
|
3859
3876
|
*
|
|
3860
|
-
* Use to
|
|
3877
|
+
* Use when you want a missing index to be a no-op and need a fresh array result
|
|
3878
|
+
* instead of an optional failure.
|
|
3861
3879
|
*
|
|
3862
3880
|
* **Example** (Removing an element)
|
|
3863
3881
|
*
|
|
@@ -3881,7 +3899,8 @@ export declare const remove: {
|
|
|
3881
3899
|
*
|
|
3882
3900
|
* **When to use**
|
|
3883
3901
|
*
|
|
3884
|
-
* Use to
|
|
3902
|
+
* Use when you want a missing index to be a no-op and need a fresh array result
|
|
3903
|
+
* instead of an optional failure.
|
|
3885
3904
|
*
|
|
3886
3905
|
* **Example** (Removing an element)
|
|
3887
3906
|
*
|
|
@@ -3905,11 +3924,12 @@ export declare const remove: {
|
|
|
3905
3924
|
*
|
|
3906
3925
|
* **When to use**
|
|
3907
3926
|
*
|
|
3908
|
-
* Use to reverse
|
|
3927
|
+
* Use to reverse an iterable into a new array without mutating the original
|
|
3928
|
+
* input.
|
|
3909
3929
|
*
|
|
3910
3930
|
* **Details**
|
|
3911
3931
|
*
|
|
3912
|
-
*
|
|
3932
|
+
* Preserves `NonEmptyArray` in the return type.
|
|
3913
3933
|
*
|
|
3914
3934
|
* **Example** (Reversing an array)
|
|
3915
3935
|
*
|
|
@@ -3932,9 +3952,8 @@ export declare const reverse: <S extends Iterable<any>>(self: S) => S extends No
|
|
|
3932
3952
|
*
|
|
3933
3953
|
* **Details**
|
|
3934
3954
|
*
|
|
3935
|
-
*
|
|
3936
|
-
*
|
|
3937
|
-
* multi-key sorting.
|
|
3955
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
3956
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
3938
3957
|
*
|
|
3939
3958
|
* **Example** (Sorting numbers)
|
|
3940
3959
|
*
|
|
@@ -3960,9 +3979,8 @@ export declare const sort: {
|
|
|
3960
3979
|
*
|
|
3961
3980
|
* **Details**
|
|
3962
3981
|
*
|
|
3963
|
-
*
|
|
3964
|
-
*
|
|
3965
|
-
* multi-key sorting.
|
|
3982
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
3983
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
3966
3984
|
*
|
|
3967
3985
|
* **Example** (Sorting numbers)
|
|
3968
3986
|
*
|
|
@@ -3988,9 +4006,8 @@ export declare const sort: {
|
|
|
3988
4006
|
*
|
|
3989
4007
|
* **Details**
|
|
3990
4008
|
*
|
|
3991
|
-
*
|
|
3992
|
-
*
|
|
3993
|
-
* multi-key sorting.
|
|
4009
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4010
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
3994
4011
|
*
|
|
3995
4012
|
* **Example** (Sorting numbers)
|
|
3996
4013
|
*
|
|
@@ -4016,9 +4033,8 @@ export declare const sort: {
|
|
|
4016
4033
|
*
|
|
4017
4034
|
* **Details**
|
|
4018
4035
|
*
|
|
4019
|
-
*
|
|
4020
|
-
*
|
|
4021
|
-
* multi-key sorting.
|
|
4036
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4037
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
4022
4038
|
*
|
|
4023
4039
|
* **Example** (Sorting numbers)
|
|
4024
4040
|
*
|
|
@@ -4042,12 +4058,12 @@ export declare const sort: {
|
|
|
4042
4058
|
*
|
|
4043
4059
|
* **When to use**
|
|
4044
4060
|
*
|
|
4045
|
-
* Use when
|
|
4046
|
-
*
|
|
4061
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4062
|
+
* object field, while keeping the original values.
|
|
4047
4063
|
*
|
|
4048
4064
|
* **Details**
|
|
4049
4065
|
*
|
|
4050
|
-
*
|
|
4066
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4051
4067
|
*
|
|
4052
4068
|
* **Example** (Sorting strings by length)
|
|
4053
4069
|
*
|
|
@@ -4071,12 +4087,12 @@ export declare const sortWith: {
|
|
|
4071
4087
|
*
|
|
4072
4088
|
* **When to use**
|
|
4073
4089
|
*
|
|
4074
|
-
* Use when
|
|
4075
|
-
*
|
|
4090
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4091
|
+
* object field, while keeping the original values.
|
|
4076
4092
|
*
|
|
4077
4093
|
* **Details**
|
|
4078
4094
|
*
|
|
4079
|
-
*
|
|
4095
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4080
4096
|
*
|
|
4081
4097
|
* **Example** (Sorting strings by length)
|
|
4082
4098
|
*
|
|
@@ -4100,12 +4116,12 @@ export declare const sortWith: {
|
|
|
4100
4116
|
*
|
|
4101
4117
|
* **When to use**
|
|
4102
4118
|
*
|
|
4103
|
-
* Use when
|
|
4104
|
-
*
|
|
4119
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4120
|
+
* object field, while keeping the original values.
|
|
4105
4121
|
*
|
|
4106
4122
|
* **Details**
|
|
4107
4123
|
*
|
|
4108
|
-
*
|
|
4124
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4109
4125
|
*
|
|
4110
4126
|
* **Example** (Sorting strings by length)
|
|
4111
4127
|
*
|
|
@@ -4129,12 +4145,12 @@ export declare const sortWith: {
|
|
|
4129
4145
|
*
|
|
4130
4146
|
* **When to use**
|
|
4131
4147
|
*
|
|
4132
|
-
* Use when
|
|
4133
|
-
*
|
|
4148
|
+
* Use when you need to sort values by a derived key, such as a string length or
|
|
4149
|
+
* object field, while keeping the original values.
|
|
4134
4150
|
*
|
|
4135
4151
|
* **Details**
|
|
4136
4152
|
*
|
|
4137
|
-
*
|
|
4153
|
+
* Equivalent to `sort(Order.mapInput(order, f))`, but more convenient.
|
|
4138
4154
|
*
|
|
4139
4155
|
* **Example** (Sorting strings by length)
|
|
4140
4156
|
*
|
|
@@ -4164,8 +4180,8 @@ export declare const sortWith: {
|
|
|
4164
4180
|
*
|
|
4165
4181
|
* **Details**
|
|
4166
4182
|
*
|
|
4167
|
-
*
|
|
4168
|
-
*
|
|
4183
|
+
* This is data-last only and returns a function. The return type preserves
|
|
4184
|
+
* `NonEmptyArray`.
|
|
4169
4185
|
*
|
|
4170
4186
|
* **Example** (Multi-key sorting)
|
|
4171
4187
|
*
|
|
@@ -4202,11 +4218,11 @@ export declare const sortBy: <S extends Iterable<any>>(...orders: ReadonlyArray<
|
|
|
4202
4218
|
*
|
|
4203
4219
|
* **When to use**
|
|
4204
4220
|
*
|
|
4205
|
-
* Use
|
|
4221
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4206
4222
|
*
|
|
4207
4223
|
* **Details**
|
|
4208
4224
|
*
|
|
4209
|
-
*
|
|
4225
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4210
4226
|
*
|
|
4211
4227
|
* **Example** (Zipping two arrays)
|
|
4212
4228
|
*
|
|
@@ -4229,11 +4245,11 @@ export declare const zip: {
|
|
|
4229
4245
|
*
|
|
4230
4246
|
* **When to use**
|
|
4231
4247
|
*
|
|
4232
|
-
* Use
|
|
4248
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4233
4249
|
*
|
|
4234
4250
|
* **Details**
|
|
4235
4251
|
*
|
|
4236
|
-
*
|
|
4252
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4237
4253
|
*
|
|
4238
4254
|
* **Example** (Zipping two arrays)
|
|
4239
4255
|
*
|
|
@@ -4256,11 +4272,11 @@ export declare const zip: {
|
|
|
4256
4272
|
*
|
|
4257
4273
|
* **When to use**
|
|
4258
4274
|
*
|
|
4259
|
-
* Use
|
|
4275
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4260
4276
|
*
|
|
4261
4277
|
* **Details**
|
|
4262
4278
|
*
|
|
4263
|
-
*
|
|
4279
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4264
4280
|
*
|
|
4265
4281
|
* **Example** (Zipping two arrays)
|
|
4266
4282
|
*
|
|
@@ -4283,11 +4299,11 @@ export declare const zip: {
|
|
|
4283
4299
|
*
|
|
4284
4300
|
* **When to use**
|
|
4285
4301
|
*
|
|
4286
|
-
* Use
|
|
4302
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4287
4303
|
*
|
|
4288
4304
|
* **Details**
|
|
4289
4305
|
*
|
|
4290
|
-
*
|
|
4306
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4291
4307
|
*
|
|
4292
4308
|
* **Example** (Zipping two arrays)
|
|
4293
4309
|
*
|
|
@@ -4310,11 +4326,11 @@ export declare const zip: {
|
|
|
4310
4326
|
*
|
|
4311
4327
|
* **When to use**
|
|
4312
4328
|
*
|
|
4313
|
-
* Use
|
|
4329
|
+
* Use when you need simple pairs of corresponding elements from two iterables.
|
|
4314
4330
|
*
|
|
4315
4331
|
* **Details**
|
|
4316
4332
|
*
|
|
4317
|
-
*
|
|
4333
|
+
* Returns `NonEmptyArray` when both inputs are non-empty.
|
|
4318
4334
|
*
|
|
4319
4335
|
* **Example** (Zipping two arrays)
|
|
4320
4336
|
*
|
|
@@ -4336,6 +4352,11 @@ export declare const zip: {
|
|
|
4336
4352
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4337
4353
|
* iterables differ in length, extra elements are discarded.
|
|
4338
4354
|
*
|
|
4355
|
+
* **When to use**
|
|
4356
|
+
*
|
|
4357
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4358
|
+
* become a computed array element instead of a tuple.
|
|
4359
|
+
*
|
|
4339
4360
|
* **Example** (Zipping with addition)
|
|
4340
4361
|
*
|
|
4341
4362
|
* ```ts
|
|
@@ -4354,6 +4375,11 @@ export declare const zipWith: {
|
|
|
4354
4375
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4355
4376
|
* iterables differ in length, extra elements are discarded.
|
|
4356
4377
|
*
|
|
4378
|
+
* **When to use**
|
|
4379
|
+
*
|
|
4380
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4381
|
+
* become a computed array element instead of a tuple.
|
|
4382
|
+
*
|
|
4357
4383
|
* **Example** (Zipping with addition)
|
|
4358
4384
|
*
|
|
4359
4385
|
* ```ts
|
|
@@ -4372,6 +4398,11 @@ export declare const zipWith: {
|
|
|
4372
4398
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4373
4399
|
* iterables differ in length, extra elements are discarded.
|
|
4374
4400
|
*
|
|
4401
|
+
* **When to use**
|
|
4402
|
+
*
|
|
4403
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4404
|
+
* become a computed array element instead of a tuple.
|
|
4405
|
+
*
|
|
4375
4406
|
* **Example** (Zipping with addition)
|
|
4376
4407
|
*
|
|
4377
4408
|
* ```ts
|
|
@@ -4390,6 +4421,11 @@ export declare const zipWith: {
|
|
|
4390
4421
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4391
4422
|
* iterables differ in length, extra elements are discarded.
|
|
4392
4423
|
*
|
|
4424
|
+
* **When to use**
|
|
4425
|
+
*
|
|
4426
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4427
|
+
* become a computed array element instead of a tuple.
|
|
4428
|
+
*
|
|
4393
4429
|
* **Example** (Zipping with addition)
|
|
4394
4430
|
*
|
|
4395
4431
|
* ```ts
|
|
@@ -4408,6 +4444,11 @@ export declare const zipWith: {
|
|
|
4408
4444
|
* Combines elements from two iterables pairwise using a function. If the
|
|
4409
4445
|
* iterables differ in length, extra elements are discarded.
|
|
4410
4446
|
*
|
|
4447
|
+
* **When to use**
|
|
4448
|
+
*
|
|
4449
|
+
* Use when zipping two iterables in an array pipeline and each pair should
|
|
4450
|
+
* become a computed array element instead of a tuple.
|
|
4451
|
+
*
|
|
4411
4452
|
* **Example** (Zipping with addition)
|
|
4412
4453
|
*
|
|
4413
4454
|
* ```ts
|
|
@@ -4449,8 +4490,8 @@ export declare const unzip: <S extends Iterable<readonly [any, any]>>(self: S) =
|
|
|
4449
4490
|
*
|
|
4450
4491
|
* **Details**
|
|
4451
4492
|
*
|
|
4452
|
-
*
|
|
4453
|
-
*
|
|
4493
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
4494
|
+
* result.
|
|
4454
4495
|
*
|
|
4455
4496
|
* **Example** (Interspersing a separator)
|
|
4456
4497
|
*
|
|
@@ -4475,8 +4516,8 @@ export declare const intersperse: {
|
|
|
4475
4516
|
*
|
|
4476
4517
|
* **Details**
|
|
4477
4518
|
*
|
|
4478
|
-
*
|
|
4479
|
-
*
|
|
4519
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
4520
|
+
* result.
|
|
4480
4521
|
*
|
|
4481
4522
|
* **Example** (Interspersing a separator)
|
|
4482
4523
|
*
|
|
@@ -4501,8 +4542,8 @@ export declare const intersperse: {
|
|
|
4501
4542
|
*
|
|
4502
4543
|
* **Details**
|
|
4503
4544
|
*
|
|
4504
|
-
*
|
|
4505
|
-
*
|
|
4545
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
4546
|
+
* result.
|
|
4506
4547
|
*
|
|
4507
4548
|
* **Example** (Interspersing a separator)
|
|
4508
4549
|
*
|
|
@@ -4527,8 +4568,8 @@ export declare const intersperse: {
|
|
|
4527
4568
|
*
|
|
4528
4569
|
* **Details**
|
|
4529
4570
|
*
|
|
4530
|
-
*
|
|
4531
|
-
*
|
|
4571
|
+
* The return type preserves `NonEmptyArray`. Empty inputs produce an empty
|
|
4572
|
+
* result.
|
|
4532
4573
|
*
|
|
4533
4574
|
* **Example** (Interspersing a separator)
|
|
4534
4575
|
*
|
|
@@ -4618,6 +4659,11 @@ export declare const modifyHeadNonEmpty: {
|
|
|
4618
4659
|
/**
|
|
4619
4660
|
* Replaces the first element of a non-empty array with a new value.
|
|
4620
4661
|
*
|
|
4662
|
+
* **When to use**
|
|
4663
|
+
*
|
|
4664
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
4665
|
+
* does not depend on the current first element.
|
|
4666
|
+
*
|
|
4621
4667
|
* **Example** (Setting the head)
|
|
4622
4668
|
*
|
|
4623
4669
|
* ```ts
|
|
@@ -4636,6 +4682,11 @@ export declare const setHeadNonEmpty: {
|
|
|
4636
4682
|
/**
|
|
4637
4683
|
* Replaces the first element of a non-empty array with a new value.
|
|
4638
4684
|
*
|
|
4685
|
+
* **When to use**
|
|
4686
|
+
*
|
|
4687
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
4688
|
+
* does not depend on the current first element.
|
|
4689
|
+
*
|
|
4639
4690
|
* **Example** (Setting the head)
|
|
4640
4691
|
*
|
|
4641
4692
|
* ```ts
|
|
@@ -4654,6 +4705,11 @@ export declare const setHeadNonEmpty: {
|
|
|
4654
4705
|
/**
|
|
4655
4706
|
* Replaces the first element of a non-empty array with a new value.
|
|
4656
4707
|
*
|
|
4708
|
+
* **When to use**
|
|
4709
|
+
*
|
|
4710
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
4711
|
+
* does not depend on the current first element.
|
|
4712
|
+
*
|
|
4657
4713
|
* **Example** (Setting the head)
|
|
4658
4714
|
*
|
|
4659
4715
|
* ```ts
|
|
@@ -4674,6 +4730,11 @@ export declare const setHeadNonEmpty: {
|
|
|
4674
4730
|
* Applies a function to the last element of a non-empty array, returning a
|
|
4675
4731
|
* new array.
|
|
4676
4732
|
*
|
|
4733
|
+
* **When to use**
|
|
4734
|
+
*
|
|
4735
|
+
* Use when you already know the array is non-empty and the new last element
|
|
4736
|
+
* depends on the current last element.
|
|
4737
|
+
*
|
|
4677
4738
|
* **Example** (Modifying the last element)
|
|
4678
4739
|
*
|
|
4679
4740
|
* ```ts
|
|
@@ -4693,6 +4754,11 @@ export declare const modifyLastNonEmpty: {
|
|
|
4693
4754
|
* Applies a function to the last element of a non-empty array, returning a
|
|
4694
4755
|
* new array.
|
|
4695
4756
|
*
|
|
4757
|
+
* **When to use**
|
|
4758
|
+
*
|
|
4759
|
+
* Use when you already know the array is non-empty and the new last element
|
|
4760
|
+
* depends on the current last element.
|
|
4761
|
+
*
|
|
4696
4762
|
* **Example** (Modifying the last element)
|
|
4697
4763
|
*
|
|
4698
4764
|
* ```ts
|
|
@@ -4712,6 +4778,11 @@ export declare const modifyLastNonEmpty: {
|
|
|
4712
4778
|
* Applies a function to the last element of a non-empty array, returning a
|
|
4713
4779
|
* new array.
|
|
4714
4780
|
*
|
|
4781
|
+
* **When to use**
|
|
4782
|
+
*
|
|
4783
|
+
* Use when you already know the array is non-empty and the new last element
|
|
4784
|
+
* depends on the current last element.
|
|
4785
|
+
*
|
|
4715
4786
|
* **Example** (Modifying the last element)
|
|
4716
4787
|
*
|
|
4717
4788
|
* ```ts
|
|
@@ -4731,6 +4802,11 @@ export declare const modifyLastNonEmpty: {
|
|
|
4731
4802
|
/**
|
|
4732
4803
|
* Replaces the last element of a non-empty array with a new value.
|
|
4733
4804
|
*
|
|
4805
|
+
* **When to use**
|
|
4806
|
+
*
|
|
4807
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
4808
|
+
* does not depend on the current last element.
|
|
4809
|
+
*
|
|
4734
4810
|
* **Example** (Setting the last element)
|
|
4735
4811
|
*
|
|
4736
4812
|
* ```ts
|
|
@@ -4749,6 +4825,11 @@ export declare const setLastNonEmpty: {
|
|
|
4749
4825
|
/**
|
|
4750
4826
|
* Replaces the last element of a non-empty array with a new value.
|
|
4751
4827
|
*
|
|
4828
|
+
* **When to use**
|
|
4829
|
+
*
|
|
4830
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
4831
|
+
* does not depend on the current last element.
|
|
4832
|
+
*
|
|
4752
4833
|
* **Example** (Setting the last element)
|
|
4753
4834
|
*
|
|
4754
4835
|
* ```ts
|
|
@@ -4767,6 +4848,11 @@ export declare const setLastNonEmpty: {
|
|
|
4767
4848
|
/**
|
|
4768
4849
|
* Replaces the last element of a non-empty array with a new value.
|
|
4769
4850
|
*
|
|
4851
|
+
* **When to use**
|
|
4852
|
+
*
|
|
4853
|
+
* Use when you already know the array is non-empty and the replacement value
|
|
4854
|
+
* does not depend on the current last element.
|
|
4855
|
+
*
|
|
4770
4856
|
* **Example** (Setting the last element)
|
|
4771
4857
|
*
|
|
4772
4858
|
* ```ts
|
|
@@ -4794,9 +4880,9 @@ export declare const setLastNonEmpty: {
|
|
|
4794
4880
|
*
|
|
4795
4881
|
* **Details**
|
|
4796
4882
|
*
|
|
4797
|
-
*
|
|
4798
|
-
*
|
|
4799
|
-
*
|
|
4883
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
4884
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
4885
|
+
* return a copy.
|
|
4800
4886
|
*
|
|
4801
4887
|
* **Example** (Rotating elements)
|
|
4802
4888
|
*
|
|
@@ -4824,9 +4910,9 @@ export declare const rotate: {
|
|
|
4824
4910
|
*
|
|
4825
4911
|
* **Details**
|
|
4826
4912
|
*
|
|
4827
|
-
*
|
|
4828
|
-
*
|
|
4829
|
-
*
|
|
4913
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
4914
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
4915
|
+
* return a copy.
|
|
4830
4916
|
*
|
|
4831
4917
|
* **Example** (Rotating elements)
|
|
4832
4918
|
*
|
|
@@ -4854,9 +4940,9 @@ export declare const rotate: {
|
|
|
4854
4940
|
*
|
|
4855
4941
|
* **Details**
|
|
4856
4942
|
*
|
|
4857
|
-
*
|
|
4858
|
-
*
|
|
4859
|
-
*
|
|
4943
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
4944
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
4945
|
+
* return a copy.
|
|
4860
4946
|
*
|
|
4861
4947
|
* **Example** (Rotating elements)
|
|
4862
4948
|
*
|
|
@@ -4884,9 +4970,9 @@ export declare const rotate: {
|
|
|
4884
4970
|
*
|
|
4885
4971
|
* **Details**
|
|
4886
4972
|
*
|
|
4887
|
-
*
|
|
4888
|
-
*
|
|
4889
|
-
*
|
|
4973
|
+
* `n` is rounded to the nearest integer before rotating. The return type
|
|
4974
|
+
* preserves `NonEmptyArray`. Empty arrays, or rotations normalized to `0`,
|
|
4975
|
+
* return a copy.
|
|
4890
4976
|
*
|
|
4891
4977
|
* **Example** (Rotating elements)
|
|
4892
4978
|
*
|
|
@@ -4936,8 +5022,8 @@ export declare const containsWith: <A>(isEquivalent: (self: A, that: A) => boole
|
|
|
4936
5022
|
*
|
|
4937
5023
|
* **When to use**
|
|
4938
5024
|
*
|
|
4939
|
-
* Use to check
|
|
4940
|
-
* comparison function.
|
|
5025
|
+
* Use to check whether an iterable contains a value using Effect's default
|
|
5026
|
+
* equality instead of providing a comparison function.
|
|
4941
5027
|
*
|
|
4942
5028
|
* **Example** (Checking membership)
|
|
4943
5029
|
*
|
|
@@ -4959,8 +5045,8 @@ export declare const contains: {
|
|
|
4959
5045
|
*
|
|
4960
5046
|
* **When to use**
|
|
4961
5047
|
*
|
|
4962
|
-
* Use to check
|
|
4963
|
-
* comparison function.
|
|
5048
|
+
* Use to check whether an iterable contains a value using Effect's default
|
|
5049
|
+
* equality instead of providing a comparison function.
|
|
4964
5050
|
*
|
|
4965
5051
|
* **Example** (Checking membership)
|
|
4966
5052
|
*
|
|
@@ -4982,8 +5068,8 @@ export declare const contains: {
|
|
|
4982
5068
|
*
|
|
4983
5069
|
* **When to use**
|
|
4984
5070
|
*
|
|
4985
|
-
* Use to check
|
|
4986
|
-
* comparison function.
|
|
5071
|
+
* Use to check whether an iterable contains a value using Effect's default
|
|
5072
|
+
* equality instead of providing a comparison function.
|
|
4987
5073
|
*
|
|
4988
5074
|
* **Example** (Checking membership)
|
|
4989
5075
|
*
|
|
@@ -5006,15 +5092,13 @@ export declare const contains: {
|
|
|
5006
5092
|
*
|
|
5007
5093
|
* **When to use**
|
|
5008
5094
|
*
|
|
5009
|
-
* Use when
|
|
5010
|
-
*
|
|
5095
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5096
|
+
* and the remaining input.
|
|
5011
5097
|
*
|
|
5012
5098
|
* **Details**
|
|
5013
5099
|
*
|
|
5014
|
-
*
|
|
5015
|
-
*
|
|
5016
|
-
* - Continues until the remaining array is empty.
|
|
5017
|
-
* - Useful for custom splitting/grouping logic.
|
|
5100
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5101
|
+
* Processing continues until the remaining array is empty.
|
|
5018
5102
|
*
|
|
5019
5103
|
* **Example** (Chopping an array)
|
|
5020
5104
|
*
|
|
@@ -5041,15 +5125,13 @@ export declare const chop: {
|
|
|
5041
5125
|
*
|
|
5042
5126
|
* **When to use**
|
|
5043
5127
|
*
|
|
5044
|
-
* Use when
|
|
5045
|
-
*
|
|
5128
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5129
|
+
* and the remaining input.
|
|
5046
5130
|
*
|
|
5047
5131
|
* **Details**
|
|
5048
5132
|
*
|
|
5049
|
-
*
|
|
5050
|
-
*
|
|
5051
|
-
* - Continues until the remaining array is empty.
|
|
5052
|
-
* - Useful for custom splitting/grouping logic.
|
|
5133
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5134
|
+
* Processing continues until the remaining array is empty.
|
|
5053
5135
|
*
|
|
5054
5136
|
* **Example** (Chopping an array)
|
|
5055
5137
|
*
|
|
@@ -5076,15 +5158,13 @@ export declare const chop: {
|
|
|
5076
5158
|
*
|
|
5077
5159
|
* **When to use**
|
|
5078
5160
|
*
|
|
5079
|
-
* Use when
|
|
5080
|
-
*
|
|
5161
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5162
|
+
* and the remaining input.
|
|
5081
5163
|
*
|
|
5082
5164
|
* **Details**
|
|
5083
5165
|
*
|
|
5084
|
-
*
|
|
5085
|
-
*
|
|
5086
|
-
* - Continues until the remaining array is empty.
|
|
5087
|
-
* - Useful for custom splitting/grouping logic.
|
|
5166
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5167
|
+
* Processing continues until the remaining array is empty.
|
|
5088
5168
|
*
|
|
5089
5169
|
* **Example** (Chopping an array)
|
|
5090
5170
|
*
|
|
@@ -5111,15 +5191,13 @@ export declare const chop: {
|
|
|
5111
5191
|
*
|
|
5112
5192
|
* **When to use**
|
|
5113
5193
|
*
|
|
5114
|
-
* Use when
|
|
5115
|
-
*
|
|
5194
|
+
* Use when you need custom grouping logic where each step returns both a value
|
|
5195
|
+
* and the remaining input.
|
|
5116
5196
|
*
|
|
5117
5197
|
* **Details**
|
|
5118
5198
|
*
|
|
5119
|
-
*
|
|
5120
|
-
*
|
|
5121
|
-
* - Continues until the remaining array is empty.
|
|
5122
|
-
* - Useful for custom splitting/grouping logic.
|
|
5199
|
+
* The function receives a `NonEmptyReadonlyArray` and returns `[value, rest]`.
|
|
5200
|
+
* Processing continues until the remaining array is empty.
|
|
5123
5201
|
*
|
|
5124
5202
|
* **Example** (Chopping an array)
|
|
5125
5203
|
*
|
|
@@ -5150,8 +5228,8 @@ export declare const chop: {
|
|
|
5150
5228
|
*
|
|
5151
5229
|
* **Details**
|
|
5152
5230
|
*
|
|
5153
|
-
*
|
|
5154
|
-
*
|
|
5231
|
+
* `n` can be `0`, in which case all elements are placed in the second array.
|
|
5232
|
+
* The index is floored to an integer.
|
|
5155
5233
|
*
|
|
5156
5234
|
* **Example** (Splitting at an index)
|
|
5157
5235
|
*
|
|
@@ -5177,8 +5255,8 @@ export declare const splitAt: {
|
|
|
5177
5255
|
*
|
|
5178
5256
|
* **Details**
|
|
5179
5257
|
*
|
|
5180
|
-
*
|
|
5181
|
-
*
|
|
5258
|
+
* `n` can be `0`, in which case all elements are placed in the second array.
|
|
5259
|
+
* The index is floored to an integer.
|
|
5182
5260
|
*
|
|
5183
5261
|
* **Example** (Splitting at an index)
|
|
5184
5262
|
*
|
|
@@ -5204,8 +5282,8 @@ export declare const splitAt: {
|
|
|
5204
5282
|
*
|
|
5205
5283
|
* **Details**
|
|
5206
5284
|
*
|
|
5207
|
-
*
|
|
5208
|
-
*
|
|
5285
|
+
* `n` can be `0`, in which case all elements are placed in the second array.
|
|
5286
|
+
* The index is floored to an integer.
|
|
5209
5287
|
*
|
|
5210
5288
|
* **Example** (Splitting at an index)
|
|
5211
5289
|
*
|
|
@@ -5227,6 +5305,11 @@ export declare const splitAt: {
|
|
|
5227
5305
|
* Splits a non-empty array into two parts at the given index. The first part
|
|
5228
5306
|
* is guaranteed to be non-empty (`n` is clamped to >= 1).
|
|
5229
5307
|
*
|
|
5308
|
+
* **When to use**
|
|
5309
|
+
*
|
|
5310
|
+
* Use when downstream code requires the left side of the split to contain at
|
|
5311
|
+
* least one element.
|
|
5312
|
+
*
|
|
5230
5313
|
* **Example** (Splitting a non-empty array)
|
|
5231
5314
|
*
|
|
5232
5315
|
* ```ts
|
|
@@ -5246,6 +5329,11 @@ export declare const splitAtNonEmpty: {
|
|
|
5246
5329
|
* Splits a non-empty array into two parts at the given index. The first part
|
|
5247
5330
|
* is guaranteed to be non-empty (`n` is clamped to >= 1).
|
|
5248
5331
|
*
|
|
5332
|
+
* **When to use**
|
|
5333
|
+
*
|
|
5334
|
+
* Use when downstream code requires the left side of the split to contain at
|
|
5335
|
+
* least one element.
|
|
5336
|
+
*
|
|
5249
5337
|
* **Example** (Splitting a non-empty array)
|
|
5250
5338
|
*
|
|
5251
5339
|
* ```ts
|
|
@@ -5265,6 +5353,11 @@ export declare const splitAtNonEmpty: {
|
|
|
5265
5353
|
* Splits a non-empty array into two parts at the given index. The first part
|
|
5266
5354
|
* is guaranteed to be non-empty (`n` is clamped to >= 1).
|
|
5267
5355
|
*
|
|
5356
|
+
* **When to use**
|
|
5357
|
+
*
|
|
5358
|
+
* Use when downstream code requires the left side of the split to contain at
|
|
5359
|
+
* least one element.
|
|
5360
|
+
*
|
|
5268
5361
|
* **Example** (Splitting a non-empty array)
|
|
5269
5362
|
*
|
|
5270
5363
|
* ```ts
|
|
@@ -5290,8 +5383,7 @@ export declare const splitAtNonEmpty: {
|
|
|
5290
5383
|
*
|
|
5291
5384
|
* **Details**
|
|
5292
5385
|
*
|
|
5293
|
-
*
|
|
5294
|
-
* - The last chunk may be shorter.
|
|
5386
|
+
* Uses `chunksOf(ceil(length / n))` internally. The last chunk may be shorter.
|
|
5295
5387
|
*
|
|
5296
5388
|
* **Example** (Splitting into groups)
|
|
5297
5389
|
*
|
|
@@ -5316,8 +5408,7 @@ export declare const split: {
|
|
|
5316
5408
|
*
|
|
5317
5409
|
* **Details**
|
|
5318
5410
|
*
|
|
5319
|
-
*
|
|
5320
|
-
* - The last chunk may be shorter.
|
|
5411
|
+
* Uses `chunksOf(ceil(length / n))` internally. The last chunk may be shorter.
|
|
5321
5412
|
*
|
|
5322
5413
|
* **Example** (Splitting into groups)
|
|
5323
5414
|
*
|
|
@@ -5342,8 +5433,7 @@ export declare const split: {
|
|
|
5342
5433
|
*
|
|
5343
5434
|
* **Details**
|
|
5344
5435
|
*
|
|
5345
|
-
*
|
|
5346
|
-
* - The last chunk may be shorter.
|
|
5436
|
+
* Uses `chunksOf(ceil(length / n))` internally. The last chunk may be shorter.
|
|
5347
5437
|
*
|
|
5348
5438
|
* **Example** (Splitting into groups)
|
|
5349
5439
|
*
|
|
@@ -5366,7 +5456,8 @@ export declare const split: {
|
|
|
5366
5456
|
*
|
|
5367
5457
|
* **When to use**
|
|
5368
5458
|
*
|
|
5369
|
-
* Use to split an array at
|
|
5459
|
+
* Use when you need to split an array at the first element that marks a
|
|
5460
|
+
* condition boundary.
|
|
5370
5461
|
*
|
|
5371
5462
|
* **Example** (Splitting at a condition)
|
|
5372
5463
|
*
|
|
@@ -5389,7 +5480,8 @@ export declare const splitWhere: {
|
|
|
5389
5480
|
*
|
|
5390
5481
|
* **When to use**
|
|
5391
5482
|
*
|
|
5392
|
-
* Use to split an array at
|
|
5483
|
+
* Use when you need to split an array at the first element that marks a
|
|
5484
|
+
* condition boundary.
|
|
5393
5485
|
*
|
|
5394
5486
|
* **Example** (Splitting at a condition)
|
|
5395
5487
|
*
|
|
@@ -5412,7 +5504,8 @@ export declare const splitWhere: {
|
|
|
5412
5504
|
*
|
|
5413
5505
|
* **When to use**
|
|
5414
5506
|
*
|
|
5415
|
-
* Use to split an array at
|
|
5507
|
+
* Use when you need to split an array at the first element that marks a
|
|
5508
|
+
* condition boundary.
|
|
5416
5509
|
*
|
|
5417
5510
|
* **Example** (Splitting at a condition)
|
|
5418
5511
|
*
|
|
@@ -5440,8 +5533,8 @@ export declare const splitWhere: {
|
|
|
5440
5533
|
*
|
|
5441
5534
|
* **Details**
|
|
5442
5535
|
*
|
|
5443
|
-
*
|
|
5444
|
-
*
|
|
5536
|
+
* The return type preserves `NonEmptyArray`. Use this when you need a distinct
|
|
5537
|
+
* reference, for example before mutating the returned array.
|
|
5445
5538
|
*
|
|
5446
5539
|
* **Example** (Copying an array)
|
|
5447
5540
|
*
|
|
@@ -5470,8 +5563,8 @@ export declare const copy: {
|
|
|
5470
5563
|
*
|
|
5471
5564
|
* **Details**
|
|
5472
5565
|
*
|
|
5473
|
-
*
|
|
5474
|
-
*
|
|
5566
|
+
* The return type preserves `NonEmptyArray`. Use this when you need a distinct
|
|
5567
|
+
* reference, for example before mutating the returned array.
|
|
5475
5568
|
*
|
|
5476
5569
|
* **Example** (Copying an array)
|
|
5477
5570
|
*
|
|
@@ -5500,8 +5593,8 @@ export declare const copy: {
|
|
|
5500
5593
|
*
|
|
5501
5594
|
* **Details**
|
|
5502
5595
|
*
|
|
5503
|
-
*
|
|
5504
|
-
*
|
|
5596
|
+
* The return type preserves `NonEmptyArray`. Use this when you need a distinct
|
|
5597
|
+
* reference, for example before mutating the returned array.
|
|
5505
5598
|
*
|
|
5506
5599
|
* **Example** (Copying an array)
|
|
5507
5600
|
*
|
|
@@ -5531,7 +5624,7 @@ export declare const copy: {
|
|
|
5531
5624
|
*
|
|
5532
5625
|
* **Details**
|
|
5533
5626
|
*
|
|
5534
|
-
*
|
|
5627
|
+
* Returns an empty array when `n <= 0`.
|
|
5535
5628
|
*
|
|
5536
5629
|
* **Example** (Padding an array)
|
|
5537
5630
|
*
|
|
@@ -5558,7 +5651,7 @@ export declare const pad: {
|
|
|
5558
5651
|
*
|
|
5559
5652
|
* **Details**
|
|
5560
5653
|
*
|
|
5561
|
-
*
|
|
5654
|
+
* Returns an empty array when `n <= 0`.
|
|
5562
5655
|
*
|
|
5563
5656
|
* **Example** (Padding an array)
|
|
5564
5657
|
*
|
|
@@ -5585,7 +5678,7 @@ export declare const pad: {
|
|
|
5585
5678
|
*
|
|
5586
5679
|
* **Details**
|
|
5587
5680
|
*
|
|
5588
|
-
*
|
|
5681
|
+
* Returns an empty array when `n <= 0`.
|
|
5589
5682
|
*
|
|
5590
5683
|
* **Example** (Padding an array)
|
|
5591
5684
|
*
|
|
@@ -5609,14 +5702,13 @@ export declare const pad: {
|
|
|
5609
5702
|
*
|
|
5610
5703
|
* **When to use**
|
|
5611
5704
|
*
|
|
5612
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
5613
|
-
* size.
|
|
5705
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
5706
|
+
* maximum chunk size.
|
|
5614
5707
|
*
|
|
5615
5708
|
* **Details**
|
|
5616
5709
|
*
|
|
5617
|
-
*
|
|
5618
|
-
*
|
|
5619
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
5710
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
5711
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
5620
5712
|
*
|
|
5621
5713
|
* **Example** (Chunking an array)
|
|
5622
5714
|
*
|
|
@@ -5639,14 +5731,13 @@ export declare const chunksOf: {
|
|
|
5639
5731
|
*
|
|
5640
5732
|
* **When to use**
|
|
5641
5733
|
*
|
|
5642
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
5643
|
-
* size.
|
|
5734
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
5735
|
+
* maximum chunk size.
|
|
5644
5736
|
*
|
|
5645
5737
|
* **Details**
|
|
5646
5738
|
*
|
|
5647
|
-
*
|
|
5648
|
-
*
|
|
5649
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
5739
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
5740
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
5650
5741
|
*
|
|
5651
5742
|
* **Example** (Chunking an array)
|
|
5652
5743
|
*
|
|
@@ -5669,14 +5760,13 @@ export declare const chunksOf: {
|
|
|
5669
5760
|
*
|
|
5670
5761
|
* **When to use**
|
|
5671
5762
|
*
|
|
5672
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
5673
|
-
* size.
|
|
5763
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
5764
|
+
* maximum chunk size.
|
|
5674
5765
|
*
|
|
5675
5766
|
* **Details**
|
|
5676
5767
|
*
|
|
5677
|
-
*
|
|
5678
|
-
*
|
|
5679
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
5768
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
5769
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
5680
5770
|
*
|
|
5681
5771
|
* **Example** (Chunking an array)
|
|
5682
5772
|
*
|
|
@@ -5699,14 +5789,13 @@ export declare const chunksOf: {
|
|
|
5699
5789
|
*
|
|
5700
5790
|
* **When to use**
|
|
5701
5791
|
*
|
|
5702
|
-
* Use to divide an iterable into non-overlapping chunks with a
|
|
5703
|
-
* size.
|
|
5792
|
+
* Use to divide an iterable into a new array of non-overlapping chunks with a
|
|
5793
|
+
* maximum chunk size.
|
|
5704
5794
|
*
|
|
5705
5795
|
* **Details**
|
|
5706
5796
|
*
|
|
5707
|
-
*
|
|
5708
|
-
*
|
|
5709
|
-
* - Preserves `NonEmptyArray` in the outer return type.
|
|
5797
|
+
* `chunksOf(n)([])` is `[]`, not `[[]]`. Each chunk is a `NonEmptyArray`, and
|
|
5798
|
+
* the outer return type preserves `NonEmptyArray`.
|
|
5710
5799
|
*
|
|
5711
5800
|
* **Example** (Chunking an array)
|
|
5712
5801
|
*
|
|
@@ -5733,8 +5822,8 @@ export declare const chunksOf: {
|
|
|
5733
5822
|
*
|
|
5734
5823
|
* **Details**
|
|
5735
5824
|
*
|
|
5736
|
-
*
|
|
5737
|
-
*
|
|
5825
|
+
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
5826
|
+
* Each window is a tuple of exactly `n` elements.
|
|
5738
5827
|
*
|
|
5739
5828
|
* **Example** (Sliding windows)
|
|
5740
5829
|
*
|
|
@@ -5760,8 +5849,8 @@ export declare const window: {
|
|
|
5760
5849
|
*
|
|
5761
5850
|
* **Details**
|
|
5762
5851
|
*
|
|
5763
|
-
*
|
|
5764
|
-
*
|
|
5852
|
+
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
5853
|
+
* Each window is a tuple of exactly `n` elements.
|
|
5765
5854
|
*
|
|
5766
5855
|
* **Example** (Sliding windows)
|
|
5767
5856
|
*
|
|
@@ -5787,8 +5876,8 @@ export declare const window: {
|
|
|
5787
5876
|
*
|
|
5788
5877
|
* **Details**
|
|
5789
5878
|
*
|
|
5790
|
-
*
|
|
5791
|
-
*
|
|
5879
|
+
* Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
5880
|
+
* Each window is a tuple of exactly `n` elements.
|
|
5792
5881
|
*
|
|
5793
5882
|
* **Example** (Sliding windows)
|
|
5794
5883
|
*
|
|
@@ -5811,13 +5900,13 @@ export declare const window: {
|
|
|
5811
5900
|
*
|
|
5812
5901
|
* **When to use**
|
|
5813
5902
|
*
|
|
5814
|
-
* Use when a non-empty array
|
|
5815
|
-
* adjacent and
|
|
5903
|
+
* Use when you already have a non-empty array arranged so matching elements are
|
|
5904
|
+
* adjacent and need a custom equivalence function.
|
|
5816
5905
|
*
|
|
5817
5906
|
* **Details**
|
|
5818
5907
|
*
|
|
5819
|
-
*
|
|
5820
|
-
*
|
|
5908
|
+
* Only adjacent elements are grouped. Non-adjacent duplicates stay separate.
|
|
5909
|
+
* Requires a `NonEmptyReadonlyArray`.
|
|
5821
5910
|
*
|
|
5822
5911
|
* **Example** (Grouping consecutive equal elements)
|
|
5823
5912
|
*
|
|
@@ -5840,13 +5929,13 @@ export declare const groupWith: {
|
|
|
5840
5929
|
*
|
|
5841
5930
|
* **When to use**
|
|
5842
5931
|
*
|
|
5843
|
-
* Use when a non-empty array
|
|
5844
|
-
* adjacent and
|
|
5932
|
+
* Use when you already have a non-empty array arranged so matching elements are
|
|
5933
|
+
* adjacent and need a custom equivalence function.
|
|
5845
5934
|
*
|
|
5846
5935
|
* **Details**
|
|
5847
5936
|
*
|
|
5848
|
-
*
|
|
5849
|
-
*
|
|
5937
|
+
* Only adjacent elements are grouped. Non-adjacent duplicates stay separate.
|
|
5938
|
+
* Requires a `NonEmptyReadonlyArray`.
|
|
5850
5939
|
*
|
|
5851
5940
|
* **Example** (Grouping consecutive equal elements)
|
|
5852
5941
|
*
|
|
@@ -5869,13 +5958,13 @@ export declare const groupWith: {
|
|
|
5869
5958
|
*
|
|
5870
5959
|
* **When to use**
|
|
5871
5960
|
*
|
|
5872
|
-
* Use when a non-empty array
|
|
5873
|
-
* adjacent and
|
|
5961
|
+
* Use when you already have a non-empty array arranged so matching elements are
|
|
5962
|
+
* adjacent and need a custom equivalence function.
|
|
5874
5963
|
*
|
|
5875
5964
|
* **Details**
|
|
5876
5965
|
*
|
|
5877
|
-
*
|
|
5878
|
-
*
|
|
5966
|
+
* Only adjacent elements are grouped. Non-adjacent duplicates stay separate.
|
|
5967
|
+
* Requires a `NonEmptyReadonlyArray`.
|
|
5879
5968
|
*
|
|
5880
5969
|
* **Example** (Grouping consecutive equal elements)
|
|
5881
5970
|
*
|
|
@@ -5899,12 +5988,12 @@ export declare const groupWith: {
|
|
|
5899
5988
|
*
|
|
5900
5989
|
* **When to use**
|
|
5901
5990
|
*
|
|
5902
|
-
* Use when
|
|
5903
|
-
* the right comparison.
|
|
5991
|
+
* Use when you already have adjacent equal values and Effect's default equality
|
|
5992
|
+
* is the right comparison.
|
|
5904
5993
|
*
|
|
5905
5994
|
* **Details**
|
|
5906
5995
|
*
|
|
5907
|
-
*
|
|
5996
|
+
* Only adjacent elements are grouped.
|
|
5908
5997
|
*
|
|
5909
5998
|
* **Example** (Grouping adjacent equal elements)
|
|
5910
5999
|
*
|
|
@@ -5931,9 +6020,8 @@ export declare const group: <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyArray
|
|
|
5931
6020
|
*
|
|
5932
6021
|
* **Details**
|
|
5933
6022
|
*
|
|
5934
|
-
*
|
|
5935
|
-
*
|
|
5936
|
-
* - Key function must return a `string` or `symbol`.
|
|
6023
|
+
* Unlike `group` and `groupWith`, elements do not need to be adjacent to be
|
|
6024
|
+
* grouped together. The key function must return a `string` or `symbol`.
|
|
5937
6025
|
*
|
|
5938
6026
|
* **Example** (Grouping by a property)
|
|
5939
6027
|
*
|
|
@@ -5968,9 +6056,8 @@ export declare const groupBy: {
|
|
|
5968
6056
|
*
|
|
5969
6057
|
* **Details**
|
|
5970
6058
|
*
|
|
5971
|
-
*
|
|
5972
|
-
*
|
|
5973
|
-
* - Key function must return a `string` or `symbol`.
|
|
6059
|
+
* Unlike `group` and `groupWith`, elements do not need to be adjacent to be
|
|
6060
|
+
* grouped together. The key function must return a `string` or `symbol`.
|
|
5974
6061
|
*
|
|
5975
6062
|
* **Example** (Grouping by a property)
|
|
5976
6063
|
*
|
|
@@ -6005,9 +6092,8 @@ export declare const groupBy: {
|
|
|
6005
6092
|
*
|
|
6006
6093
|
* **Details**
|
|
6007
6094
|
*
|
|
6008
|
-
*
|
|
6009
|
-
*
|
|
6010
|
-
* - Key function must return a `string` or `symbol`.
|
|
6095
|
+
* Unlike `group` and `groupWith`, elements do not need to be adjacent to be
|
|
6096
|
+
* grouped together. The key function must return a `string` or `symbol`.
|
|
6011
6097
|
*
|
|
6012
6098
|
* **Example** (Grouping by a property)
|
|
6013
6099
|
*
|
|
@@ -6266,8 +6352,8 @@ export declare const union: {
|
|
|
6266
6352
|
*
|
|
6267
6353
|
* **When to use**
|
|
6268
6354
|
*
|
|
6269
|
-
* Use when
|
|
6270
|
-
* defined by a custom comparator, such as matching objects by id.
|
|
6355
|
+
* Use when you need to keep only values present in both arrays and equality
|
|
6356
|
+
* must be defined by a custom comparator, such as matching objects by id.
|
|
6271
6357
|
*
|
|
6272
6358
|
* **Example** (Intersection with custom equality)
|
|
6273
6359
|
*
|
|
@@ -6295,6 +6381,11 @@ export declare const intersectionWith: <A>(isEquivalent: (self: A, that: A) => b
|
|
|
6295
6381
|
* Computes the intersection of two arrays using `Equal.equivalence()`. Order is
|
|
6296
6382
|
* determined by the first array.
|
|
6297
6383
|
*
|
|
6384
|
+
* **When to use**
|
|
6385
|
+
*
|
|
6386
|
+
* Use when Effect equality is the right membership test and you want to keep
|
|
6387
|
+
* values present in both inputs while preserving the first input's order.
|
|
6388
|
+
*
|
|
6298
6389
|
* **Example** (Array intersection)
|
|
6299
6390
|
*
|
|
6300
6391
|
* ```ts
|
|
@@ -6315,6 +6406,11 @@ export declare const intersection: {
|
|
|
6315
6406
|
* Computes the intersection of two arrays using `Equal.equivalence()`. Order is
|
|
6316
6407
|
* determined by the first array.
|
|
6317
6408
|
*
|
|
6409
|
+
* **When to use**
|
|
6410
|
+
*
|
|
6411
|
+
* Use when Effect equality is the right membership test and you want to keep
|
|
6412
|
+
* values present in both inputs while preserving the first input's order.
|
|
6413
|
+
*
|
|
6318
6414
|
* **Example** (Array intersection)
|
|
6319
6415
|
*
|
|
6320
6416
|
* ```ts
|
|
@@ -6335,6 +6431,11 @@ export declare const intersection: {
|
|
|
6335
6431
|
* Computes the intersection of two arrays using `Equal.equivalence()`. Order is
|
|
6336
6432
|
* determined by the first array.
|
|
6337
6433
|
*
|
|
6434
|
+
* **When to use**
|
|
6435
|
+
*
|
|
6436
|
+
* Use when Effect equality is the right membership test and you want to keep
|
|
6437
|
+
* values present in both inputs while preserving the first input's order.
|
|
6438
|
+
*
|
|
6338
6439
|
* **Example** (Array intersection)
|
|
6339
6440
|
*
|
|
6340
6441
|
* ```ts
|
|
@@ -6358,8 +6459,8 @@ export declare const intersection: {
|
|
|
6358
6459
|
*
|
|
6359
6460
|
* **When to use**
|
|
6360
6461
|
*
|
|
6361
|
-
* Use when
|
|
6362
|
-
* defined by a custom comparator, such as matching objects by id.
|
|
6462
|
+
* Use when you need to keep only values from the first array and equality must
|
|
6463
|
+
* be defined by a custom comparator, such as matching objects by id.
|
|
6363
6464
|
*
|
|
6364
6465
|
* **Example** (Difference with custom equality)
|
|
6365
6466
|
*
|
|
@@ -6604,8 +6705,8 @@ export declare namespace ReadonlyArray {
|
|
|
6604
6705
|
*
|
|
6605
6706
|
* **Details**
|
|
6606
6707
|
*
|
|
6607
|
-
*
|
|
6608
|
-
*
|
|
6708
|
+
* The function receives `(element, index)`. The return type preserves
|
|
6709
|
+
* `NonEmptyArray`.
|
|
6609
6710
|
*
|
|
6610
6711
|
* **Example** (Doubling values)
|
|
6611
6712
|
*
|
|
@@ -6630,8 +6731,8 @@ export declare const map: {
|
|
|
6630
6731
|
*
|
|
6631
6732
|
* **Details**
|
|
6632
6733
|
*
|
|
6633
|
-
*
|
|
6634
|
-
*
|
|
6734
|
+
* The function receives `(element, index)`. The return type preserves
|
|
6735
|
+
* `NonEmptyArray`.
|
|
6635
6736
|
*
|
|
6636
6737
|
* **Example** (Doubling values)
|
|
6637
6738
|
*
|
|
@@ -6656,8 +6757,8 @@ export declare const map: {
|
|
|
6656
6757
|
*
|
|
6657
6758
|
* **Details**
|
|
6658
6759
|
*
|
|
6659
|
-
*
|
|
6660
|
-
*
|
|
6760
|
+
* The function receives `(element, index)`. The return type preserves
|
|
6761
|
+
* `NonEmptyArray`.
|
|
6661
6762
|
*
|
|
6662
6763
|
* **Example** (Doubling values)
|
|
6663
6764
|
*
|
|
@@ -6679,13 +6780,13 @@ export declare const map: {
|
|
|
6679
6780
|
*
|
|
6680
6781
|
* **When to use**
|
|
6681
6782
|
*
|
|
6682
|
-
* Use to map each element to zero or more values and concatenate the
|
|
6683
|
-
* one pass.
|
|
6783
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
6784
|
+
* results in one pass.
|
|
6684
6785
|
*
|
|
6685
6786
|
* **Details**
|
|
6686
6787
|
*
|
|
6687
|
-
*
|
|
6688
|
-
*
|
|
6788
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6789
|
+
* both the input and mapped arrays are non-empty.
|
|
6689
6790
|
*
|
|
6690
6791
|
* **Example** (FlatMapping an array)
|
|
6691
6792
|
*
|
|
@@ -6707,13 +6808,13 @@ export declare const flatMap: {
|
|
|
6707
6808
|
*
|
|
6708
6809
|
* **When to use**
|
|
6709
6810
|
*
|
|
6710
|
-
* Use to map each element to zero or more values and concatenate the
|
|
6711
|
-
* one pass.
|
|
6811
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
6812
|
+
* results in one pass.
|
|
6712
6813
|
*
|
|
6713
6814
|
* **Details**
|
|
6714
6815
|
*
|
|
6715
|
-
*
|
|
6716
|
-
*
|
|
6816
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6817
|
+
* both the input and mapped arrays are non-empty.
|
|
6717
6818
|
*
|
|
6718
6819
|
* **Example** (FlatMapping an array)
|
|
6719
6820
|
*
|
|
@@ -6735,13 +6836,13 @@ export declare const flatMap: {
|
|
|
6735
6836
|
*
|
|
6736
6837
|
* **When to use**
|
|
6737
6838
|
*
|
|
6738
|
-
* Use to map each element to zero or more values and concatenate the
|
|
6739
|
-
* one pass.
|
|
6839
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
6840
|
+
* results in one pass.
|
|
6740
6841
|
*
|
|
6741
6842
|
* **Details**
|
|
6742
6843
|
*
|
|
6743
|
-
*
|
|
6744
|
-
*
|
|
6844
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6845
|
+
* both the input and mapped arrays are non-empty.
|
|
6745
6846
|
*
|
|
6746
6847
|
* **Example** (FlatMapping an array)
|
|
6747
6848
|
*
|
|
@@ -6763,13 +6864,13 @@ export declare const flatMap: {
|
|
|
6763
6864
|
*
|
|
6764
6865
|
* **When to use**
|
|
6765
6866
|
*
|
|
6766
|
-
* Use to map each element to zero or more values and concatenate the
|
|
6767
|
-
* one pass.
|
|
6867
|
+
* Use to map each array element to zero or more values and concatenate the
|
|
6868
|
+
* results in one pass.
|
|
6768
6869
|
*
|
|
6769
6870
|
* **Details**
|
|
6770
6871
|
*
|
|
6771
|
-
*
|
|
6772
|
-
*
|
|
6872
|
+
* The function receives `(element, index)`. This returns `NonEmptyArray` when
|
|
6873
|
+
* both the input and mapped arrays are non-empty.
|
|
6773
6874
|
*
|
|
6774
6875
|
* **Example** (FlatMapping an array)
|
|
6775
6876
|
*
|
|
@@ -6814,8 +6915,8 @@ export declare const flatten: <const S extends ReadonlyArray<ReadonlyArray<any>>
|
|
|
6814
6915
|
*
|
|
6815
6916
|
* **When to use**
|
|
6816
6917
|
*
|
|
6817
|
-
* Use to collect only present values from `Option` values while
|
|
6818
|
-
* `None` values.
|
|
6918
|
+
* Use to collect only present values from an iterable of `Option` values while
|
|
6919
|
+
* discarding `None` values.
|
|
6819
6920
|
*
|
|
6820
6921
|
* **Example** (Extracting Some values)
|
|
6821
6922
|
*
|
|
@@ -6838,8 +6939,8 @@ export declare const getSomes: <T extends Iterable<Option.Option<X>>, X = any>(s
|
|
|
6838
6939
|
*
|
|
6839
6940
|
* **When to use**
|
|
6840
6941
|
*
|
|
6841
|
-
* Use
|
|
6842
|
-
*
|
|
6942
|
+
* Use when you can drop the success channel and only need the failure
|
|
6943
|
+
* payloads, not the original result wrappers.
|
|
6843
6944
|
*
|
|
6844
6945
|
* **Example** (Extracting failures)
|
|
6845
6946
|
*
|
|
@@ -6863,8 +6964,8 @@ export declare const getFailures: <T extends Iterable<Result.Result<any, any>>>(
|
|
|
6863
6964
|
*
|
|
6864
6965
|
* **When to use**
|
|
6865
6966
|
*
|
|
6866
|
-
* Use
|
|
6867
|
-
*
|
|
6967
|
+
* Use when you can drop the failure channel and only need the success
|
|
6968
|
+
* payloads, not the original result wrappers.
|
|
6868
6969
|
*
|
|
6869
6970
|
* **Example** (Extracting successes)
|
|
6870
6971
|
*
|
|
@@ -6887,13 +6988,12 @@ export declare const getSuccesses: <T extends Iterable<Result.Result<any, any>>>
|
|
|
6887
6988
|
*
|
|
6888
6989
|
* **When to use**
|
|
6889
6990
|
*
|
|
6890
|
-
* Use to
|
|
6891
|
-
* failures.
|
|
6991
|
+
* Use to filter an iterable with a `Result`-returning transformation while
|
|
6992
|
+
* discarding failures.
|
|
6892
6993
|
*
|
|
6893
6994
|
* **Details**
|
|
6894
6995
|
*
|
|
6895
|
-
*
|
|
6896
|
-
* - Failures are discarded.
|
|
6996
|
+
* The filter receives `(element, index)`. Failures are discarded.
|
|
6897
6997
|
*
|
|
6898
6998
|
* **Example** (Filter and transform)
|
|
6899
6999
|
*
|
|
@@ -6916,13 +7016,12 @@ export declare const filterMap: {
|
|
|
6916
7016
|
*
|
|
6917
7017
|
* **When to use**
|
|
6918
7018
|
*
|
|
6919
|
-
* Use to
|
|
6920
|
-
* failures.
|
|
7019
|
+
* Use to filter an iterable with a `Result`-returning transformation while
|
|
7020
|
+
* discarding failures.
|
|
6921
7021
|
*
|
|
6922
7022
|
* **Details**
|
|
6923
7023
|
*
|
|
6924
|
-
*
|
|
6925
|
-
* - Failures are discarded.
|
|
7024
|
+
* The filter receives `(element, index)`. Failures are discarded.
|
|
6926
7025
|
*
|
|
6927
7026
|
* **Example** (Filter and transform)
|
|
6928
7027
|
*
|
|
@@ -6945,13 +7044,12 @@ export declare const filterMap: {
|
|
|
6945
7044
|
*
|
|
6946
7045
|
* **When to use**
|
|
6947
7046
|
*
|
|
6948
|
-
* Use to
|
|
6949
|
-
* failures.
|
|
7047
|
+
* Use to filter an iterable with a `Result`-returning transformation while
|
|
7048
|
+
* discarding failures.
|
|
6950
7049
|
*
|
|
6951
7050
|
* **Details**
|
|
6952
7051
|
*
|
|
6953
|
-
*
|
|
6954
|
-
* - Failures are discarded.
|
|
7052
|
+
* The filter receives `(element, index)`. Failures are discarded.
|
|
6955
7053
|
*
|
|
6956
7054
|
* **Example** (Filter and transform)
|
|
6957
7055
|
*
|
|
@@ -6975,12 +7073,13 @@ export declare const filterMap: {
|
|
|
6975
7073
|
*
|
|
6976
7074
|
* **When to use**
|
|
6977
7075
|
*
|
|
6978
|
-
* Use to
|
|
7076
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7077
|
+
* a boolean predicate or refinement.
|
|
6979
7078
|
*
|
|
6980
7079
|
* **Details**
|
|
6981
7080
|
*
|
|
6982
|
-
*
|
|
6983
|
-
*
|
|
7081
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7082
|
+
* narrowing.
|
|
6984
7083
|
*
|
|
6985
7084
|
* **Example** (Filtering even numbers)
|
|
6986
7085
|
*
|
|
@@ -7002,12 +7101,13 @@ export declare const filter: {
|
|
|
7002
7101
|
*
|
|
7003
7102
|
* **When to use**
|
|
7004
7103
|
*
|
|
7005
|
-
* Use to
|
|
7104
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7105
|
+
* a boolean predicate or refinement.
|
|
7006
7106
|
*
|
|
7007
7107
|
* **Details**
|
|
7008
7108
|
*
|
|
7009
|
-
*
|
|
7010
|
-
*
|
|
7109
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7110
|
+
* narrowing.
|
|
7011
7111
|
*
|
|
7012
7112
|
* **Example** (Filtering even numbers)
|
|
7013
7113
|
*
|
|
@@ -7029,12 +7129,13 @@ export declare const filter: {
|
|
|
7029
7129
|
*
|
|
7030
7130
|
* **When to use**
|
|
7031
7131
|
*
|
|
7032
|
-
* Use to
|
|
7132
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7133
|
+
* a boolean predicate or refinement.
|
|
7033
7134
|
*
|
|
7034
7135
|
* **Details**
|
|
7035
7136
|
*
|
|
7036
|
-
*
|
|
7037
|
-
*
|
|
7137
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7138
|
+
* narrowing.
|
|
7038
7139
|
*
|
|
7039
7140
|
* **Example** (Filtering even numbers)
|
|
7040
7141
|
*
|
|
@@ -7056,12 +7157,13 @@ export declare const filter: {
|
|
|
7056
7157
|
*
|
|
7057
7158
|
* **When to use**
|
|
7058
7159
|
*
|
|
7059
|
-
* Use to
|
|
7160
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7161
|
+
* a boolean predicate or refinement.
|
|
7060
7162
|
*
|
|
7061
7163
|
* **Details**
|
|
7062
7164
|
*
|
|
7063
|
-
*
|
|
7064
|
-
*
|
|
7165
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7166
|
+
* narrowing.
|
|
7065
7167
|
*
|
|
7066
7168
|
* **Example** (Filtering even numbers)
|
|
7067
7169
|
*
|
|
@@ -7083,12 +7185,13 @@ export declare const filter: {
|
|
|
7083
7185
|
*
|
|
7084
7186
|
* **When to use**
|
|
7085
7187
|
*
|
|
7086
|
-
* Use to
|
|
7188
|
+
* Use to filter an iterable into a new array of original elements that satisfy
|
|
7189
|
+
* a boolean predicate or refinement.
|
|
7087
7190
|
*
|
|
7088
7191
|
* **Details**
|
|
7089
7192
|
*
|
|
7090
|
-
*
|
|
7091
|
-
*
|
|
7193
|
+
* The predicate receives `(element, index)`. Refinements are supported for type
|
|
7194
|
+
* narrowing.
|
|
7092
7195
|
*
|
|
7093
7196
|
* **Example** (Filtering even numbers)
|
|
7094
7197
|
*
|
|
@@ -7111,13 +7214,12 @@ export declare const filter: {
|
|
|
7111
7214
|
*
|
|
7112
7215
|
* **When to use**
|
|
7113
7216
|
*
|
|
7114
|
-
* Use to
|
|
7115
|
-
* failure and success values.
|
|
7217
|
+
* Use to partition an iterable by evaluating each element with a
|
|
7218
|
+
* `Result`-returning filter and keeping both failure and success values.
|
|
7116
7219
|
*
|
|
7117
7220
|
* **Details**
|
|
7118
7221
|
*
|
|
7119
|
-
*
|
|
7120
|
-
* - The filter receives `(element, index)`.
|
|
7222
|
+
* Returns `[excluded, satisfying]`. The filter receives `(element, index)`.
|
|
7121
7223
|
*
|
|
7122
7224
|
* **Example** (Partitioning with a filter)
|
|
7123
7225
|
*
|
|
@@ -7143,13 +7245,12 @@ export declare const partition: {
|
|
|
7143
7245
|
*
|
|
7144
7246
|
* **When to use**
|
|
7145
7247
|
*
|
|
7146
|
-
* Use to
|
|
7147
|
-
* failure and success values.
|
|
7248
|
+
* Use to partition an iterable by evaluating each element with a
|
|
7249
|
+
* `Result`-returning filter and keeping both failure and success values.
|
|
7148
7250
|
*
|
|
7149
7251
|
* **Details**
|
|
7150
7252
|
*
|
|
7151
|
-
*
|
|
7152
|
-
* - The filter receives `(element, index)`.
|
|
7253
|
+
* Returns `[excluded, satisfying]`. The filter receives `(element, index)`.
|
|
7153
7254
|
*
|
|
7154
7255
|
* **Example** (Partitioning with a filter)
|
|
7155
7256
|
*
|
|
@@ -7175,13 +7276,12 @@ export declare const partition: {
|
|
|
7175
7276
|
*
|
|
7176
7277
|
* **When to use**
|
|
7177
7278
|
*
|
|
7178
|
-
* Use to
|
|
7179
|
-
* failure and success values.
|
|
7279
|
+
* Use to partition an iterable by evaluating each element with a
|
|
7280
|
+
* `Result`-returning filter and keeping both failure and success values.
|
|
7180
7281
|
*
|
|
7181
7282
|
* **Details**
|
|
7182
7283
|
*
|
|
7183
|
-
*
|
|
7184
|
-
* - The filter receives `(element, index)`.
|
|
7284
|
+
* Returns `[excluded, satisfying]`. The filter receives `(element, index)`.
|
|
7185
7285
|
*
|
|
7186
7286
|
* **Example** (Partitioning with a filter)
|
|
7187
7287
|
*
|
|
@@ -7208,12 +7308,12 @@ export declare const partition: {
|
|
|
7208
7308
|
*
|
|
7209
7309
|
* **When to use**
|
|
7210
7310
|
*
|
|
7211
|
-
* Use to split
|
|
7311
|
+
* Use to split an iterable of `Result` values into failure and success arrays.
|
|
7212
7312
|
*
|
|
7213
7313
|
* **Details**
|
|
7214
7314
|
*
|
|
7215
|
-
*
|
|
7216
|
-
*
|
|
7315
|
+
* Returns `[failures, successes]`. This is equivalent to
|
|
7316
|
+
* `partition(identity)`.
|
|
7217
7317
|
*
|
|
7218
7318
|
* **Example** (Separating Results)
|
|
7219
7319
|
*
|
|
@@ -7247,7 +7347,7 @@ export declare const separate: <T extends Iterable<Result.Result<any, any>>>(sel
|
|
|
7247
7347
|
*
|
|
7248
7348
|
* **Details**
|
|
7249
7349
|
*
|
|
7250
|
-
*
|
|
7350
|
+
* The function receives `(accumulator, element, index)`.
|
|
7251
7351
|
*
|
|
7252
7352
|
* **Example** (Summing an array)
|
|
7253
7353
|
*
|
|
@@ -7273,7 +7373,7 @@ export declare const reduce: {
|
|
|
7273
7373
|
*
|
|
7274
7374
|
* **Details**
|
|
7275
7375
|
*
|
|
7276
|
-
*
|
|
7376
|
+
* The function receives `(accumulator, element, index)`.
|
|
7277
7377
|
*
|
|
7278
7378
|
* **Example** (Summing an array)
|
|
7279
7379
|
*
|
|
@@ -7299,7 +7399,7 @@ export declare const reduce: {
|
|
|
7299
7399
|
*
|
|
7300
7400
|
* **Details**
|
|
7301
7401
|
*
|
|
7302
|
-
*
|
|
7402
|
+
* The function receives `(accumulator, element, index)`.
|
|
7303
7403
|
*
|
|
7304
7404
|
* **Example** (Summing an array)
|
|
7305
7405
|
*
|
|
@@ -7322,12 +7422,11 @@ export declare const reduce: {
|
|
|
7322
7422
|
*
|
|
7323
7423
|
* **When to use**
|
|
7324
7424
|
*
|
|
7325
|
-
* Use when
|
|
7326
|
-
* left.
|
|
7425
|
+
* Use when you need to fold values from right to left.
|
|
7327
7426
|
*
|
|
7328
7427
|
* **Details**
|
|
7329
7428
|
*
|
|
7330
|
-
*
|
|
7429
|
+
* The function receives `(accumulator, element, index)`.
|
|
7331
7430
|
*
|
|
7332
7431
|
* **Example** (Right-to-left fold)
|
|
7333
7432
|
*
|
|
@@ -7349,12 +7448,11 @@ export declare const reduceRight: {
|
|
|
7349
7448
|
*
|
|
7350
7449
|
* **When to use**
|
|
7351
7450
|
*
|
|
7352
|
-
* Use when
|
|
7353
|
-
* left.
|
|
7451
|
+
* Use when you need to fold values from right to left.
|
|
7354
7452
|
*
|
|
7355
7453
|
* **Details**
|
|
7356
7454
|
*
|
|
7357
|
-
*
|
|
7455
|
+
* The function receives `(accumulator, element, index)`.
|
|
7358
7456
|
*
|
|
7359
7457
|
* **Example** (Right-to-left fold)
|
|
7360
7458
|
*
|
|
@@ -7376,12 +7474,11 @@ export declare const reduceRight: {
|
|
|
7376
7474
|
*
|
|
7377
7475
|
* **When to use**
|
|
7378
7476
|
*
|
|
7379
|
-
* Use when
|
|
7380
|
-
* left.
|
|
7477
|
+
* Use when you need to fold values from right to left.
|
|
7381
7478
|
*
|
|
7382
7479
|
* **Details**
|
|
7383
7480
|
*
|
|
7384
|
-
*
|
|
7481
|
+
* The function receives `(accumulator, element, index)`.
|
|
7385
7482
|
*
|
|
7386
7483
|
* **Example** (Right-to-left fold)
|
|
7387
7484
|
*
|
|
@@ -7447,6 +7544,11 @@ export declare const liftPredicate: {
|
|
|
7447
7544
|
* Lifts an `Option`-returning function into one that returns an array:
|
|
7448
7545
|
* `Some(a)` becomes `[a]`, `None` becomes `[]`.
|
|
7449
7546
|
*
|
|
7547
|
+
* **When to use**
|
|
7548
|
+
*
|
|
7549
|
+
* Use when an optional parser or lookup should participate in array pipelines
|
|
7550
|
+
* as zero-or-one results.
|
|
7551
|
+
*
|
|
7450
7552
|
* **Example** (Lifting an Option function)
|
|
7451
7553
|
*
|
|
7452
7554
|
* ```ts
|
|
@@ -7522,7 +7624,7 @@ export declare const liftNullishOr: <A extends Array<unknown>, B>(f: (...a: A) =
|
|
|
7522
7624
|
*
|
|
7523
7625
|
* **When to use**
|
|
7524
7626
|
*
|
|
7525
|
-
* Use when
|
|
7627
|
+
* Use when you need to map and filter in one step, where the mapper can return
|
|
7526
7628
|
* `null` or `undefined` to skip elements.
|
|
7527
7629
|
*
|
|
7528
7630
|
* **Example** (FlatMapping with nullable)
|
|
@@ -7547,7 +7649,7 @@ export declare const flatMapNullishOr: {
|
|
|
7547
7649
|
*
|
|
7548
7650
|
* **When to use**
|
|
7549
7651
|
*
|
|
7550
|
-
* Use when
|
|
7652
|
+
* Use when you need to map and filter in one step, where the mapper can return
|
|
7551
7653
|
* `null` or `undefined` to skip elements.
|
|
7552
7654
|
*
|
|
7553
7655
|
* **Example** (FlatMapping with nullable)
|
|
@@ -7572,7 +7674,7 @@ export declare const flatMapNullishOr: {
|
|
|
7572
7674
|
*
|
|
7573
7675
|
* **When to use**
|
|
7574
7676
|
*
|
|
7575
|
-
* Use when
|
|
7677
|
+
* Use when you need to map and filter in one step, where the mapper can return
|
|
7576
7678
|
* `null` or `undefined` to skip elements.
|
|
7577
7679
|
*
|
|
7578
7680
|
* **Example** (FlatMapping with nullable)
|
|
@@ -7596,6 +7698,11 @@ export declare const flatMapNullishOr: {
|
|
|
7596
7698
|
* Lifts a `Result`-returning function into one that returns an array: failures
|
|
7597
7699
|
* produce `[]`, successes produce `[value]`.
|
|
7598
7700
|
*
|
|
7701
|
+
* **When to use**
|
|
7702
|
+
*
|
|
7703
|
+
* Use when a fallible parser or lookup should participate in array pipelines as
|
|
7704
|
+
* zero-or-one results and the failure value should be discarded.
|
|
7705
|
+
*
|
|
7599
7706
|
* **Example** (Lifting a Result function)
|
|
7600
7707
|
*
|
|
7601
7708
|
* ```ts
|
|
@@ -7624,7 +7731,7 @@ export declare const liftResult: <A extends Array<unknown>, E, B>(f: (...a: A) =
|
|
|
7624
7731
|
*
|
|
7625
7732
|
* **When to use**
|
|
7626
7733
|
*
|
|
7627
|
-
* Use to check
|
|
7734
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
7628
7735
|
* refinement-based type narrowing.
|
|
7629
7736
|
*
|
|
7630
7737
|
* **Example** (Testing all elements)
|
|
@@ -7648,7 +7755,7 @@ export declare const every: {
|
|
|
7648
7755
|
*
|
|
7649
7756
|
* **When to use**
|
|
7650
7757
|
*
|
|
7651
|
-
* Use to check
|
|
7758
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
7652
7759
|
* refinement-based type narrowing.
|
|
7653
7760
|
*
|
|
7654
7761
|
* **Example** (Testing all elements)
|
|
@@ -7672,7 +7779,7 @@ export declare const every: {
|
|
|
7672
7779
|
*
|
|
7673
7780
|
* **When to use**
|
|
7674
7781
|
*
|
|
7675
|
-
* Use to check
|
|
7782
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
7676
7783
|
* refinement-based type narrowing.
|
|
7677
7784
|
*
|
|
7678
7785
|
* **Example** (Testing all elements)
|
|
@@ -7696,7 +7803,7 @@ export declare const every: {
|
|
|
7696
7803
|
*
|
|
7697
7804
|
* **When to use**
|
|
7698
7805
|
*
|
|
7699
|
-
* Use to check
|
|
7806
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
7700
7807
|
* refinement-based type narrowing.
|
|
7701
7808
|
*
|
|
7702
7809
|
* **Example** (Testing all elements)
|
|
@@ -7720,7 +7827,7 @@ export declare const every: {
|
|
|
7720
7827
|
*
|
|
7721
7828
|
* **When to use**
|
|
7722
7829
|
*
|
|
7723
|
-
* Use to check
|
|
7830
|
+
* Use to check whether every array element satisfies a predicate, including
|
|
7724
7831
|
* refinement-based type narrowing.
|
|
7725
7832
|
*
|
|
7726
7833
|
* **Example** (Testing all elements)
|
|
@@ -7806,12 +7913,12 @@ export declare const some: {
|
|
|
7806
7913
|
*
|
|
7807
7914
|
* **When to use**
|
|
7808
7915
|
*
|
|
7809
|
-
* Use when a
|
|
7916
|
+
* Use when you need to compute a result from every suffix of an array, such as
|
|
7810
7917
|
* cumulative aggregations from each position.
|
|
7811
7918
|
*
|
|
7812
7919
|
* **Details**
|
|
7813
7920
|
*
|
|
7814
|
-
*
|
|
7921
|
+
* For index `i`, the function receives `self.slice(i)`.
|
|
7815
7922
|
*
|
|
7816
7923
|
* **Example** (Suffix lengths)
|
|
7817
7924
|
*
|
|
@@ -7833,12 +7940,12 @@ export declare const extend: {
|
|
|
7833
7940
|
*
|
|
7834
7941
|
* **When to use**
|
|
7835
7942
|
*
|
|
7836
|
-
* Use when a
|
|
7943
|
+
* Use when you need to compute a result from every suffix of an array, such as
|
|
7837
7944
|
* cumulative aggregations from each position.
|
|
7838
7945
|
*
|
|
7839
7946
|
* **Details**
|
|
7840
7947
|
*
|
|
7841
|
-
*
|
|
7948
|
+
* For index `i`, the function receives `self.slice(i)`.
|
|
7842
7949
|
*
|
|
7843
7950
|
* **Example** (Suffix lengths)
|
|
7844
7951
|
*
|
|
@@ -7860,12 +7967,12 @@ export declare const extend: {
|
|
|
7860
7967
|
*
|
|
7861
7968
|
* **When to use**
|
|
7862
7969
|
*
|
|
7863
|
-
* Use when a
|
|
7970
|
+
* Use when you need to compute a result from every suffix of an array, such as
|
|
7864
7971
|
* cumulative aggregations from each position.
|
|
7865
7972
|
*
|
|
7866
7973
|
* **Details**
|
|
7867
7974
|
*
|
|
7868
|
-
*
|
|
7975
|
+
* For index `i`, the function receives `self.slice(i)`.
|
|
7869
7976
|
*
|
|
7870
7977
|
* **Example** (Suffix lengths)
|
|
7871
7978
|
*
|
|
@@ -8258,7 +8365,7 @@ export declare const dedupe: <S extends Iterable<any>>(self: S) => S extends Non
|
|
|
8258
8365
|
*
|
|
8259
8366
|
* **Details**
|
|
8260
8367
|
*
|
|
8261
|
-
*
|
|
8368
|
+
* Non-adjacent duplicates are preserved.
|
|
8262
8369
|
*
|
|
8263
8370
|
* **Example** (Deduplicating adjacent elements)
|
|
8264
8371
|
*
|
|
@@ -8287,7 +8394,7 @@ export declare const dedupeAdjacentWith: {
|
|
|
8287
8394
|
*
|
|
8288
8395
|
* **Details**
|
|
8289
8396
|
*
|
|
8290
|
-
*
|
|
8397
|
+
* Non-adjacent duplicates are preserved.
|
|
8291
8398
|
*
|
|
8292
8399
|
* **Example** (Deduplicating adjacent elements)
|
|
8293
8400
|
*
|
|
@@ -8316,7 +8423,7 @@ export declare const dedupeAdjacentWith: {
|
|
|
8316
8423
|
*
|
|
8317
8424
|
* **Details**
|
|
8318
8425
|
*
|
|
8319
|
-
*
|
|
8426
|
+
* Non-adjacent duplicates are preserved.
|
|
8320
8427
|
*
|
|
8321
8428
|
* **Example** (Deduplicating adjacent elements)
|
|
8322
8429
|
*
|
|
@@ -8415,15 +8522,15 @@ export declare const join: {
|
|
|
8415
8522
|
*
|
|
8416
8523
|
* **When to use**
|
|
8417
8524
|
*
|
|
8418
|
-
* Use when
|
|
8419
|
-
*
|
|
8525
|
+
* Use when you need to map while threading state through each element and keep
|
|
8526
|
+
* the final state.
|
|
8420
8527
|
*
|
|
8421
8528
|
* **Details**
|
|
8422
8529
|
*
|
|
8423
|
-
*
|
|
8424
|
-
*
|
|
8425
|
-
*
|
|
8426
|
-
*
|
|
8530
|
+
* Combines `map` and `reduce` in a single pass. The callback receives the
|
|
8531
|
+
* current state, element, and index, and returns `[nextState, mappedValue]`.
|
|
8532
|
+
* The result is `[finalState, mappedArray]`. This can be used in both
|
|
8533
|
+
* data-first and data-last style.
|
|
8427
8534
|
*
|
|
8428
8535
|
* **Example** (Running sum alongside mapped values)
|
|
8429
8536
|
*
|
|
@@ -8446,15 +8553,15 @@ export declare const mapAccum: {
|
|
|
8446
8553
|
*
|
|
8447
8554
|
* **When to use**
|
|
8448
8555
|
*
|
|
8449
|
-
* Use when
|
|
8450
|
-
*
|
|
8556
|
+
* Use when you need to map while threading state through each element and keep
|
|
8557
|
+
* the final state.
|
|
8451
8558
|
*
|
|
8452
8559
|
* **Details**
|
|
8453
8560
|
*
|
|
8454
|
-
*
|
|
8455
|
-
*
|
|
8456
|
-
*
|
|
8457
|
-
*
|
|
8561
|
+
* Combines `map` and `reduce` in a single pass. The callback receives the
|
|
8562
|
+
* current state, element, and index, and returns `[nextState, mappedValue]`.
|
|
8563
|
+
* The result is `[finalState, mappedArray]`. This can be used in both
|
|
8564
|
+
* data-first and data-last style.
|
|
8458
8565
|
*
|
|
8459
8566
|
* **Example** (Running sum alongside mapped values)
|
|
8460
8567
|
*
|
|
@@ -8477,15 +8584,15 @@ export declare const mapAccum: {
|
|
|
8477
8584
|
*
|
|
8478
8585
|
* **When to use**
|
|
8479
8586
|
*
|
|
8480
|
-
* Use when
|
|
8481
|
-
*
|
|
8587
|
+
* Use when you need to map while threading state through each element and keep
|
|
8588
|
+
* the final state.
|
|
8482
8589
|
*
|
|
8483
8590
|
* **Details**
|
|
8484
8591
|
*
|
|
8485
|
-
*
|
|
8486
|
-
*
|
|
8487
|
-
*
|
|
8488
|
-
*
|
|
8592
|
+
* Combines `map` and `reduce` in a single pass. The callback receives the
|
|
8593
|
+
* current state, element, and index, and returns `[nextState, mappedValue]`.
|
|
8594
|
+
* The result is `[finalState, mappedArray]`. This can be used in both
|
|
8595
|
+
* data-first and data-last style.
|
|
8489
8596
|
*
|
|
8490
8597
|
* **Example** (Running sum alongside mapped values)
|
|
8491
8598
|
*
|
|
@@ -8514,9 +8621,9 @@ export declare const mapAccum: {
|
|
|
8514
8621
|
*
|
|
8515
8622
|
* **Details**
|
|
8516
8623
|
*
|
|
8517
|
-
*
|
|
8518
|
-
*
|
|
8519
|
-
*
|
|
8624
|
+
* Produces every combination of an element from `self` with an element from
|
|
8625
|
+
* `that`, so the result length is `self.length * that.length`. Iteration visits
|
|
8626
|
+
* every element of `that` for each element of `self`.
|
|
8520
8627
|
*
|
|
8521
8628
|
* **Example** (Combining numbers and letters)
|
|
8522
8629
|
*
|
|
@@ -8543,9 +8650,9 @@ export declare const cartesianWith: {
|
|
|
8543
8650
|
*
|
|
8544
8651
|
* **Details**
|
|
8545
8652
|
*
|
|
8546
|
-
*
|
|
8547
|
-
*
|
|
8548
|
-
*
|
|
8653
|
+
* Produces every combination of an element from `self` with an element from
|
|
8654
|
+
* `that`, so the result length is `self.length * that.length`. Iteration visits
|
|
8655
|
+
* every element of `that` for each element of `self`.
|
|
8549
8656
|
*
|
|
8550
8657
|
* **Example** (Combining numbers and letters)
|
|
8551
8658
|
*
|
|
@@ -8572,9 +8679,9 @@ export declare const cartesianWith: {
|
|
|
8572
8679
|
*
|
|
8573
8680
|
* **Details**
|
|
8574
8681
|
*
|
|
8575
|
-
*
|
|
8576
|
-
*
|
|
8577
|
-
*
|
|
8682
|
+
* Produces every combination of an element from `self` with an element from
|
|
8683
|
+
* `that`, so the result length is `self.length * that.length`. Iteration visits
|
|
8684
|
+
* every element of `that` for each element of `self`.
|
|
8578
8685
|
*
|
|
8579
8686
|
* **Example** (Combining numbers and letters)
|
|
8580
8687
|
*
|
|
@@ -8601,8 +8708,8 @@ export declare const cartesianWith: {
|
|
|
8601
8708
|
*
|
|
8602
8709
|
* **Details**
|
|
8603
8710
|
*
|
|
8604
|
-
*
|
|
8605
|
-
*
|
|
8711
|
+
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
8712
|
+
* from `that`, so the result length is `self.length * that.length`.
|
|
8606
8713
|
*
|
|
8607
8714
|
* **Example** (All pairs of two arrays)
|
|
8608
8715
|
*
|
|
@@ -8628,8 +8735,8 @@ export declare const cartesian: {
|
|
|
8628
8735
|
*
|
|
8629
8736
|
* **Details**
|
|
8630
8737
|
*
|
|
8631
|
-
*
|
|
8632
|
-
*
|
|
8738
|
+
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
8739
|
+
* from `that`, so the result length is `self.length * that.length`.
|
|
8633
8740
|
*
|
|
8634
8741
|
* **Example** (All pairs of two arrays)
|
|
8635
8742
|
*
|
|
@@ -8655,8 +8762,8 @@ export declare const cartesian: {
|
|
|
8655
8762
|
*
|
|
8656
8763
|
* **Details**
|
|
8657
8764
|
*
|
|
8658
|
-
*
|
|
8659
|
-
*
|
|
8765
|
+
* Produces every `[a, b]` combination of an element from `self` with an element
|
|
8766
|
+
* from `that`, so the result length is `self.length * that.length`.
|
|
8660
8767
|
*
|
|
8661
8768
|
* **Example** (All pairs of two arrays)
|
|
8662
8769
|
*
|
|
@@ -8679,9 +8786,14 @@ export declare const cartesian: {
|
|
|
8679
8786
|
*
|
|
8680
8787
|
* **When to use**
|
|
8681
8788
|
*
|
|
8682
|
-
* Use when
|
|
8683
|
-
*
|
|
8684
|
-
*
|
|
8789
|
+
* Use when you want array-comprehension style code with do notation.
|
|
8790
|
+
*
|
|
8791
|
+
* **Details**
|
|
8792
|
+
*
|
|
8793
|
+
* Use {@link bind} to introduce array variables and {@link let_ let} for plain
|
|
8794
|
+
* values. Each `bind` produces the cartesian product of all bound variables,
|
|
8795
|
+
* like nested loops. Use `filter` and `map` in the pipeline to add conditions
|
|
8796
|
+
* and transformations.
|
|
8685
8797
|
*
|
|
8686
8798
|
* **Example** (Array comprehension with do notation)
|
|
8687
8799
|
*
|
|
@@ -8716,9 +8828,9 @@ export declare const Do: ReadonlyArray<{}>;
|
|
|
8716
8828
|
*
|
|
8717
8829
|
* **Details**
|
|
8718
8830
|
*
|
|
8719
|
-
*
|
|
8720
|
-
*
|
|
8721
|
-
*
|
|
8831
|
+
* Each `bind` call adds a named property to the accumulated object. The
|
|
8832
|
+
* callback receives the current scope and must return an array. This is
|
|
8833
|
+
* equivalent to `flatMap` plus merging the new value into the scope object.
|
|
8722
8834
|
*
|
|
8723
8835
|
* **Example** (Binding two arrays)
|
|
8724
8836
|
*
|
|
@@ -8752,9 +8864,9 @@ export declare const bind: {
|
|
|
8752
8864
|
*
|
|
8753
8865
|
* **Details**
|
|
8754
8866
|
*
|
|
8755
|
-
*
|
|
8756
|
-
*
|
|
8757
|
-
*
|
|
8867
|
+
* Each `bind` call adds a named property to the accumulated object. The
|
|
8868
|
+
* callback receives the current scope and must return an array. This is
|
|
8869
|
+
* equivalent to `flatMap` plus merging the new value into the scope object.
|
|
8758
8870
|
*
|
|
8759
8871
|
* **Example** (Binding two arrays)
|
|
8760
8872
|
*
|
|
@@ -8790,9 +8902,9 @@ export declare const bind: {
|
|
|
8790
8902
|
*
|
|
8791
8903
|
* **Details**
|
|
8792
8904
|
*
|
|
8793
|
-
*
|
|
8794
|
-
*
|
|
8795
|
-
*
|
|
8905
|
+
* Each `bind` call adds a named property to the accumulated object. The
|
|
8906
|
+
* callback receives the current scope and must return an array. This is
|
|
8907
|
+
* equivalent to `flatMap` plus merging the new value into the scope object.
|
|
8796
8908
|
*
|
|
8797
8909
|
* **Example** (Binding two arrays)
|
|
8798
8910
|
*
|
|
@@ -8829,8 +8941,8 @@ export declare const bind: {
|
|
|
8829
8941
|
*
|
|
8830
8942
|
* **Details**
|
|
8831
8943
|
*
|
|
8832
|
-
*
|
|
8833
|
-
*
|
|
8944
|
+
* Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`. This is an
|
|
8945
|
+
* alternative to starting with `Do` plus `bind` when you already have an array.
|
|
8834
8946
|
*
|
|
8835
8947
|
* **Example** (Naming an existing array)
|
|
8836
8948
|
*
|
|
@@ -8861,8 +8973,8 @@ export declare const bindTo: {
|
|
|
8861
8973
|
*
|
|
8862
8974
|
* **Details**
|
|
8863
8975
|
*
|
|
8864
|
-
*
|
|
8865
|
-
*
|
|
8976
|
+
* Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`. This is an
|
|
8977
|
+
* alternative to starting with `Do` plus `bind` when you already have an array.
|
|
8866
8978
|
*
|
|
8867
8979
|
* **Example** (Naming an existing array)
|
|
8868
8980
|
*
|
|
@@ -8895,8 +9007,8 @@ export declare const bindTo: {
|
|
|
8895
9007
|
*
|
|
8896
9008
|
* **Details**
|
|
8897
9009
|
*
|
|
8898
|
-
*
|
|
8899
|
-
*
|
|
9010
|
+
* Equivalent to `Array.map(self, (a) => ({ [tag]: a }))`. This is an
|
|
9011
|
+
* alternative to starting with `Do` plus `bind` when you already have an array.
|
|
8900
9012
|
*
|
|
8901
9013
|
* **Example** (Naming an existing array)
|
|
8902
9014
|
*
|
|
@@ -8932,10 +9044,16 @@ export {
|
|
|
8932
9044
|
/**
|
|
8933
9045
|
* Adds a computed plain value to the do-notation scope without introducing a new array dimension.
|
|
8934
9046
|
*
|
|
9047
|
+
* **When to use**
|
|
9048
|
+
*
|
|
9049
|
+
* Use when each do-notation branch needs a derived field from the current
|
|
9050
|
+
* bindings without multiplying the number of branches.
|
|
9051
|
+
*
|
|
8935
9052
|
* **Details**
|
|
8936
9053
|
*
|
|
8937
|
-
*
|
|
8938
|
-
*
|
|
9054
|
+
* Unlike `bind`, the callback returns a single value instead of an array, so
|
|
9055
|
+
* no cartesian product occurs. Use this for derived or intermediate values
|
|
9056
|
+
* that depend on previously bound variables.
|
|
8939
9057
|
*
|
|
8940
9058
|
* **Example** (Adding a computed value)
|
|
8941
9059
|
*
|
|
@@ -8981,13 +9099,13 @@ export declare function makeReducerConcat<A>(): Reducer.Reducer<Array<A>>;
|
|
|
8981
9099
|
*
|
|
8982
9100
|
* **When to use**
|
|
8983
9101
|
*
|
|
8984
|
-
* Use to count how many elements
|
|
8985
|
-
*
|
|
9102
|
+
* Use when you need to count how many elements of an iterable satisfy a
|
|
9103
|
+
* predicate.
|
|
8986
9104
|
*
|
|
8987
9105
|
* **Details**
|
|
8988
9106
|
*
|
|
8989
|
-
*
|
|
8990
|
-
*
|
|
9107
|
+
* The predicate receives both the element and its index. Empty iterables return
|
|
9108
|
+
* `0`.
|
|
8991
9109
|
*
|
|
8992
9110
|
* **Example** (Counting even numbers)
|
|
8993
9111
|
*
|
|
@@ -9009,13 +9127,13 @@ export declare const countBy: {
|
|
|
9009
9127
|
*
|
|
9010
9128
|
* **When to use**
|
|
9011
9129
|
*
|
|
9012
|
-
* Use to count how many elements
|
|
9013
|
-
*
|
|
9130
|
+
* Use when you need to count how many elements of an iterable satisfy a
|
|
9131
|
+
* predicate.
|
|
9014
9132
|
*
|
|
9015
9133
|
* **Details**
|
|
9016
9134
|
*
|
|
9017
|
-
*
|
|
9018
|
-
*
|
|
9135
|
+
* The predicate receives both the element and its index. Empty iterables return
|
|
9136
|
+
* `0`.
|
|
9019
9137
|
*
|
|
9020
9138
|
* **Example** (Counting even numbers)
|
|
9021
9139
|
*
|
|
@@ -9037,13 +9155,13 @@ export declare const countBy: {
|
|
|
9037
9155
|
*
|
|
9038
9156
|
* **When to use**
|
|
9039
9157
|
*
|
|
9040
|
-
* Use to count how many elements
|
|
9041
|
-
*
|
|
9158
|
+
* Use when you need to count how many elements of an iterable satisfy a
|
|
9159
|
+
* predicate.
|
|
9042
9160
|
*
|
|
9043
9161
|
* **Details**
|
|
9044
9162
|
*
|
|
9045
|
-
*
|
|
9046
|
-
*
|
|
9163
|
+
* The predicate receives both the element and its index. Empty iterables return
|
|
9164
|
+
* `0`.
|
|
9047
9165
|
*
|
|
9048
9166
|
* **Example** (Counting even numbers)
|
|
9049
9167
|
*
|