effect 4.0.0-beta.70 → 4.0.0-beta.72
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 +1483 -239
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +617 -164
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +646 -52
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +331 -28
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +474 -18
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +292 -14
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +239 -19
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +163 -13
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +53 -8
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +82 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +73 -12
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +53 -15
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +488 -200
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +349 -129
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +539 -158
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +222 -89
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +81 -6
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -4
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +179 -54
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +65 -22
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +60 -3
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +31 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +21 -21
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +14 -18
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +135 -50
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +109 -37
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +52 -29
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +21 -21
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +32 -7
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +32 -7
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +503 -48
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +191 -17
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +116 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +92 -6
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +30 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +30 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +92 -47
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +16 -12
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +313 -128
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +167 -68
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +345 -79
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +131 -12
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +5 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +203 -50
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +112 -32
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2006 -810
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +785 -350
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +16 -2
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +16 -2
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +100 -8
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +141 -8
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +10 -11
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +7 -8
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +46 -43
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +43 -35
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +135 -16
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +93 -12
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -26
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +28 -2
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +149 -101
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +117 -80
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +321 -72
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +152 -3
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +6 -6
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberMap.d.ts +18 -18
- package/dist/FiberMap.js +8 -8
- package/dist/FiberSet.d.ts +21 -13
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -9
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +79 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +93 -33
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +221 -2
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +155 -2
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +4 -6
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -5
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +164 -18
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +116 -15
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +297 -25
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +75 -12
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +59 -26
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +95 -19
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +119 -17
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +35 -37
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +13 -15
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +210 -9
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +95 -5
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +16 -16
- package/dist/HashSet.js +6 -6
- package/dist/Inspectable.d.ts +47 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +74 -17
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +261 -81
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +123 -43
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +34 -19
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +52 -44
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -5
- package/dist/JsonPointer.js +5 -5
- package/dist/JsonSchema.d.ts +77 -33
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +45 -31
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +158 -13
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +79 -4
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +297 -101
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +94 -36
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +9 -2
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +1 -2
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +96 -21
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +68 -9
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +21 -7
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +26 -13
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +82 -10
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +33 -2
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +215 -42
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +242 -59
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +68 -41
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +60 -33
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +285 -40
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +128 -7
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +111 -4
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +98 -39
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +24 -6
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +23 -5
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +141 -4
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +73 -2
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +20 -11
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -6
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +22 -6
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +6 -1
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +434 -17
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +268 -13
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +26 -33
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +18 -25
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +186 -150
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +75 -72
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +93 -120
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +149 -142
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +37 -5
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +22 -3
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +238 -15
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +106 -8
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +34 -6
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +19 -5
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +29 -4
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +16 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +53 -4
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +45 -4
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +140 -14
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +63 -8
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +98 -168
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +109 -120
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +75 -9
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +70 -9
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +241 -66
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +187 -52
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +148 -3
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +69 -2
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +167 -59
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +163 -55
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +71 -16
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +171 -9
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +49 -3
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +73 -18
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +23 -3
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +174 -53
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +128 -23
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +27 -23
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +22 -18
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +82 -4
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +64 -4
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +17 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -4
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +168 -32
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +135 -30
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +226 -30
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +162 -23
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +15 -2
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +49 -3
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +218 -35
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +57 -10
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +213 -29
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +99 -11
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +62 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +52 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +380 -57
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +176 -32
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +124 -14
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +150 -25
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +436 -115
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +344 -107
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +53 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +42 -3
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +934 -239
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +655 -217
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +239 -28
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +239 -28
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +127 -129
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +115 -117
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +45 -56
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +39 -50
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +254 -15
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +295 -33
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +101 -71
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +92 -56
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +86 -50
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +9 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +38 -11
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +127 -25
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +91 -21
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +364 -19
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +155 -7
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +69 -7
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +49 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +348 -29
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +103 -8
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +343 -45
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +194 -26
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +72 -17
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +62 -16
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +774 -224
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +333 -91
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +219 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +179 -29
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +54 -110
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +26 -42
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +341 -105
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +162 -44
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +25 -7
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +25 -7
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +529 -29
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +193 -11
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +36 -13
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +5 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +76 -20
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +41 -5
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +74 -7
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +74 -7
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +67 -30
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +7 -7
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +96 -108
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -52
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +42 -9
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +42 -9
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +85 -2
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +56 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +20 -20
- package/dist/TxHashMap.js +8 -8
- package/dist/TxHashSet.d.ts +14 -14
- package/dist/TxHashSet.js +6 -6
- package/dist/TxPriorityQueue.d.ts +43 -8
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +41 -6
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +98 -8
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +70 -8
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +58 -17
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +10 -10
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +88 -16
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +78 -14
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +113 -8
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +82 -8
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +173 -14
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +130 -14
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +206 -3
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +111 -3
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +68 -13
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +171 -30
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +115 -30
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +130 -22
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +36 -12
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +21 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +14 -6
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -5205
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5205
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/request.js +3 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +11 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/representation.js +21 -12
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +69 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +73 -9
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +79 -30
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +69 -31
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -107
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -107
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +33 -5
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +33 -5
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +9 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +43 -11
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +45 -6
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +73 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +104 -8
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +103 -7
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +8 -3
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -3
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +51 -7
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +50 -6
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +299 -169
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +278 -147
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +108 -14
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +80 -10
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +35 -13
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +34 -12
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +48 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +24 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +23 -2
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +71 -13
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +35 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +34 -12
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +33 -11
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +40 -27
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +34 -26
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +41 -25
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +41 -25
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +85 -24
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +84 -23
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +1 -1
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +0 -560
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +0 -560
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +3 -3
- package/dist/unstable/cli/CliOutput.d.ts +1 -1
- package/dist/unstable/cli/Command.d.ts +136 -8
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +50 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +13 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +41 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +24 -12
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +18 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +39 -8
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +39 -8
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +128 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +59 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +3 -3
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +59 -10
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +37 -7
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +51 -9
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +0 -220
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +0 -220
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +61 -22
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +61 -22
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +58 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +58 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +87 -26
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +87 -26
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +49 -10
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +6 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +6 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +33 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +32 -5
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +19 -0
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +19 -0
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +44 -7
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +44 -7
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +5 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +4 -5
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +19 -0
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +19 -0
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +11 -11
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +11 -11
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +42 -22
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +42 -22
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +33 -14
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +35 -9
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +35 -9
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +11 -11
- package/dist/unstable/cluster/Message.js +11 -11
- package/dist/unstable/cluster/MessageStorage.d.ts +38 -24
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +37 -23
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +18 -8
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +18 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -14
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -14
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +52 -10
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +52 -10
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +33 -16
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +33 -16
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +19 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +19 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +25 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +24 -0
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +24 -2
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +24 -2
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +27 -3
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +63 -20
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +60 -16
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +61 -17
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -14
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -15
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +26 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +26 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +51 -9
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +51 -9
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +27 -13
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +27 -13
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +19 -5
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +19 -5
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +27 -1
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +27 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +38 -0
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +73 -13
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +25 -14
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +25 -14
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +0 -790
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +0 -790
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +41 -11
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +41 -11
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +38 -0
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +68 -11
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +24 -16
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +20 -13
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +20 -13
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +0 -58
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +0 -58
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +30 -14
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +28 -14
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +28 -14
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +38 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +3 -3
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +0 -49
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +0 -49
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +28 -13
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +23 -15
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +22 -14
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +7 -7
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +36 -19
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +63 -25
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +61 -23
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +49 -40
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +28 -28
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +14 -4
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +14 -4
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +7 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +7 -2
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +82 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +119 -22
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +33 -7
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +68 -24
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +21 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +50 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +30 -11
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +0 -240
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +0 -240
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +99 -52
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +77 -30
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +43 -13
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +43 -13
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +59 -17
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +59 -17
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -22
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +58 -20
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +6 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +59 -15
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +66 -30
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +17 -7
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +15 -14
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +39 -22
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +37 -16
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +37 -16
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +35 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +33 -14
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -3
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +46 -20
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +46 -20
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +19 -14
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +54 -26
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +34 -21
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +34 -21
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +41 -28
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -26
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +53 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +20 -5
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +28 -14
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +64 -42
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +48 -26
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +30 -13
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +29 -12
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +32 -19
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +32 -19
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +39 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +39 -19
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +27 -14
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +25 -12
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +41 -28
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +32 -17
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +43 -28
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +40 -25
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +0 -452
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +0 -452
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +50 -26
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +39 -25
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +28 -16
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +51 -23
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +37 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +34 -23
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +4 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +28 -16
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +43 -43
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +42 -42
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +28 -16
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +7 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -27
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +0 -311
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +0 -311
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +31 -16
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +31 -15
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +33 -15
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +27 -16
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +27 -16
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.js +3 -3
- package/dist/unstable/observability/index.d.ts +0 -183
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +0 -183
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +12 -4
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +10 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -3
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +8 -3
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +29 -16
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +27 -14
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +10 -5
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -4
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +20 -10
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +19 -9
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +33 -15
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +0 -147
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +0 -147
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +14 -14
- package/dist/unstable/process/ChildProcess.js +7 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts +17 -5
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +17 -5
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +0 -45
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +0 -45
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +74 -22
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +52 -20
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +81 -35
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +70 -32
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +32 -16
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +52 -25
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +81 -20
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +81 -20
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +37 -17
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +44 -21
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +44 -21
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +0 -166
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +0 -166
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +47 -32
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +15 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +27 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +27 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +31 -17
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +31 -17
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +29 -18
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +37 -19
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +4 -4
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +31 -21
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +31 -21
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +30 -20
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +30 -20
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +50 -33
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +48 -31
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +22 -17
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +22 -17
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +31 -15
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +31 -15
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +29 -14
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +0 -272
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +0 -272
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +32 -33
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +25 -26
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/index.d.ts +0 -37
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +0 -37
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +8 -2
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +8 -2
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +2 -2
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/socket/index.d.ts +0 -44
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +0 -44
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +39 -18
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +7 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +33 -17
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +3 -3
- package/dist/unstable/sql/SqlResolver.js +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +51 -21
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +51 -21
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +34 -14
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +0 -178
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +0 -178
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +32 -21
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +32 -21
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +37 -24
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +35 -22
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +32 -16
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +31 -20
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +31 -20
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +0 -80
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +0 -80
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +25 -13
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +12 -12
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableQueue.d.ts +36 -18
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +36 -18
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +22 -23
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +17 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +26 -8
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +25 -7
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +0 -160
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +0 -160
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1557 -312
- package/src/BigDecimal.ts +646 -52
- package/src/BigInt.ts +474 -18
- package/src/Boolean.ts +239 -19
- package/src/Brand.ts +102 -11
- package/src/Cache.ts +96 -24
- package/src/Cause.ts +488 -200
- package/src/Channel.ts +647 -191
- package/src/ChannelSchema.ts +99 -6
- package/src/Chunk.ts +187 -54
- package/src/Clock.ts +60 -3
- package/src/Combiner.ts +21 -21
- package/src/Config.ts +135 -50
- package/src/ConfigProvider.ts +52 -29
- package/src/Console.ts +32 -7
- package/src/Context.ts +516 -50
- package/src/Cron.ts +116 -6
- package/src/Crypto.ts +30 -1
- package/src/Data.ts +92 -47
- package/src/DateTime.ts +313 -128
- package/src/Deferred.ts +345 -79
- package/src/Differ.ts +5 -0
- package/src/Duration.ts +203 -50
- package/src/Effect.ts +2044 -816
- package/src/Effectable.ts +16 -2
- package/src/Encoding.ts +146 -9
- package/src/Equal.ts +10 -11
- package/src/Equivalence.ts +49 -46
- package/src/ErrorReporter.ts +135 -16
- package/src/ExecutionPlan.ts +96 -26
- package/src/Exit.ts +149 -101
- package/src/Fiber.ts +321 -72
- package/src/FiberHandle.ts +6 -6
- package/src/FiberMap.ts +20 -20
- package/src/FiberSet.ts +21 -13
- package/src/FileSystem.ts +119 -39
- package/src/Filter.ts +221 -2
- package/src/Formatter.ts +4 -6
- package/src/Function.ts +164 -18
- package/src/Graph.ts +297 -25
- package/src/HKT.ts +59 -26
- package/src/Hash.ts +143 -23
- package/src/HashMap.ts +35 -37
- package/src/HashRing.ts +210 -9
- package/src/HashSet.ts +16 -16
- package/src/Inspectable.ts +86 -17
- package/src/Iterable.ts +261 -81
- package/src/JsonPatch.ts +79 -56
- package/src/JsonPointer.ts +5 -5
- package/src/JsonSchema.ts +77 -33
- package/src/Latch.ts +164 -13
- package/src/Layer.ts +297 -101
- package/src/LayerMap.ts +9 -2
- package/src/LogLevel.ts +96 -21
- package/src/Logger.ts +31 -15
- package/src/ManagedRuntime.ts +82 -10
- package/src/Match.ts +250 -59
- package/src/Metric.ts +68 -41
- package/src/MutableHashMap.ts +381 -52
- package/src/MutableHashSet.ts +145 -41
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +141 -4
- package/src/Newtype.ts +20 -11
- package/src/NonEmptyIterable.ts +22 -6
- package/src/Number.ts +434 -17
- package/src/Optic.ts +26 -33
- package/src/Option.ts +186 -150
- package/src/Order.ts +163 -161
- package/src/Ordering.ts +37 -5
- package/src/PartitionedSemaphore.ts +238 -15
- package/src/Path.ts +34 -6
- package/src/Pipeable.ts +29 -4
- package/src/PlatformError.ts +53 -4
- package/src/Pool.ts +174 -32
- package/src/Predicate.ts +151 -196
- package/src/PrimaryKey.ts +75 -9
- package/src/PubSub.ts +241 -66
- package/src/Pull.ts +148 -3
- package/src/Queue.ts +167 -59
- package/src/Random.ts +71 -16
- package/src/RcMap.ts +171 -9
- package/src/RcRef.ts +73 -18
- package/src/Record.ts +174 -53
- package/src/Redactable.ts +27 -23
- package/src/Redacted.ts +82 -4
- package/src/Reducer.ts +17 -7
- package/src/Ref.ts +332 -54
- package/src/References.ts +226 -30
- package/src/RegExp.ts +49 -3
- package/src/Request.ts +218 -35
- package/src/RequestResolver.ts +268 -36
- package/src/Resource.ts +62 -3
- package/src/Result.ts +380 -57
- package/src/Runtime.ts +172 -32
- package/src/Schedule.ts +510 -145
- package/src/Scheduler.ts +53 -4
- package/src/Schema.ts +975 -264
- package/src/SchemaAST.ts +239 -28
- package/src/SchemaGetter.ts +127 -129
- package/src/SchemaIssue.ts +45 -56
- package/src/SchemaParser.ts +295 -33
- package/src/SchemaRepresentation.ts +106 -77
- package/src/SchemaTransformation.ts +92 -56
- package/src/SchemaUtils.ts +38 -11
- package/src/Scope.ts +127 -25
- package/src/ScopedCache.ts +418 -21
- package/src/ScopedRef.ts +69 -7
- package/src/Semaphore.ts +348 -29
- package/src/Sink.ts +343 -45
- package/src/Stdio.ts +72 -17
- package/src/Stream.ts +880 -242
- package/src/String.ts +221 -49
- package/src/Struct.ts +54 -110
- package/src/SubscriptionRef.ts +341 -105
- package/src/Symbol.ts +25 -7
- package/src/SynchronizedRef.ts +529 -29
- package/src/Take.ts +36 -13
- package/src/Terminal.ts +76 -20
- package/src/Tracer.ts +74 -7
- package/src/Trie.ts +67 -30
- package/src/Tuple.ts +96 -108
- package/src/TxChunk.ts +42 -9
- package/src/TxDeferred.ts +85 -2
- package/src/TxHashMap.ts +22 -22
- package/src/TxHashSet.ts +22 -22
- package/src/TxPriorityQueue.ts +43 -8
- package/src/TxPubSub.ts +98 -8
- package/src/TxQueue.ts +58 -17
- package/src/TxReentrantLock.ts +88 -16
- package/src/TxRef.ts +113 -8
- package/src/TxSemaphore.ts +173 -14
- package/src/TxSubscriptionRef.ts +206 -3
- package/src/Types.ts +68 -13
- package/src/UndefinedOr.ts +171 -30
- package/src/Unify.ts +130 -22
- package/src/Utils.ts +21 -16
- package/src/index.ts +0 -5205
- package/src/internal/effect.ts +59 -29
- package/src/internal/request.ts +3 -1
- package/src/internal/schema/arbitrary.ts +14 -1
- package/src/internal/schema/representation.ts +37 -14
- package/src/testing/TestConsole.ts +105 -9
- package/src/testing/TestSchema.ts +81 -31
- package/src/testing/index.ts +0 -107
- package/src/unstable/ai/AiError.ts +33 -5
- package/src/unstable/ai/AnthropicStructuredOutput.ts +43 -11
- package/src/unstable/ai/Chat.ts +82 -33
- package/src/unstable/ai/EmbeddingModel.ts +104 -8
- package/src/unstable/ai/IdGenerator.ts +8 -3
- package/src/unstable/ai/LanguageModel.ts +51 -7
- package/src/unstable/ai/McpSchema.ts +299 -169
- package/src/unstable/ai/McpServer.ts +108 -14
- package/src/unstable/ai/Model.ts +35 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +48 -1
- package/src/unstable/ai/Prompt.ts +24 -3
- package/src/unstable/ai/Response.ts +71 -13
- package/src/unstable/ai/ResponseIdTracker.ts +34 -12
- package/src/unstable/ai/Telemetry.ts +40 -27
- package/src/unstable/ai/Tokenizer.ts +41 -25
- package/src/unstable/ai/Tool.ts +85 -24
- package/src/unstable/ai/Toolkit.ts +32 -4
- package/src/unstable/ai/index.ts +0 -560
- package/src/unstable/cli/Argument.ts +1 -1
- package/src/unstable/cli/CliError.ts +3 -3
- package/src/unstable/cli/CliOutput.ts +1 -1
- package/src/unstable/cli/Command.ts +136 -8
- package/src/unstable/cli/Completions.ts +41 -1
- package/src/unstable/cli/Flag.ts +24 -12
- package/src/unstable/cli/GlobalFlag.ts +39 -8
- package/src/unstable/cli/Param.ts +137 -11
- package/src/unstable/cli/Primitive.ts +59 -10
- package/src/unstable/cli/Prompt.ts +63 -14
- package/src/unstable/cli/index.ts +0 -220
- package/src/unstable/cli/internal/parser.ts +1 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterError.ts +61 -22
- package/src/unstable/cluster/ClusterMetrics.ts +58 -5
- package/src/unstable/cluster/ClusterSchema.ts +87 -26
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +63 -11
- package/src/unstable/cluster/DeliverAt.ts +6 -1
- package/src/unstable/cluster/Entity.ts +33 -6
- package/src/unstable/cluster/EntityAddress.ts +19 -0
- package/src/unstable/cluster/EntityId.ts +44 -7
- package/src/unstable/cluster/EntityResource.ts +5 -6
- package/src/unstable/cluster/EntityType.ts +19 -0
- package/src/unstable/cluster/Envelope.ts +11 -11
- package/src/unstable/cluster/HttpRunner.ts +42 -22
- package/src/unstable/cluster/K8sHttpClient.ts +32 -13
- package/src/unstable/cluster/MachineId.ts +35 -9
- package/src/unstable/cluster/Message.ts +11 -11
- package/src/unstable/cluster/MessageStorage.ts +38 -24
- package/src/unstable/cluster/Reply.ts +18 -8
- package/src/unstable/cluster/Runner.ts +47 -14
- package/src/unstable/cluster/RunnerAddress.ts +52 -10
- package/src/unstable/cluster/RunnerHealth.ts +33 -16
- package/src/unstable/cluster/RunnerServer.ts +19 -4
- package/src/unstable/cluster/Runners.ts +25 -1
- package/src/unstable/cluster/ShardId.ts +24 -2
- package/src/unstable/cluster/Sharding.ts +63 -20
- package/src/unstable/cluster/ShardingConfig.ts +60 -16
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +27 -14
- package/src/unstable/cluster/SingleRunner.ts +26 -1
- package/src/unstable/cluster/Singleton.ts +51 -9
- package/src/unstable/cluster/SingletonAddress.ts +27 -13
- package/src/unstable/cluster/Snowflake.ts +19 -5
- package/src/unstable/cluster/SocketRunner.ts +27 -1
- package/src/unstable/cluster/SqlMessageStorage.ts +73 -13
- package/src/unstable/cluster/SqlRunnerStorage.ts +20 -0
- package/src/unstable/cluster/TestRunner.ts +25 -14
- package/src/unstable/cluster/index.ts +0 -790
- package/src/unstable/devtools/DevTools.ts +41 -11
- package/src/unstable/devtools/DevToolsClient.ts +68 -11
- package/src/unstable/devtools/DevToolsSchema.ts +24 -16
- package/src/unstable/devtools/DevToolsServer.ts +18 -11
- package/src/unstable/devtools/index.ts +0 -58
- package/src/unstable/encoding/Msgpack.ts +30 -14
- package/src/unstable/encoding/Ndjson.ts +28 -14
- package/src/unstable/encoding/Sse.ts +38 -17
- package/src/unstable/encoding/index.ts +0 -49
- package/src/unstable/eventlog/Event.ts +30 -15
- package/src/unstable/eventlog/EventGroup.ts +23 -15
- package/src/unstable/eventlog/EventJournal.ts +38 -21
- package/src/unstable/eventlog/EventLog.ts +63 -25
- package/src/unstable/eventlog/EventLogEncryption.ts +8 -3
- package/src/unstable/eventlog/EventLogMessage.ts +49 -40
- package/src/unstable/eventlog/EventLogRemote.ts +14 -4
- package/src/unstable/eventlog/EventLogServer.ts +36 -17
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +24 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +119 -22
- package/src/unstable/eventlog/EventLogSessionAuth.ts +68 -24
- package/src/unstable/eventlog/SqlEventJournal.ts +50 -14
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +39 -15
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +30 -11
- package/src/unstable/eventlog/index.ts +0 -240
- package/src/unstable/http/Cookies.ts +97 -50
- package/src/unstable/http/Etag.ts +43 -13
- package/src/unstable/http/FetchHttpClient.ts +59 -17
- package/src/unstable/http/Headers.ts +62 -24
- package/src/unstable/http/HttpBody.ts +59 -15
- package/src/unstable/http/HttpClient.ts +119 -33
- package/src/unstable/http/HttpClientError.ts +41 -24
- package/src/unstable/http/HttpClientRequest.ts +37 -16
- package/src/unstable/http/HttpClientResponse.ts +33 -14
- package/src/unstable/http/HttpEffect.ts +35 -18
- package/src/unstable/http/HttpMethod.ts +46 -20
- package/src/unstable/http/HttpRouter.ts +58 -30
- package/src/unstable/http/HttpServer.ts +34 -21
- package/src/unstable/http/HttpServerError.ts +41 -28
- package/src/unstable/http/HttpServerRequest.ts +51 -19
- package/src/unstable/http/HttpServerRespondable.ts +28 -14
- package/src/unstable/http/HttpServerResponse.ts +66 -44
- package/src/unstable/http/HttpStaticServer.ts +29 -12
- package/src/unstable/http/HttpTraceContext.ts +32 -19
- package/src/unstable/http/Multipart.ts +39 -19
- package/src/unstable/http/Template.ts +25 -12
- package/src/unstable/http/Url.ts +41 -28
- package/src/unstable/http/UrlParams.ts +43 -28
- package/src/unstable/http/index.ts +0 -452
- package/src/unstable/httpapi/HttpApi.ts +48 -24
- package/src/unstable/httpapi/HttpApiBuilder.ts +40 -26
- package/src/unstable/httpapi/HttpApiClient.ts +28 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +51 -23
- package/src/unstable/httpapi/HttpApiError.ts +38 -18
- package/src/unstable/httpapi/HttpApiGroup.ts +34 -23
- package/src/unstable/httpapi/HttpApiMiddleware.ts +49 -25
- package/src/unstable/httpapi/HttpApiScalar.ts +32 -17
- package/src/unstable/httpapi/HttpApiSchema.ts +43 -43
- package/src/unstable/httpapi/HttpApiSecurity.ts +54 -24
- package/src/unstable/httpapi/HttpApiSwagger.ts +28 -16
- package/src/unstable/httpapi/HttpApiTest.ts +1 -1
- package/src/unstable/httpapi/OpenApi.ts +43 -25
- package/src/unstable/httpapi/index.ts +0 -311
- package/src/unstable/observability/Otlp.ts +31 -16
- package/src/unstable/observability/OtlpLogger.ts +31 -15
- package/src/unstable/observability/OtlpResource.ts +33 -15
- package/src/unstable/observability/OtlpSerialization.ts +25 -14
- package/src/unstable/observability/PrometheusMetrics.ts +3 -3
- package/src/unstable/observability/index.ts +0 -183
- package/src/unstable/persistence/KeyValueStore.ts +12 -4
- package/src/unstable/persistence/Persistable.ts +8 -3
- package/src/unstable/persistence/PersistedCache.ts +27 -14
- package/src/unstable/persistence/PersistedQueue.ts +10 -5
- package/src/unstable/persistence/RateLimiter.ts +20 -10
- package/src/unstable/persistence/Redis.ts +33 -15
- package/src/unstable/persistence/index.ts +0 -147
- package/src/unstable/process/ChildProcess.ts +14 -14
- package/src/unstable/process/ChildProcessSpawner.ts +17 -5
- package/src/unstable/process/index.ts +0 -45
- package/src/unstable/reactivity/AsyncResult.ts +96 -24
- package/src/unstable/reactivity/Atom.ts +89 -35
- package/src/unstable/reactivity/AtomRef.ts +58 -25
- package/src/unstable/reactivity/AtomRegistry.ts +79 -18
- package/src/unstable/reactivity/Hydration.ts +37 -17
- package/src/unstable/reactivity/Reactivity.ts +42 -19
- package/src/unstable/reactivity/index.ts +0 -166
- package/src/unstable/rpc/Rpc.ts +47 -32
- package/src/unstable/rpc/RpcClient.ts +58 -34
- package/src/unstable/rpc/RpcClientError.ts +29 -15
- package/src/unstable/rpc/RpcGroup.ts +28 -17
- package/src/unstable/rpc/RpcMessage.ts +37 -19
- package/src/unstable/rpc/RpcMiddleware.ts +31 -21
- package/src/unstable/rpc/RpcSchema.ts +30 -20
- package/src/unstable/rpc/RpcSerialization.ts +48 -31
- package/src/unstable/rpc/RpcServer.ts +53 -40
- package/src/unstable/rpc/RpcTest.ts +29 -13
- package/src/unstable/rpc/RpcWorker.ts +29 -14
- package/src/unstable/rpc/index.ts +0 -272
- package/src/unstable/schema/Model.ts +32 -33
- package/src/unstable/schema/VariantSchema.ts +1 -1
- package/src/unstable/schema/index.ts +0 -37
- package/src/unstable/socket/Socket.ts +8 -2
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/socket/index.ts +0 -44
- package/src/unstable/sql/Migrator.ts +39 -18
- package/src/unstable/sql/SqlClient.ts +7 -2
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/SqlError.ts +33 -17
- package/src/unstable/sql/SqlResolver.ts +3 -3
- package/src/unstable/sql/SqlSchema.ts +51 -21
- package/src/unstable/sql/Statement.ts +35 -15
- package/src/unstable/sql/index.ts +0 -178
- package/src/unstable/workers/Transferable.ts +32 -21
- package/src/unstable/workers/Worker.ts +35 -22
- package/src/unstable/workers/WorkerError.ts +35 -19
- package/src/unstable/workers/WorkerRunner.ts +29 -18
- package/src/unstable/workers/index.ts +0 -80
- package/src/unstable/workflow/DurableClock.ts +25 -13
- package/src/unstable/workflow/DurableDeferred.ts +12 -12
- package/src/unstable/workflow/DurableQueue.ts +34 -16
- package/src/unstable/workflow/Workflow.ts +22 -23
- package/src/unstable/workflow/WorkflowEngine.ts +26 -8
- package/src/unstable/workflow/index.ts +0 -160
package/dist/Array.js
CHANGED
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* {@link
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* -
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* -
|
|
37
|
-
*
|
|
38
|
-
* -
|
|
39
|
-
*
|
|
40
|
-
* -
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* - {@link
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* const
|
|
76
|
-
* console.log(
|
|
2
|
+
* The `Array` module provides functional operations for JavaScript arrays,
|
|
3
|
+
* readonly arrays, and arrays that are known to contain at least one element.
|
|
4
|
+
* Operations that transform, reorder, or update collections allocate new arrays
|
|
5
|
+
* instead of mutating their inputs, while preserving useful type information
|
|
6
|
+
* such as non-emptiness when the operation can prove it.
|
|
7
|
+
*
|
|
8
|
+
* **Mental model**
|
|
9
|
+
*
|
|
10
|
+
* - A regular `Array<A>` is still the built-in JavaScript array type; this
|
|
11
|
+
* module supplies functional constructors, combinators, searches, folds,
|
|
12
|
+
* grouping, sorting, and set-like operations around it.
|
|
13
|
+
* - {@link NonEmptyReadonlyArray} and {@link NonEmptyArray} encode
|
|
14
|
+
* non-emptiness at the type level. APIs with `NonEmpty` in the name can avoid
|
|
15
|
+
* `Option` because an element is guaranteed to exist.
|
|
16
|
+
* - Most functions are dual. You can call them data-first, such as
|
|
17
|
+
* `Array.map(values, f)`, or data-last in a pipeline, such as
|
|
18
|
+
* `pipe(values, Array.map(f))`.
|
|
19
|
+
* - Safe element access returns {@link Option}; unsafe or `NonEmpty` variants
|
|
20
|
+
* are for code that already has a proof an index or element exists.
|
|
21
|
+
* - Set-like operations such as {@link union}, {@link intersection}, and
|
|
22
|
+
* {@link difference} use the {@link Equal} protocol by default. Use the
|
|
23
|
+
* `*With` variants when equality is domain-specific.
|
|
24
|
+
*
|
|
25
|
+
* **Common tasks**
|
|
26
|
+
*
|
|
27
|
+
* - Create arrays with {@link make}, {@link of}, {@link empty},
|
|
28
|
+
* {@link fromIterable}, {@link range}, {@link makeBy}, {@link replicate}, and
|
|
29
|
+
* {@link unfold}.
|
|
30
|
+
* - Access edges or indexes with {@link head}, {@link last}, {@link get},
|
|
31
|
+
* {@link tail}, and {@link init}.
|
|
32
|
+
* - Transform and flatten with {@link map}, {@link flatMap}, and
|
|
33
|
+
* {@link flatten}.
|
|
34
|
+
* - Keep, split, or deduplicate values with {@link filter}, {@link partition},
|
|
35
|
+
* {@link dedupe}, and {@link dedupeAdjacent}.
|
|
36
|
+
* - Combine collections with {@link append}, {@link prepend}, {@link appendAll},
|
|
37
|
+
* {@link prependAll}, {@link zip}, and {@link cartesian}.
|
|
38
|
+
* - Chunk, window, and slice with {@link splitAt}, {@link chunksOf},
|
|
39
|
+
* {@link span}, and {@link window}.
|
|
40
|
+
* - Sort with {@link sort}, {@link sortWith}, and {@link sortBy}.
|
|
41
|
+
* - Fold or aggregate with {@link reduce}, {@link scan}, {@link join}, and
|
|
42
|
+
* {@link countBy}.
|
|
43
|
+
* - Match empty and non-empty cases with {@link match}, {@link matchLeft}, and
|
|
44
|
+
* {@link matchRight}.
|
|
45
|
+
*
|
|
46
|
+
* **Gotchas**
|
|
47
|
+
*
|
|
48
|
+
* - {@link fromIterable} returns the original array reference when the input is
|
|
49
|
+
* already an array. Use {@link copy} when you need a fresh shallow copy.
|
|
50
|
+
* - {@link makeBy}, {@link range}, and {@link replicate} always return
|
|
51
|
+
* non-empty arrays. `range(start, end)` is inclusive and returns `[start]`
|
|
52
|
+
* when `start > end`.
|
|
53
|
+
* - Functions returning {@link Option}, such as {@link head} and
|
|
54
|
+
* {@link findFirst}, return `Option.none()` for empty inputs instead of
|
|
55
|
+
* throwing.
|
|
56
|
+
* - `NonEmpty` return types describe what the function can prove, not what may
|
|
57
|
+
* happen for a particular runtime value after filtering.
|
|
58
|
+
*
|
|
59
|
+
* **Example** (Filtering and transforming)
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* import { Array, Option, pipe } from "effect"
|
|
63
|
+
*
|
|
64
|
+
* const numbers = [1, 2, 3, 4, 5]
|
|
65
|
+
*
|
|
66
|
+
* const doubledEvens = pipe(
|
|
67
|
+
* numbers,
|
|
68
|
+
* Array.filter((n) => n % 2 === 0),
|
|
69
|
+
* Array.map((n) => n * 2)
|
|
70
|
+
* )
|
|
71
|
+
*
|
|
72
|
+
* console.log(doubledEvens)
|
|
73
|
+
* // [4, 8]
|
|
74
|
+
*
|
|
75
|
+
* const first = Array.head(doubledEvens)
|
|
76
|
+
* console.log(Option.getOrElse(first, () => 0))
|
|
77
|
+
* // 4
|
|
77
78
|
* ```
|
|
78
79
|
*
|
|
79
80
|
* @see {@link make} — create a non-empty array from elements
|
|
@@ -96,12 +97,12 @@ import * as Reducer from "./Reducer.js";
|
|
|
96
97
|
import * as Result from "./Result.js";
|
|
97
98
|
import * as Tuple from "./Tuple.js";
|
|
98
99
|
/**
|
|
99
|
-
*
|
|
100
|
+
* Exposes the global array constructor.
|
|
100
101
|
*
|
|
101
102
|
* **When to use**
|
|
102
103
|
*
|
|
103
|
-
* Use
|
|
104
|
-
*
|
|
104
|
+
* Use to access native JavaScript array constructor methods such as `isArray`
|
|
105
|
+
* or `from` from the Effect module namespace.
|
|
105
106
|
*
|
|
106
107
|
* **Example** (Using the Array constructor)
|
|
107
108
|
*
|
|
@@ -121,7 +122,7 @@ export const Array = globalThis.Array;
|
|
|
121
122
|
*
|
|
122
123
|
* **When to use**
|
|
123
124
|
*
|
|
124
|
-
*
|
|
125
|
+
* Use when you have literal values and want a typed non-empty array.
|
|
125
126
|
* - The element type is inferred as the union of all arguments.
|
|
126
127
|
* - Always returns a `NonEmptyArray` since at least one argument is required.
|
|
127
128
|
*
|
|
@@ -146,7 +147,7 @@ export const make = (...elements) => elements;
|
|
|
146
147
|
*
|
|
147
148
|
* **When to use**
|
|
148
149
|
*
|
|
149
|
-
*
|
|
150
|
+
* Use when you need a pre-sized array and will fill it imperatively.
|
|
150
151
|
* - Elements are typed as `A | undefined` since slots are empty.
|
|
151
152
|
* - Prefer {@link makeBy} when you can compute each element from its index.
|
|
152
153
|
*
|
|
@@ -170,7 +171,7 @@ export const allocate = n => new Array(n);
|
|
|
170
171
|
*
|
|
171
172
|
* **When to use**
|
|
172
173
|
*
|
|
173
|
-
*
|
|
174
|
+
* Use when you need an array whose values depend on the index.
|
|
174
175
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
175
176
|
* - Dual: `Array.makeBy(5, f)` or `pipe(5, Array.makeBy(f))`.
|
|
176
177
|
*
|
|
@@ -203,7 +204,7 @@ export const makeBy = /*#__PURE__*/dual(2, (n, f) => {
|
|
|
203
204
|
*
|
|
204
205
|
* **When to use**
|
|
205
206
|
*
|
|
206
|
-
*
|
|
207
|
+
* Use when you need a sequence of consecutive integers.
|
|
207
208
|
* - If `start > end`, returns `[start]`.
|
|
208
209
|
* - Always returns a `NonEmptyArray`.
|
|
209
210
|
*
|
|
@@ -227,7 +228,7 @@ export const range = (start, end) => start <= end ? makeBy(end - start + 1, i =>
|
|
|
227
228
|
*
|
|
228
229
|
* **When to use**
|
|
229
230
|
*
|
|
230
|
-
*
|
|
231
|
+
* Use when you need multiple copies of the same value.
|
|
231
232
|
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
232
233
|
* - Dual: `Array.replicate("a", 3)` or `pipe("a", Array.replicate(3))`.
|
|
233
234
|
*
|
|
@@ -249,6 +250,10 @@ export const replicate = /*#__PURE__*/dual(2, (a, n) => makeBy(n, () => a));
|
|
|
249
250
|
/**
|
|
250
251
|
* Converts an `Iterable` to an `Array`.
|
|
251
252
|
*
|
|
253
|
+
* **When to use**
|
|
254
|
+
*
|
|
255
|
+
* Use to convert any `Iterable` (Set, Generator, etc.) into an array.
|
|
256
|
+
*
|
|
252
257
|
* **Details**
|
|
253
258
|
*
|
|
254
259
|
* - If the input is already an array, returns it **by reference** (no copy).
|
|
@@ -275,6 +280,11 @@ export const fromIterable = collection => Array.isArray(collection) ? collection
|
|
|
275
280
|
/**
|
|
276
281
|
* Normalizes a value that is either a single element or an array into an array.
|
|
277
282
|
*
|
|
283
|
+
* **When to use**
|
|
284
|
+
*
|
|
285
|
+
* Use to normalize input that may be a single value or an array into a consistent
|
|
286
|
+
* array.
|
|
287
|
+
*
|
|
278
288
|
* **Details**
|
|
279
289
|
*
|
|
280
290
|
* - If the input is already an array, returns it by reference.
|
|
@@ -300,6 +310,11 @@ export const ensure = self => Array.isArray(self) ? self : [self];
|
|
|
300
310
|
/**
|
|
301
311
|
* Converts a record into an array of `[key, value]` tuples.
|
|
302
312
|
*
|
|
313
|
+
* **When to use**
|
|
314
|
+
*
|
|
315
|
+
* Use to convert a record into an array of key-value tuples for iteration or
|
|
316
|
+
* transformation.
|
|
317
|
+
*
|
|
303
318
|
* **Details**
|
|
304
319
|
*
|
|
305
320
|
* - Key order follows `Object.entries` semantics.
|
|
@@ -314,6 +329,9 @@ export const ensure = self => Array.isArray(self) ? self : [self];
|
|
|
314
329
|
* console.log(result) // [["a", 1], ["b", 2], ["c", 3]]
|
|
315
330
|
* ```
|
|
316
331
|
*
|
|
332
|
+
* @see {@link Record.toEntries} the equivalent function from the Record module
|
|
333
|
+
* @see {@link Record.fromEntries} to build a record from an array of tuples
|
|
334
|
+
*
|
|
317
335
|
* @category converting
|
|
318
336
|
* @since 2.0.0
|
|
319
337
|
*/
|
|
@@ -321,6 +339,10 @@ export const fromRecord = Record.toEntries;
|
|
|
321
339
|
/**
|
|
322
340
|
* Converts an `Option` to an array: `Some(a)` becomes `[a]`, `None` becomes `[]`.
|
|
323
341
|
*
|
|
342
|
+
* **When to use**
|
|
343
|
+
*
|
|
344
|
+
* Use to convert a single `Option` into an array for downstream array operations.
|
|
345
|
+
*
|
|
324
346
|
* **Example** (Option to array)
|
|
325
347
|
*
|
|
326
348
|
* ```ts
|
|
@@ -341,7 +363,7 @@ export const fromOption = Option.toArray;
|
|
|
341
363
|
*
|
|
342
364
|
* **When to use**
|
|
343
365
|
*
|
|
344
|
-
*
|
|
366
|
+
* Use when you need to branch on whether an array has elements.
|
|
345
367
|
* - `onNonEmpty` receives a `NonEmptyReadonlyArray`.
|
|
346
368
|
* - Dual: data-first or data-last.
|
|
347
369
|
*
|
|
@@ -372,10 +394,14 @@ export const match = /*#__PURE__*/dual(2, (self, {
|
|
|
372
394
|
* Pattern-matches on an array from the left, providing the first element and
|
|
373
395
|
* the remaining elements separately.
|
|
374
396
|
*
|
|
397
|
+
* **When to use**
|
|
398
|
+
*
|
|
399
|
+
* Use to pattern-match when you need the first element and remaining elements as
|
|
400
|
+
* separate values.
|
|
401
|
+
*
|
|
375
402
|
* **Details**
|
|
376
403
|
*
|
|
377
|
-
*
|
|
378
|
-
* - Use when you want to process the first element differently from the rest.
|
|
404
|
+
* `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
|
|
379
405
|
*
|
|
380
406
|
* **Example** (Head and tail destructuring)
|
|
381
407
|
*
|
|
@@ -404,10 +430,14 @@ export const matchLeft = /*#__PURE__*/dual(2, (self, {
|
|
|
404
430
|
* Pattern-matches on an array from the right, providing all elements except the
|
|
405
431
|
* last and the last element separately.
|
|
406
432
|
*
|
|
433
|
+
* **When to use**
|
|
434
|
+
*
|
|
435
|
+
* Use to pattern-match when you need all but the last element and the last element
|
|
436
|
+
* as separate values.
|
|
437
|
+
*
|
|
407
438
|
* **Details**
|
|
408
439
|
*
|
|
409
|
-
*
|
|
410
|
-
* - Use when you want to process the last element differently from the rest.
|
|
440
|
+
* `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
|
|
411
441
|
*
|
|
412
442
|
* **Example** (Init and last destructuring)
|
|
413
443
|
*
|
|
@@ -435,10 +465,13 @@ export const matchRight = /*#__PURE__*/dual(2, (self, {
|
|
|
435
465
|
/**
|
|
436
466
|
* Adds a single element to the front of an iterable, returning a `NonEmptyArray`.
|
|
437
467
|
*
|
|
468
|
+
* **When to use**
|
|
469
|
+
*
|
|
470
|
+
* Use to add a single element at the start of an iterable and get a `NonEmptyArray`.
|
|
471
|
+
*
|
|
438
472
|
* **Details**
|
|
439
473
|
*
|
|
440
474
|
* - Always returns a non-empty array.
|
|
441
|
-
* - Does not mutate the input.
|
|
442
475
|
*
|
|
443
476
|
* **Example** (Prepending an element)
|
|
444
477
|
*
|
|
@@ -459,10 +492,13 @@ export const prepend = /*#__PURE__*/dual(2, (self, head) => [head, ...self]);
|
|
|
459
492
|
/**
|
|
460
493
|
* Prepends all elements from a prefix iterable to the front of an array.
|
|
461
494
|
*
|
|
495
|
+
* **When to use**
|
|
496
|
+
*
|
|
497
|
+
* Use to prepend multiple elements from an iterable to the front of an array.
|
|
498
|
+
*
|
|
462
499
|
* **Details**
|
|
463
500
|
*
|
|
464
501
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
465
|
-
* - Does not mutate the input.
|
|
466
502
|
*
|
|
467
503
|
* **Example** (Prepending multiple elements)
|
|
468
504
|
*
|
|
@@ -483,10 +519,14 @@ export const prependAll = /*#__PURE__*/dual(2, (self, that) => fromIterable(that
|
|
|
483
519
|
/**
|
|
484
520
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
485
521
|
*
|
|
522
|
+
* **When to use**
|
|
523
|
+
*
|
|
524
|
+
* Use to add one element to the end of an iterable and get a new
|
|
525
|
+
* `NonEmptyArray`.
|
|
526
|
+
*
|
|
486
527
|
* **Details**
|
|
487
528
|
*
|
|
488
529
|
* - Always returns a non-empty array.
|
|
489
|
-
* - Does not mutate the input.
|
|
490
530
|
*
|
|
491
531
|
* **Example** (Appending an element)
|
|
492
532
|
*
|
|
@@ -507,10 +547,14 @@ export const append = /*#__PURE__*/dual(2, (self, last) => [...self, last]);
|
|
|
507
547
|
/**
|
|
508
548
|
* Concatenates two iterables into a single array.
|
|
509
549
|
*
|
|
550
|
+
* **When to use**
|
|
551
|
+
*
|
|
552
|
+
* Use to combine two iterable inputs into a new array with the second input's
|
|
553
|
+
* elements after the first.
|
|
554
|
+
*
|
|
510
555
|
* **Details**
|
|
511
556
|
*
|
|
512
557
|
* - If either input is non-empty, the result is a `NonEmptyArray`.
|
|
513
|
-
* - Does not mutate the inputs.
|
|
514
558
|
*
|
|
515
559
|
* **Example** (Concatenating arrays)
|
|
516
560
|
*
|
|
@@ -529,7 +573,11 @@ export const append = /*#__PURE__*/dual(2, (self, last) => [...self, last]);
|
|
|
529
573
|
*/
|
|
530
574
|
export const appendAll = /*#__PURE__*/dual(2, (self, that) => fromIterable(self).concat(fromIterable(that)));
|
|
531
575
|
/**
|
|
532
|
-
*
|
|
576
|
+
* Folds left-to-right while keeping every intermediate accumulator value.
|
|
577
|
+
*
|
|
578
|
+
* **When to use**
|
|
579
|
+
*
|
|
580
|
+
* Use to compute a running accumulator where each intermediate value is needed.
|
|
533
581
|
*
|
|
534
582
|
* **Details**
|
|
535
583
|
*
|
|
@@ -562,7 +610,12 @@ export const scan = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
|
562
610
|
return out;
|
|
563
611
|
});
|
|
564
612
|
/**
|
|
565
|
-
*
|
|
613
|
+
* Folds right-to-left while keeping every intermediate accumulator value.
|
|
614
|
+
*
|
|
615
|
+
* **When to use**
|
|
616
|
+
*
|
|
617
|
+
* Use to compute a running accumulator from right to left where each intermediate
|
|
618
|
+
* value is needed.
|
|
566
619
|
*
|
|
567
620
|
* **Details**
|
|
568
621
|
*
|
|
@@ -594,7 +647,11 @@ export const scanRight = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
|
594
647
|
return out;
|
|
595
648
|
});
|
|
596
649
|
/**
|
|
597
|
-
*
|
|
650
|
+
* Checks whether a value is an `Array`.
|
|
651
|
+
*
|
|
652
|
+
* **When to use**
|
|
653
|
+
*
|
|
654
|
+
* Use to verify a value is a mutable array, narrowing its type to `Array<unknown>`.
|
|
598
655
|
*
|
|
599
656
|
* **Details**
|
|
600
657
|
*
|
|
@@ -618,7 +675,7 @@ export const scanRight = /*#__PURE__*/dual(3, (self, b, f) => {
|
|
|
618
675
|
*/
|
|
619
676
|
export const isArray = Array.isArray;
|
|
620
677
|
/**
|
|
621
|
-
*
|
|
678
|
+
* Checks whether a mutable `Array` is empty, narrowing the type to `[]`.
|
|
622
679
|
*
|
|
623
680
|
* **Example** (Checking for an empty array)
|
|
624
681
|
*
|
|
@@ -637,7 +694,7 @@ export const isArray = Array.isArray;
|
|
|
637
694
|
*/
|
|
638
695
|
export const isArrayEmpty = self => self.length === 0;
|
|
639
696
|
/**
|
|
640
|
-
*
|
|
697
|
+
* Checks whether a `ReadonlyArray` is empty, narrowing the type to `readonly []`.
|
|
641
698
|
*
|
|
642
699
|
* **Example** (Checking for an empty readonly array)
|
|
643
700
|
*
|
|
@@ -656,7 +713,7 @@ export const isArrayEmpty = self => self.length === 0;
|
|
|
656
713
|
*/
|
|
657
714
|
export const isReadonlyArrayEmpty = isArrayEmpty;
|
|
658
715
|
/**
|
|
659
|
-
*
|
|
716
|
+
* Checks whether a mutable `Array` is non-empty, narrowing the type to
|
|
660
717
|
* `NonEmptyArray`.
|
|
661
718
|
*
|
|
662
719
|
* **Example** (Checking for a non-empty array)
|
|
@@ -676,7 +733,7 @@ export const isReadonlyArrayEmpty = isArrayEmpty;
|
|
|
676
733
|
*/
|
|
677
734
|
export const isArrayNonEmpty = internalArray.isArrayNonEmpty;
|
|
678
735
|
/**
|
|
679
|
-
*
|
|
736
|
+
* Checks whether a `ReadonlyArray` is non-empty, narrowing the type to
|
|
680
737
|
* `NonEmptyReadonlyArray`.
|
|
681
738
|
*
|
|
682
739
|
* **Example** (Checking for a non-empty readonly array)
|
|
@@ -698,6 +755,10 @@ export const isReadonlyArrayNonEmpty = internalArray.isArrayNonEmpty;
|
|
|
698
755
|
/**
|
|
699
756
|
* Returns the number of elements in a `ReadonlyArray`.
|
|
700
757
|
*
|
|
758
|
+
* **When to use**
|
|
759
|
+
*
|
|
760
|
+
* Use when you need length as a composable function rather than a property access.
|
|
761
|
+
*
|
|
701
762
|
* **Example** (Getting the length)
|
|
702
763
|
*
|
|
703
764
|
* ```ts
|
|
@@ -716,9 +777,14 @@ export function isOutOfBounds(i, as) {
|
|
|
716
777
|
}
|
|
717
778
|
const clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));
|
|
718
779
|
/**
|
|
719
|
-
*
|
|
780
|
+
* Reads an element at the given index safely, returning `Option.some` or
|
|
720
781
|
* `Option.none` if the index is out of bounds.
|
|
721
782
|
*
|
|
783
|
+
* **When to use**
|
|
784
|
+
*
|
|
785
|
+
* Use when you need to read an array element by index and handle an
|
|
786
|
+
* out-of-bounds index as `Option.none`.
|
|
787
|
+
*
|
|
722
788
|
* **Details**
|
|
723
789
|
*
|
|
724
790
|
* - The index is floored to an integer.
|
|
@@ -733,9 +799,9 @@ const clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));
|
|
|
733
799
|
* console.log(Array.get([1, 2, 3], 10)) // None
|
|
734
800
|
* ```
|
|
735
801
|
*
|
|
736
|
-
* @see {@link getUnsafe}
|
|
737
|
-
* @see {@link head}
|
|
738
|
-
* @see {@link last}
|
|
802
|
+
* @see {@link getUnsafe} for indexed access that throws when the index is out of bounds
|
|
803
|
+
* @see {@link head} for reading the first element as an `Option`
|
|
804
|
+
* @see {@link last} for reading the last element as an `Option`
|
|
739
805
|
*
|
|
740
806
|
* @category getters
|
|
741
807
|
* @since 2.0.0
|
|
@@ -747,6 +813,11 @@ export const get = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
747
813
|
/**
|
|
748
814
|
* Reads an element at the given index, throwing if the index is out of bounds.
|
|
749
815
|
*
|
|
816
|
+
* **When to use**
|
|
817
|
+
*
|
|
818
|
+
* Use to read an element at a known valid index when out-of-bounds would be a
|
|
819
|
+
* programming error.
|
|
820
|
+
*
|
|
750
821
|
* **Details**
|
|
751
822
|
*
|
|
752
823
|
* - Throws an `Error` with the message `"Index out of bounds: <i>"`.
|
|
@@ -776,6 +847,11 @@ export const getUnsafe = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
776
847
|
/**
|
|
777
848
|
* Splits a non-empty array into its first element and the remaining elements.
|
|
778
849
|
*
|
|
850
|
+
* **When to use**
|
|
851
|
+
*
|
|
852
|
+
* Use when you have a `NonEmptyReadonlyArray` and need both its first element
|
|
853
|
+
* and the remaining elements as separate values.
|
|
854
|
+
*
|
|
779
855
|
* **Details**
|
|
780
856
|
*
|
|
781
857
|
* - Returns a tuple `[head, tail]`.
|
|
@@ -790,9 +866,9 @@ export const getUnsafe = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
790
866
|
* console.log(result) // [1, [2, 3, 4]]
|
|
791
867
|
* ```
|
|
792
868
|
*
|
|
793
|
-
* @see {@link unappend}
|
|
794
|
-
* @see {@link headNonEmpty}
|
|
795
|
-
* @see {@link tailNonEmpty}
|
|
869
|
+
* @see {@link unappend} for splitting a non-empty array into init and last
|
|
870
|
+
* @see {@link headNonEmpty} for getting only the first element
|
|
871
|
+
* @see {@link tailNonEmpty} for getting only the elements after the first
|
|
796
872
|
*
|
|
797
873
|
* @category splitting
|
|
798
874
|
* @since 2.0.0
|
|
@@ -802,6 +878,11 @@ export const unprepend = self => [headNonEmpty(self), tailNonEmpty(self)];
|
|
|
802
878
|
* Splits a non-empty array into all elements except the last, and the last
|
|
803
879
|
* element.
|
|
804
880
|
*
|
|
881
|
+
* **When to use**
|
|
882
|
+
*
|
|
883
|
+
* Use to split a non-empty array from the end when you need both the elements
|
|
884
|
+
* before the last element and the last element.
|
|
885
|
+
*
|
|
805
886
|
* **Details**
|
|
806
887
|
*
|
|
807
888
|
* - Returns a tuple `[init, last]`.
|
|
@@ -816,18 +897,22 @@ export const unprepend = self => [headNonEmpty(self), tailNonEmpty(self)];
|
|
|
816
897
|
* console.log(result) // [[1, 2, 3], 4]
|
|
817
898
|
* ```
|
|
818
899
|
*
|
|
819
|
-
* @see {@link unprepend}
|
|
820
|
-
* @see {@link initNonEmpty}
|
|
821
|
-
* @see {@link lastNonEmpty}
|
|
900
|
+
* @see {@link unprepend} for splitting a non-empty array into head and tail
|
|
901
|
+
* @see {@link initNonEmpty} for getting only the elements before the last
|
|
902
|
+
* @see {@link lastNonEmpty} for getting only the last element
|
|
822
903
|
*
|
|
823
904
|
* @category splitting
|
|
824
905
|
* @since 2.0.0
|
|
825
906
|
*/
|
|
826
907
|
export const unappend = self => [initNonEmpty(self), lastNonEmpty(self)];
|
|
827
908
|
/**
|
|
828
|
-
* Returns the first element of an array wrapped in `Option.some`, or
|
|
909
|
+
* Returns the first element of an array safely wrapped in `Option.some`, or
|
|
829
910
|
* `Option.none` if the array is empty.
|
|
830
911
|
*
|
|
912
|
+
* **When to use**
|
|
913
|
+
*
|
|
914
|
+
* Use to safely get the first element of an array that may be empty.
|
|
915
|
+
*
|
|
831
916
|
* **Example** (Getting the first element)
|
|
832
917
|
*
|
|
833
918
|
* ```ts
|
|
@@ -848,6 +933,11 @@ export const head = /*#__PURE__*/get(0);
|
|
|
848
933
|
* Returns the first element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
849
934
|
* wrapper).
|
|
850
935
|
*
|
|
936
|
+
* **When to use**
|
|
937
|
+
*
|
|
938
|
+
* Use to get the first element without `Option` wrapping when the array is known
|
|
939
|
+
* to be non-empty.
|
|
940
|
+
*
|
|
851
941
|
* **Example** (Getting the head of a non-empty array)
|
|
852
942
|
*
|
|
853
943
|
* ```ts
|
|
@@ -863,9 +953,13 @@ export const head = /*#__PURE__*/get(0);
|
|
|
863
953
|
*/
|
|
864
954
|
export const headNonEmpty = /*#__PURE__*/getUnsafe(0);
|
|
865
955
|
/**
|
|
866
|
-
* Returns the last element of an array wrapped in `Option.some`, or
|
|
956
|
+
* Returns the last element of an array safely wrapped in `Option.some`, or
|
|
867
957
|
* `Option.none` if the array is empty.
|
|
868
958
|
*
|
|
959
|
+
* **When to use**
|
|
960
|
+
*
|
|
961
|
+
* Use to safely get the last element of an array that may be empty.
|
|
962
|
+
*
|
|
869
963
|
* **Example** (Getting the last element)
|
|
870
964
|
*
|
|
871
965
|
* ```ts
|
|
@@ -886,6 +980,11 @@ export const last = self => isReadonlyArrayNonEmpty(self) ? Option.some(lastNonE
|
|
|
886
980
|
* Returns the last element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
887
981
|
* wrapper).
|
|
888
982
|
*
|
|
983
|
+
* **When to use**
|
|
984
|
+
*
|
|
985
|
+
* Use to get the last element without `Option` wrapping when the array is known
|
|
986
|
+
* to be non-empty.
|
|
987
|
+
*
|
|
889
988
|
* **Example** (Getting the last of a non-empty array)
|
|
890
989
|
*
|
|
891
990
|
* ```ts
|
|
@@ -901,7 +1000,11 @@ export const last = self => isReadonlyArrayNonEmpty(self) ? Option.some(lastNonE
|
|
|
901
1000
|
*/
|
|
902
1001
|
export const lastNonEmpty = self => self[self.length - 1];
|
|
903
1002
|
/**
|
|
904
|
-
* Returns all elements except the first, wrapped in an `Option`.
|
|
1003
|
+
* Returns all elements except the first safely, wrapped in an `Option`.
|
|
1004
|
+
*
|
|
1005
|
+
* **When to use**
|
|
1006
|
+
*
|
|
1007
|
+
* Use to safely get all elements after the first when the iterable may be empty.
|
|
905
1008
|
*
|
|
906
1009
|
* **Details**
|
|
907
1010
|
*
|
|
@@ -930,6 +1033,10 @@ export function tail(self) {
|
|
|
930
1033
|
/**
|
|
931
1034
|
* Returns all elements except the first of a `NonEmptyReadonlyArray`.
|
|
932
1035
|
*
|
|
1036
|
+
* **When to use**
|
|
1037
|
+
*
|
|
1038
|
+
* Use to get all elements after the first when the array is known to be non-empty.
|
|
1039
|
+
*
|
|
933
1040
|
* **Example** (Getting the tail of a non-empty array)
|
|
934
1041
|
*
|
|
935
1042
|
* ```ts
|
|
@@ -946,7 +1053,11 @@ export function tail(self) {
|
|
|
946
1053
|
*/
|
|
947
1054
|
export const tailNonEmpty = self => self.slice(1);
|
|
948
1055
|
/**
|
|
949
|
-
* Returns all elements except the last, wrapped in an `Option`.
|
|
1056
|
+
* Returns all elements except the last safely, wrapped in an `Option`.
|
|
1057
|
+
*
|
|
1058
|
+
* **When to use**
|
|
1059
|
+
*
|
|
1060
|
+
* Use to safely get all elements before the last when the iterable may be empty.
|
|
950
1061
|
*
|
|
951
1062
|
* **Details**
|
|
952
1063
|
*
|
|
@@ -975,6 +1086,10 @@ export function init(self) {
|
|
|
975
1086
|
/**
|
|
976
1087
|
* Returns all elements except the last of a `NonEmptyReadonlyArray`.
|
|
977
1088
|
*
|
|
1089
|
+
* **When to use**
|
|
1090
|
+
*
|
|
1091
|
+
* Use to get all elements before the last when the array is known to be non-empty.
|
|
1092
|
+
*
|
|
978
1093
|
* **Example** (Getting init of a non-empty array)
|
|
979
1094
|
*
|
|
980
1095
|
* ```ts
|
|
@@ -993,6 +1108,10 @@ export const initNonEmpty = self => self.slice(0, -1);
|
|
|
993
1108
|
/**
|
|
994
1109
|
* Keeps the first `n` elements, creating a new array.
|
|
995
1110
|
*
|
|
1111
|
+
* **When to use**
|
|
1112
|
+
*
|
|
1113
|
+
* Use to keep up to the first `n` elements from an iterable as a new array.
|
|
1114
|
+
*
|
|
996
1115
|
* **Details**
|
|
997
1116
|
*
|
|
998
1117
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1006,9 +1125,9 @@ export const initNonEmpty = self => self.slice(0, -1);
|
|
|
1006
1125
|
* console.log(Array.take([1, 2, 3, 4, 5], 3)) // [1, 2, 3]
|
|
1007
1126
|
* ```
|
|
1008
1127
|
*
|
|
1009
|
-
* @see {@link takeRight}
|
|
1010
|
-
* @see {@link takeWhile}
|
|
1011
|
-
* @see {@link drop}
|
|
1128
|
+
* @see {@link takeRight} for keeping elements from the end
|
|
1129
|
+
* @see {@link takeWhile} for keeping an initial prefix while a predicate holds
|
|
1130
|
+
* @see {@link drop} for removing elements from the start
|
|
1012
1131
|
*
|
|
1013
1132
|
* @category getters
|
|
1014
1133
|
* @since 2.0.0
|
|
@@ -1020,6 +1139,10 @@ export const take = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1020
1139
|
/**
|
|
1021
1140
|
* Keeps the last `n` elements, creating a new array.
|
|
1022
1141
|
*
|
|
1142
|
+
* **When to use**
|
|
1143
|
+
*
|
|
1144
|
+
* Use to keep the last `n` elements of an iterable.
|
|
1145
|
+
*
|
|
1023
1146
|
* **Details**
|
|
1024
1147
|
*
|
|
1025
1148
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1048,6 +1171,11 @@ export const takeRight = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1048
1171
|
* Takes elements from the start while the predicate holds, stopping at the
|
|
1049
1172
|
* first element that fails.
|
|
1050
1173
|
*
|
|
1174
|
+
* **When to use**
|
|
1175
|
+
*
|
|
1176
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
1177
|
+
* a predicate, returning the retained prefix as an array.
|
|
1178
|
+
*
|
|
1051
1179
|
* **Details**
|
|
1052
1180
|
*
|
|
1053
1181
|
* - Supports refinements for type narrowing.
|
|
@@ -1061,9 +1189,9 @@ export const takeRight = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1061
1189
|
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
1062
1190
|
* ```
|
|
1063
1191
|
*
|
|
1064
|
-
* @see {@link take}
|
|
1065
|
-
* @see {@link dropWhile}
|
|
1066
|
-
* @see {@link span}
|
|
1192
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
1193
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
1194
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
1067
1195
|
*
|
|
1068
1196
|
* @category getters
|
|
1069
1197
|
* @since 2.0.0
|
|
@@ -1083,11 +1211,19 @@ export const takeWhile = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1083
1211
|
/**
|
|
1084
1212
|
* Takes elements from the start while a `Filter` succeeds, collecting transformed values.
|
|
1085
1213
|
*
|
|
1214
|
+
* **When to use**
|
|
1215
|
+
*
|
|
1216
|
+
* Use when you need to take a prefix of elements while a function can
|
|
1217
|
+
* successfully extract or transform them, stopping at the first element
|
|
1218
|
+
* that produces a failure result.
|
|
1219
|
+
*
|
|
1086
1220
|
* **Details**
|
|
1087
1221
|
*
|
|
1088
1222
|
* - The filter receives `(element, index)`.
|
|
1089
1223
|
* - Stops at the first filter failure.
|
|
1090
1224
|
*
|
|
1225
|
+
* @see {@link takeWhile} for taking a prefix based on a boolean predicate
|
|
1226
|
+
*
|
|
1091
1227
|
* @category getters
|
|
1092
1228
|
* @since 4.0.0
|
|
1093
1229
|
*/
|
|
@@ -1118,6 +1254,11 @@ const spanIndex = (self, predicate) => {
|
|
|
1118
1254
|
* Splits an iterable into two arrays: the longest prefix where the predicate
|
|
1119
1255
|
* holds, and the remaining elements.
|
|
1120
1256
|
*
|
|
1257
|
+
* **When to use**
|
|
1258
|
+
*
|
|
1259
|
+
* Use to split an iterable into the longest prefix that satisfies a predicate
|
|
1260
|
+
* and the elements after that prefix when you need both parts.
|
|
1261
|
+
*
|
|
1121
1262
|
* **Details**
|
|
1122
1263
|
*
|
|
1123
1264
|
* - Equivalent to `[takeWhile(pred), dropWhile(pred)]` but more efficient
|
|
@@ -1132,9 +1273,9 @@ const spanIndex = (self, predicate) => {
|
|
|
1132
1273
|
* console.log(Array.span([1, 3, 2, 4, 5], (x) => x % 2 === 1)) // [[1, 3], [2, 4, 5]]
|
|
1133
1274
|
* ```
|
|
1134
1275
|
*
|
|
1135
|
-
* @see {@link takeWhile}
|
|
1136
|
-
* @see {@link dropWhile}
|
|
1137
|
-
* @see {@link splitWhere}
|
|
1276
|
+
* @see {@link takeWhile} for keeping only the matching prefix
|
|
1277
|
+
* @see {@link dropWhile} for keeping only the elements after the matching prefix
|
|
1278
|
+
* @see {@link splitWhere} for splitting at the first element that satisfies a predicate
|
|
1138
1279
|
*
|
|
1139
1280
|
* @category splitting
|
|
1140
1281
|
* @since 2.0.0
|
|
@@ -1146,6 +1287,11 @@ export const span = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1146
1287
|
/**
|
|
1147
1288
|
* Removes the first `n` elements, creating a new array.
|
|
1148
1289
|
*
|
|
1290
|
+
* **When to use**
|
|
1291
|
+
*
|
|
1292
|
+
* Use to keep the suffix of an iterable after skipping a fixed number of
|
|
1293
|
+
* leading elements.
|
|
1294
|
+
*
|
|
1149
1295
|
* **Details**
|
|
1150
1296
|
*
|
|
1151
1297
|
* - `n` is clamped to `[0, length]`.
|
|
@@ -1159,9 +1305,9 @@ export const span = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1159
1305
|
* console.log(Array.drop([1, 2, 3, 4, 5], 2)) // [3, 4, 5]
|
|
1160
1306
|
* ```
|
|
1161
1307
|
*
|
|
1162
|
-
* @see {@link dropRight}
|
|
1163
|
-
* @see {@link dropWhile}
|
|
1164
|
-
* @see {@link take}
|
|
1308
|
+
* @see {@link dropRight} for removing a fixed number of elements from the end
|
|
1309
|
+
* @see {@link dropWhile} for removing a prefix based on a predicate instead of a fixed count
|
|
1310
|
+
* @see {@link take} for keeping a fixed number of elements from the start
|
|
1165
1311
|
*
|
|
1166
1312
|
* @category getters
|
|
1167
1313
|
* @since 2.0.0
|
|
@@ -1173,9 +1319,13 @@ export const drop = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1173
1319
|
/**
|
|
1174
1320
|
* Removes the last `n` elements, creating a new array.
|
|
1175
1321
|
*
|
|
1322
|
+
* **When to use**
|
|
1323
|
+
*
|
|
1324
|
+
* Use to remove the last `n` elements from an iterable.
|
|
1325
|
+
*
|
|
1176
1326
|
* **Details**
|
|
1177
1327
|
*
|
|
1178
|
-
*
|
|
1328
|
+
* `n` is clamped to `[0, length]`.
|
|
1179
1329
|
*
|
|
1180
1330
|
* **Example** (Dropping from the end)
|
|
1181
1331
|
*
|
|
@@ -1198,9 +1348,13 @@ export const dropRight = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1198
1348
|
/**
|
|
1199
1349
|
* Drops elements from the start while the predicate holds, returning the rest.
|
|
1200
1350
|
*
|
|
1351
|
+
* **When to use**
|
|
1352
|
+
*
|
|
1353
|
+
* Use to remove a leading prefix of elements that satisfy a predicate.
|
|
1354
|
+
*
|
|
1201
1355
|
* **Details**
|
|
1202
1356
|
*
|
|
1203
|
-
*
|
|
1357
|
+
* The predicate receives `(element, index)`.
|
|
1204
1358
|
*
|
|
1205
1359
|
* **Example** (Dropping while condition holds)
|
|
1206
1360
|
*
|
|
@@ -1230,11 +1384,19 @@ export const dropWhile = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1230
1384
|
/**
|
|
1231
1385
|
* Drops elements from the start while a `Filter` succeeds.
|
|
1232
1386
|
*
|
|
1387
|
+
* **When to use**
|
|
1388
|
+
*
|
|
1389
|
+
* Use when dropping a prefix requires computing a `Result` per element instead
|
|
1390
|
+
* of a simple boolean predicate.
|
|
1391
|
+
*
|
|
1233
1392
|
* **Details**
|
|
1234
1393
|
*
|
|
1235
1394
|
* - The filter receives `(element, index)`.
|
|
1236
1395
|
* - Returns the remaining original elements after the first filter failure.
|
|
1237
1396
|
*
|
|
1397
|
+
* @see {@link dropWhile} for dropping a prefix with a simple boolean predicate
|
|
1398
|
+
* @see {@link takeWhileFilter} for keeping only the matching prefix
|
|
1399
|
+
*
|
|
1238
1400
|
* @category getters
|
|
1239
1401
|
* @since 4.0.0
|
|
1240
1402
|
*/
|
|
@@ -1253,6 +1415,11 @@ export const dropWhileFilter = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1253
1415
|
* Returns the index of the first element matching the predicate, wrapped in an
|
|
1254
1416
|
* `Option`.
|
|
1255
1417
|
*
|
|
1418
|
+
* **When to use**
|
|
1419
|
+
*
|
|
1420
|
+
* Use to find the index of the first matching element from the start of an
|
|
1421
|
+
* iterable.
|
|
1422
|
+
*
|
|
1256
1423
|
* **Example** (Finding an index)
|
|
1257
1424
|
*
|
|
1258
1425
|
* ```ts
|
|
@@ -1281,6 +1448,10 @@ export const findFirstIndex = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1281
1448
|
* Returns the index of the last element matching the predicate, wrapped in an
|
|
1282
1449
|
* `Option`.
|
|
1283
1450
|
*
|
|
1451
|
+
* **When to use**
|
|
1452
|
+
*
|
|
1453
|
+
* Use to find the index of the last matching element from the end of an array.
|
|
1454
|
+
*
|
|
1284
1455
|
* **Example** (Finding the last matching index)
|
|
1285
1456
|
*
|
|
1286
1457
|
* ```ts
|
|
@@ -1308,6 +1479,11 @@ export const findLastIndex = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
1308
1479
|
* Returns the first element matching a predicate, refinement, or mapping
|
|
1309
1480
|
* function, wrapped in `Option`.
|
|
1310
1481
|
*
|
|
1482
|
+
* **When to use**
|
|
1483
|
+
*
|
|
1484
|
+
* Use to scan an iterable in iteration order and return the first selected
|
|
1485
|
+
* element or mapped value as an `Option`.
|
|
1486
|
+
*
|
|
1311
1487
|
* **Details**
|
|
1312
1488
|
*
|
|
1313
1489
|
* - Accepts a predicate `(a, i) => boolean`, a refinement, or a function
|
|
@@ -1334,6 +1510,10 @@ export const findFirst = moduleIterable.findFirst;
|
|
|
1334
1510
|
* Returns the first selected value together with its index, wrapped in an
|
|
1335
1511
|
* `Option`.
|
|
1336
1512
|
*
|
|
1513
|
+
* **When to use**
|
|
1514
|
+
*
|
|
1515
|
+
* Use to find both the first matching element and its index in one pass.
|
|
1516
|
+
*
|
|
1337
1517
|
* **Details**
|
|
1338
1518
|
*
|
|
1339
1519
|
* Accepts a predicate, a refinement, or a function returning `Option`. For an
|
|
@@ -1375,6 +1555,10 @@ export const findFirstWithIndex = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1375
1555
|
* Returns the last element matching a predicate, refinement, or mapping
|
|
1376
1556
|
* function, wrapped in `Option`.
|
|
1377
1557
|
*
|
|
1558
|
+
* **When to use**
|
|
1559
|
+
*
|
|
1560
|
+
* Use to find the last matching element from the end of an array.
|
|
1561
|
+
*
|
|
1378
1562
|
* **Details**
|
|
1379
1563
|
*
|
|
1380
1564
|
* - Searches from the end of the array.
|
|
@@ -1412,13 +1596,16 @@ export const findLast = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1412
1596
|
return Option.none();
|
|
1413
1597
|
});
|
|
1414
1598
|
/**
|
|
1415
|
-
* Inserts an element at the specified index, returning a new `NonEmptyArray`
|
|
1599
|
+
* Inserts an element at the specified index safely, returning a new `NonEmptyArray`
|
|
1416
1600
|
* wrapped in an `Option`.
|
|
1417
1601
|
*
|
|
1602
|
+
* **When to use**
|
|
1603
|
+
*
|
|
1604
|
+
* Use to insert a single element at a specific position in an array.
|
|
1605
|
+
*
|
|
1418
1606
|
* **Details**
|
|
1419
1607
|
*
|
|
1420
1608
|
* - Valid indices: `0` to `length` (inclusive — inserting at `length` appends).
|
|
1421
|
-
* - Does not mutate the input.
|
|
1422
1609
|
*
|
|
1423
1610
|
* **Example** (Inserting at an index)
|
|
1424
1611
|
*
|
|
@@ -1443,13 +1630,16 @@ export const insertAt = /*#__PURE__*/dual(3, (self, i, b) => {
|
|
|
1443
1630
|
return Option.some(out);
|
|
1444
1631
|
});
|
|
1445
1632
|
/**
|
|
1446
|
-
* Replaces the element at the specified index with a new value, returning the
|
|
1633
|
+
* Replaces the element at the specified index safely with a new value, returning the
|
|
1447
1634
|
* updated array in `Option.some`.
|
|
1448
1635
|
*
|
|
1636
|
+
* **When to use**
|
|
1637
|
+
*
|
|
1638
|
+
* Use to set a fixed replacement value at a specific index.
|
|
1639
|
+
*
|
|
1449
1640
|
* **Details**
|
|
1450
1641
|
*
|
|
1451
1642
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
1452
|
-
* - Does not mutate the input.
|
|
1453
1643
|
*
|
|
1454
1644
|
* **Example** (Replacing an element)
|
|
1455
1645
|
*
|
|
@@ -1467,13 +1657,17 @@ export const insertAt = /*#__PURE__*/dual(3, (self, i, b) => {
|
|
|
1467
1657
|
*/
|
|
1468
1658
|
export const replace = /*#__PURE__*/dual(3, (self, i, b) => modify(self, i, () => b));
|
|
1469
1659
|
/**
|
|
1470
|
-
* Applies a function to the element at the specified index, returning the
|
|
1660
|
+
* Applies a function to the element at the specified index safely, returning the
|
|
1471
1661
|
* updated array in `Option.some`.
|
|
1472
1662
|
*
|
|
1663
|
+
* **When to use**
|
|
1664
|
+
*
|
|
1665
|
+
* Use to derive a replacement value from the current element at a specific
|
|
1666
|
+
* index while leaving the other elements unchanged.
|
|
1667
|
+
*
|
|
1473
1668
|
* **Details**
|
|
1474
1669
|
*
|
|
1475
1670
|
* - Returns `Option.none()` when the index is out of bounds.
|
|
1476
|
-
* - Does not mutate the input.
|
|
1477
1671
|
*
|
|
1478
1672
|
* **Example** (Modifying an element)
|
|
1479
1673
|
*
|
|
@@ -1505,9 +1699,9 @@ export const modify = /*#__PURE__*/dual(3, (self, i, f) => {
|
|
|
1505
1699
|
* Removes the element at the specified index, returning a new array. If the
|
|
1506
1700
|
* index is out of bounds, returns a copy of the original.
|
|
1507
1701
|
*
|
|
1508
|
-
* **
|
|
1702
|
+
* **When to use**
|
|
1509
1703
|
*
|
|
1510
|
-
*
|
|
1704
|
+
* Use to remove a single element at a known index.
|
|
1511
1705
|
*
|
|
1512
1706
|
* **Example** (Removing an element)
|
|
1513
1707
|
*
|
|
@@ -1535,9 +1729,12 @@ export const remove = /*#__PURE__*/dual(2, (self, i) => {
|
|
|
1535
1729
|
/**
|
|
1536
1730
|
* Reverses an iterable into a new array.
|
|
1537
1731
|
*
|
|
1732
|
+
* **When to use**
|
|
1733
|
+
*
|
|
1734
|
+
* Use to reverse the order of elements without mutating the original input.
|
|
1735
|
+
*
|
|
1538
1736
|
* **Details**
|
|
1539
1737
|
*
|
|
1540
|
-
* - Does not mutate the input.
|
|
1541
1738
|
* - Preserves `NonEmptyArray` in the return type.
|
|
1542
1739
|
*
|
|
1543
1740
|
* **Example** (Reversing an array)
|
|
@@ -1555,9 +1752,12 @@ export const reverse = self => Array.from(self).reverse();
|
|
|
1555
1752
|
/**
|
|
1556
1753
|
* Sorts an array by the given `Order`, returning a new array.
|
|
1557
1754
|
*
|
|
1755
|
+
* **When to use**
|
|
1756
|
+
*
|
|
1757
|
+
* Use to sort an array using a single `Order` comparator.
|
|
1758
|
+
*
|
|
1558
1759
|
* **Details**
|
|
1559
1760
|
*
|
|
1560
|
-
* - Does not mutate the input.
|
|
1561
1761
|
* - Preserves `NonEmptyArray` in the return type.
|
|
1562
1762
|
* - Use {@link sortWith} to sort by a derived key, or {@link sortBy} for
|
|
1563
1763
|
* multi-key sorting.
|
|
@@ -1585,10 +1785,14 @@ export const sort = /*#__PURE__*/dual(2, (self, O) => {
|
|
|
1585
1785
|
* Sorts an array by a derived key using a mapping function and an `Order` for
|
|
1586
1786
|
* that key.
|
|
1587
1787
|
*
|
|
1788
|
+
* **When to use**
|
|
1789
|
+
*
|
|
1790
|
+
* Use when values need to be sorted by a derived key, such as a string length
|
|
1791
|
+
* or object field, while the output should keep the original values.
|
|
1792
|
+
*
|
|
1588
1793
|
* **Details**
|
|
1589
1794
|
*
|
|
1590
1795
|
* - Equivalent to `sort(Order.mapInput(order, f))` but more convenient.
|
|
1591
|
-
* - Does not mutate the input.
|
|
1592
1796
|
*
|
|
1593
1797
|
* **Example** (Sorting strings by length)
|
|
1594
1798
|
*
|
|
@@ -1599,8 +1803,8 @@ export const sort = /*#__PURE__*/dual(2, (self, O) => {
|
|
|
1599
1803
|
* // ["b", "cc", "aaa"]
|
|
1600
1804
|
* ```
|
|
1601
1805
|
*
|
|
1602
|
-
* @see {@link sort}
|
|
1603
|
-
* @see {@link sortBy}
|
|
1806
|
+
* @see {@link sort} for sorting with an `Order` that compares the elements directly
|
|
1807
|
+
* @see {@link sortBy} for sorting with multiple `Order`s applied in sequence
|
|
1604
1808
|
*
|
|
1605
1809
|
* @category elements
|
|
1606
1810
|
* @since 2.0.0
|
|
@@ -1610,6 +1814,11 @@ export const sortWith = /*#__PURE__*/dual(3, (self, f, order) => Array.from(self
|
|
|
1610
1814
|
* Sorts an array by multiple `Order`s applied in sequence: the first order is
|
|
1611
1815
|
* used first; ties are broken by the second order, and so on.
|
|
1612
1816
|
*
|
|
1817
|
+
* **When to use**
|
|
1818
|
+
*
|
|
1819
|
+
* Use to sort by multiple criteria where later orders break ties from earlier
|
|
1820
|
+
* ones.
|
|
1821
|
+
*
|
|
1613
1822
|
* **Details**
|
|
1614
1823
|
*
|
|
1615
1824
|
* - Data-last only (returns a function).
|
|
@@ -1657,6 +1866,10 @@ export const sortBy = (...orders) => {
|
|
|
1657
1866
|
* Pairs elements from two iterables by position. If the iterables differ in
|
|
1658
1867
|
* length, the extra elements from the longer one are discarded.
|
|
1659
1868
|
*
|
|
1869
|
+
* **When to use**
|
|
1870
|
+
*
|
|
1871
|
+
* Use to pair corresponding elements from two iterables when you need simple pairs without a custom combiner.
|
|
1872
|
+
*
|
|
1660
1873
|
* **Details**
|
|
1661
1874
|
*
|
|
1662
1875
|
* - Returns `NonEmptyArray` when both inputs are non-empty.
|
|
@@ -1738,6 +1951,10 @@ export const unzip = self => {
|
|
|
1738
1951
|
/**
|
|
1739
1952
|
* Places a separator element between every pair of elements.
|
|
1740
1953
|
*
|
|
1954
|
+
* **When to use**
|
|
1955
|
+
*
|
|
1956
|
+
* Use to insert a separator between elements, for example when preparing data for display or concatenation.
|
|
1957
|
+
*
|
|
1741
1958
|
* **Details**
|
|
1742
1959
|
*
|
|
1743
1960
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -1775,6 +1992,10 @@ export const intersperse = /*#__PURE__*/dual(2, (self, middle) => {
|
|
|
1775
1992
|
* Applies a function to the first element of a non-empty array, returning a
|
|
1776
1993
|
* new array.
|
|
1777
1994
|
*
|
|
1995
|
+
* **When to use**
|
|
1996
|
+
*
|
|
1997
|
+
* Use to transform the first element of a non-empty array while preserving the rest.
|
|
1998
|
+
*
|
|
1778
1999
|
* **Example** (Modifying the head)
|
|
1779
2000
|
*
|
|
1780
2001
|
* ```ts
|
|
@@ -1846,9 +2067,14 @@ export const modifyLastNonEmpty = /*#__PURE__*/dual(2, (self, f) => append(initN
|
|
|
1846
2067
|
*/
|
|
1847
2068
|
export const setLastNonEmpty = /*#__PURE__*/dual(2, (self, b) => modifyLastNonEmpty(self, () => b));
|
|
1848
2069
|
/**
|
|
1849
|
-
*
|
|
2070
|
+
* Transforms an array by rotating it `n` steps. Positive `n` rotates right; negative `n`
|
|
1850
2071
|
* rotates left.
|
|
1851
2072
|
*
|
|
2073
|
+
* **When to use**
|
|
2074
|
+
*
|
|
2075
|
+
* Use when elements should wrap around the end of the array rather than being
|
|
2076
|
+
* dropped.
|
|
2077
|
+
*
|
|
1852
2078
|
* **Details**
|
|
1853
2079
|
*
|
|
1854
2080
|
* - `n` is rounded to the nearest integer before rotating.
|
|
@@ -1863,6 +2089,9 @@ export const setLastNonEmpty = /*#__PURE__*/dual(2, (self, b) => modifyLastNonEm
|
|
|
1863
2089
|
* console.log(Array.rotate(["a", "b", "c", "d"], 2)) // ["c", "d", "a", "b"]
|
|
1864
2090
|
* ```
|
|
1865
2091
|
*
|
|
2092
|
+
* @see {@link take} for taking a fixed number of elements from the start
|
|
2093
|
+
* @see {@link drop} for dropping a fixed number of elements from the start
|
|
2094
|
+
*
|
|
1866
2095
|
* @category elements
|
|
1867
2096
|
* @since 2.0.0
|
|
1868
2097
|
*/
|
|
@@ -1886,6 +2115,11 @@ export const rotate = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1886
2115
|
/**
|
|
1887
2116
|
* Returns a membership-test function using a custom equivalence.
|
|
1888
2117
|
*
|
|
2118
|
+
* **When to use**
|
|
2119
|
+
*
|
|
2120
|
+
* Use when checking membership with caller-provided equality instead of
|
|
2121
|
+
* `Equal.equivalence()`.
|
|
2122
|
+
*
|
|
1889
2123
|
* **Example** (Custom equality check)
|
|
1890
2124
|
*
|
|
1891
2125
|
* ```ts
|
|
@@ -1895,7 +2129,7 @@ export const rotate = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
1895
2129
|
* console.log(pipe([1, 2, 3, 4], containsNumber(3))) // true
|
|
1896
2130
|
* ```
|
|
1897
2131
|
*
|
|
1898
|
-
* @see {@link contains}
|
|
2132
|
+
* @see {@link contains} for the `Equal.equivalence()` variant
|
|
1899
2133
|
*
|
|
1900
2134
|
* @category elements
|
|
1901
2135
|
* @since 2.0.0
|
|
@@ -1909,9 +2143,14 @@ export const containsWith = isEquivalent => dual(2, (self, a) => {
|
|
|
1909
2143
|
return false;
|
|
1910
2144
|
});
|
|
1911
2145
|
/**
|
|
1912
|
-
*
|
|
2146
|
+
* Checks whether an array contains a value, using `Equal.equivalence()` for
|
|
1913
2147
|
* comparison.
|
|
1914
2148
|
*
|
|
2149
|
+
* **When to use**
|
|
2150
|
+
*
|
|
2151
|
+
* Use to check membership with Effect's default equality instead of providing a
|
|
2152
|
+
* comparison function.
|
|
2153
|
+
*
|
|
1915
2154
|
* **Example** (Checking membership)
|
|
1916
2155
|
*
|
|
1917
2156
|
* ```ts
|
|
@@ -1927,8 +2166,13 @@ export const containsWith = isEquivalent => dual(2, (self, a) => {
|
|
|
1927
2166
|
*/
|
|
1928
2167
|
export const contains = /*#__PURE__*/containsWith(/*#__PURE__*/Equal.asEquivalence());
|
|
1929
2168
|
/**
|
|
1930
|
-
*
|
|
1931
|
-
*
|
|
2169
|
+
* Applies a function repeatedly to consume prefixes of the array and collect
|
|
2170
|
+
* the values it produces.
|
|
2171
|
+
*
|
|
2172
|
+
* **When to use**
|
|
2173
|
+
*
|
|
2174
|
+
* Use when the grouping logic is custom and each step needs to return both a
|
|
2175
|
+
* value and the remaining input.
|
|
1932
2176
|
*
|
|
1933
2177
|
* **Details**
|
|
1934
2178
|
*
|
|
@@ -1973,6 +2217,10 @@ export const chop = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
1973
2217
|
/**
|
|
1974
2218
|
* Splits an iterable into two arrays at the given index.
|
|
1975
2219
|
*
|
|
2220
|
+
* **When to use**
|
|
2221
|
+
*
|
|
2222
|
+
* Use to divide an array into a prefix and suffix at a specific position.
|
|
2223
|
+
*
|
|
1976
2224
|
* **Details**
|
|
1977
2225
|
*
|
|
1978
2226
|
* - `n` can be `0` (all elements in the second array).
|
|
@@ -2028,6 +2276,10 @@ export const splitAtNonEmpty = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2028
2276
|
/**
|
|
2029
2277
|
* Splits an iterable into `n` roughly equal-sized chunks.
|
|
2030
2278
|
*
|
|
2279
|
+
* **When to use**
|
|
2280
|
+
*
|
|
2281
|
+
* Use to distribute elements across a fixed number of groups, such as when splitting work across threads.
|
|
2282
|
+
*
|
|
2031
2283
|
* **Details**
|
|
2032
2284
|
*
|
|
2033
2285
|
* - Uses `chunksOf(ceil(length / n))` internally.
|
|
@@ -2054,6 +2306,10 @@ export const split = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2054
2306
|
* Splits an iterable at the first element matching the predicate. The matching
|
|
2055
2307
|
* element is included in the second array.
|
|
2056
2308
|
*
|
|
2309
|
+
* **When to use**
|
|
2310
|
+
*
|
|
2311
|
+
* Use to split an array at a condition boundary when you know which element marks the transition point.
|
|
2312
|
+
*
|
|
2057
2313
|
* **Example** (Splitting at a condition)
|
|
2058
2314
|
*
|
|
2059
2315
|
* ```ts
|
|
@@ -2072,6 +2328,11 @@ export const splitWhere = /*#__PURE__*/dual(2, (self, predicate) => span(self, (
|
|
|
2072
2328
|
/**
|
|
2073
2329
|
* Creates a shallow copy of an array.
|
|
2074
2330
|
*
|
|
2331
|
+
* **When to use**
|
|
2332
|
+
*
|
|
2333
|
+
* Use to create a distinct array reference for an existing array, for example
|
|
2334
|
+
* before mutating the returned array.
|
|
2335
|
+
*
|
|
2075
2336
|
* **Details**
|
|
2076
2337
|
*
|
|
2077
2338
|
* - Preserves `NonEmptyArray` in the return type.
|
|
@@ -2098,6 +2359,10 @@ export const copy = self => self.slice();
|
|
|
2098
2359
|
* Pads or truncates an array to exactly `n` elements, filling with `fill`
|
|
2099
2360
|
* if the array is shorter, or slicing if longer.
|
|
2100
2361
|
*
|
|
2362
|
+
* **When to use**
|
|
2363
|
+
*
|
|
2364
|
+
* Use to ensure an array has a specific length, padding with a fill value or truncating as needed.
|
|
2365
|
+
*
|
|
2101
2366
|
* **Details**
|
|
2102
2367
|
*
|
|
2103
2368
|
* - Returns an empty array when `n <= 0`.
|
|
@@ -2126,6 +2391,11 @@ export const pad = /*#__PURE__*/dual(3, (self, n, fill) => {
|
|
|
2126
2391
|
* Splits an iterable into chunks of length `n`. The last chunk may be shorter
|
|
2127
2392
|
* if `n` does not evenly divide the length.
|
|
2128
2393
|
*
|
|
2394
|
+
* **When to use**
|
|
2395
|
+
*
|
|
2396
|
+
* Use to divide an iterable into non-overlapping chunks with a maximum chunk
|
|
2397
|
+
* size.
|
|
2398
|
+
*
|
|
2129
2399
|
* **Details**
|
|
2130
2400
|
*
|
|
2131
2401
|
* - `chunksOf(n)([])` is `[]`, not `[[]]`.
|
|
@@ -2156,6 +2426,10 @@ export const chunksOf = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2156
2426
|
/**
|
|
2157
2427
|
* Creates overlapping sliding windows of size `n`.
|
|
2158
2428
|
*
|
|
2429
|
+
* **When to use**
|
|
2430
|
+
*
|
|
2431
|
+
* Use to process sequences with a moving window, such as for computing running averages or detecting patterns.
|
|
2432
|
+
*
|
|
2159
2433
|
* **Details**
|
|
2160
2434
|
*
|
|
2161
2435
|
* - Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
|
|
@@ -2187,6 +2461,11 @@ export const window = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2187
2461
|
/**
|
|
2188
2462
|
* Groups consecutive equal elements using a custom equivalence function.
|
|
2189
2463
|
*
|
|
2464
|
+
* **When to use**
|
|
2465
|
+
*
|
|
2466
|
+
* Use when a non-empty array is already arranged so matching elements are
|
|
2467
|
+
* adjacent and you need a custom equivalence function.
|
|
2468
|
+
*
|
|
2190
2469
|
* **Details**
|
|
2191
2470
|
*
|
|
2192
2471
|
* - Only groups **adjacent** elements — non-adjacent duplicates stay separate.
|
|
@@ -2201,8 +2480,8 @@ export const window = /*#__PURE__*/dual(2, (self, n) => {
|
|
|
2201
2480
|
* // [["a", "a"], ["b", "b", "b"], ["c"], ["a"]]
|
|
2202
2481
|
* ```
|
|
2203
2482
|
*
|
|
2204
|
-
* @see {@link group}
|
|
2205
|
-
* @see {@link groupBy}
|
|
2483
|
+
* @see {@link group} for grouping adjacent elements with `Equal.equivalence()`
|
|
2484
|
+
* @see {@link groupBy} for grouping all elements into a record by key, regardless of adjacency
|
|
2206
2485
|
*
|
|
2207
2486
|
* @category grouping
|
|
2208
2487
|
* @since 2.0.0
|
|
@@ -2224,6 +2503,11 @@ export const groupWith = /*#__PURE__*/dual(2, (self, isEquivalent) => chop(self,
|
|
|
2224
2503
|
/**
|
|
2225
2504
|
* Groups consecutive equal elements using `Equal.equivalence()`.
|
|
2226
2505
|
*
|
|
2506
|
+
* **When to use**
|
|
2507
|
+
*
|
|
2508
|
+
* Use when equal values are already adjacent and Effect's default equality is
|
|
2509
|
+
* the right comparison.
|
|
2510
|
+
*
|
|
2227
2511
|
* **Details**
|
|
2228
2512
|
*
|
|
2229
2513
|
* - Only groups **adjacent** elements.
|
|
@@ -2247,6 +2531,10 @@ export const group = /*#__PURE__*/groupWith(/*#__PURE__*/Equal.asEquivalence());
|
|
|
2247
2531
|
* Groups elements into a record by a key-returning function. Each key maps
|
|
2248
2532
|
* to a `NonEmptyArray` of elements that produced that key.
|
|
2249
2533
|
*
|
|
2534
|
+
* **When to use**
|
|
2535
|
+
*
|
|
2536
|
+
* Use to build buckets of elements indexed by a computed string or symbol key.
|
|
2537
|
+
*
|
|
2250
2538
|
* **Details**
|
|
2251
2539
|
*
|
|
2252
2540
|
* - Unlike {@link group}/{@link groupWith}, elements do not need to be
|
|
@@ -2291,6 +2579,11 @@ export const groupBy = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2291
2579
|
* Computes the union of two arrays using a custom equivalence, removing
|
|
2292
2580
|
* duplicates.
|
|
2293
2581
|
*
|
|
2582
|
+
* **When to use**
|
|
2583
|
+
*
|
|
2584
|
+
* Use when you need the union of two arrays but duplicate detection must use a
|
|
2585
|
+
* custom equivalence instead of the default `Equal.equivalence()`.
|
|
2586
|
+
*
|
|
2294
2587
|
* **Example** (Union with custom equality)
|
|
2295
2588
|
*
|
|
2296
2589
|
* ```ts
|
|
@@ -2299,9 +2592,9 @@ export const groupBy = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2299
2592
|
* console.log(Array.unionWith([1, 2], [2, 3], (a, b) => a === b)) // [1, 2, 3]
|
|
2300
2593
|
* ```
|
|
2301
2594
|
*
|
|
2302
|
-
* @see {@link union}
|
|
2303
|
-
* @see {@link
|
|
2304
|
-
* @see {@link
|
|
2595
|
+
* @see {@link union} for the `Equal.equivalence()` variant
|
|
2596
|
+
* @see {@link intersectionWith} for keeping elements present in both arrays
|
|
2597
|
+
* @see {@link differenceWith} for keeping elements present only in the first array
|
|
2305
2598
|
*
|
|
2306
2599
|
* @category elements
|
|
2307
2600
|
* @since 2.0.0
|
|
@@ -2342,6 +2635,11 @@ export const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that,
|
|
|
2342
2635
|
* Computes the intersection of two arrays using a custom equivalence. Order is
|
|
2343
2636
|
* determined by the first array.
|
|
2344
2637
|
*
|
|
2638
|
+
* **When to use**
|
|
2639
|
+
*
|
|
2640
|
+
* Use when keeping only values present in both arrays and equality must be
|
|
2641
|
+
* defined by a custom comparator, such as matching objects by id.
|
|
2642
|
+
*
|
|
2345
2643
|
* **Example** (Intersection with custom equality)
|
|
2346
2644
|
*
|
|
2347
2645
|
* ```ts
|
|
@@ -2353,9 +2651,9 @@ export const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that,
|
|
|
2353
2651
|
* console.log(Array.intersectionWith(isEquivalent)(array2)(array1)) // [{ id: 1 }, { id: 3 }]
|
|
2354
2652
|
* ```
|
|
2355
2653
|
*
|
|
2356
|
-
* @see {@link intersection}
|
|
2357
|
-
* @see {@link
|
|
2358
|
-
* @see {@link
|
|
2654
|
+
* @see {@link intersection} for the `Equal.equivalence()` variant
|
|
2655
|
+
* @see {@link unionWith} for keeping values from either array with custom equality
|
|
2656
|
+
* @see {@link differenceWith} for keeping values only from the first array with custom equality
|
|
2359
2657
|
*
|
|
2360
2658
|
* @category elements
|
|
2361
2659
|
* @since 2.0.0
|
|
@@ -2391,6 +2689,11 @@ export const intersection = /*#__PURE__*/intersectionWith(/*#__PURE__*/Equal.asE
|
|
|
2391
2689
|
* Computes elements in the first array that are not in the second, using a
|
|
2392
2690
|
* custom equivalence.
|
|
2393
2691
|
*
|
|
2692
|
+
* **When to use**
|
|
2693
|
+
*
|
|
2694
|
+
* Use when keeping only values from the first array and equality must be
|
|
2695
|
+
* defined by a custom comparator, such as matching objects by id.
|
|
2696
|
+
*
|
|
2394
2697
|
* **Example** (Difference with custom equality)
|
|
2395
2698
|
*
|
|
2396
2699
|
* ```ts
|
|
@@ -2400,9 +2703,9 @@ export const intersection = /*#__PURE__*/intersectionWith(/*#__PURE__*/Equal.asE
|
|
|
2400
2703
|
* console.log(diff) // [1]
|
|
2401
2704
|
* ```
|
|
2402
2705
|
*
|
|
2403
|
-
* @see {@link difference}
|
|
2404
|
-
* @see {@link
|
|
2405
|
-
* @see {@link
|
|
2706
|
+
* @see {@link difference} for the `Equal.equivalence()` variant
|
|
2707
|
+
* @see {@link unionWith} for keeping values from either array with custom equality
|
|
2708
|
+
* @see {@link intersectionWith} for keeping values present in both arrays with custom equality
|
|
2406
2709
|
*
|
|
2407
2710
|
* @category elements
|
|
2408
2711
|
* @since 2.0.0
|
|
@@ -2418,6 +2721,11 @@ export const differenceWith = isEquivalent => {
|
|
|
2418
2721
|
* Computes elements in the first array that are not in the second, using
|
|
2419
2722
|
* `Equal.equivalence()`.
|
|
2420
2723
|
*
|
|
2724
|
+
* **When to use**
|
|
2725
|
+
*
|
|
2726
|
+
* Use when you need to keep values from the first array that are absent from
|
|
2727
|
+
* the second and the default `Equal.equivalence()` comparison is appropriate.
|
|
2728
|
+
*
|
|
2421
2729
|
* **Example** (Array difference)
|
|
2422
2730
|
*
|
|
2423
2731
|
* ```ts
|
|
@@ -2437,6 +2745,10 @@ export const difference = /*#__PURE__*/differenceWith(/*#__PURE__*/Equal.asEquiv
|
|
|
2437
2745
|
/**
|
|
2438
2746
|
* Creates an empty array.
|
|
2439
2747
|
*
|
|
2748
|
+
* **When to use**
|
|
2749
|
+
*
|
|
2750
|
+
* Use to create a typed empty array without allocating placeholder elements.
|
|
2751
|
+
*
|
|
2440
2752
|
* **Example** (Creating an empty array)
|
|
2441
2753
|
*
|
|
2442
2754
|
* ```ts
|
|
@@ -2474,6 +2786,10 @@ export const of = a => [a];
|
|
|
2474
2786
|
/**
|
|
2475
2787
|
* Transforms each element using a function, returning a new array.
|
|
2476
2788
|
*
|
|
2789
|
+
* **When to use**
|
|
2790
|
+
*
|
|
2791
|
+
* Use to transform each element independently while preserving the array shape.
|
|
2792
|
+
*
|
|
2477
2793
|
* **Details**
|
|
2478
2794
|
*
|
|
2479
2795
|
* - The function receives `(element, index)`.
|
|
@@ -2496,6 +2812,11 @@ export const map = /*#__PURE__*/dual(2, (self, f) => self.map(f));
|
|
|
2496
2812
|
/**
|
|
2497
2813
|
* Maps each element to an array and flattens the results into a single array.
|
|
2498
2814
|
*
|
|
2815
|
+
* **When to use**
|
|
2816
|
+
*
|
|
2817
|
+
* Use to map each element to zero or more values and concatenate the results in
|
|
2818
|
+
* one pass.
|
|
2819
|
+
*
|
|
2499
2820
|
* **Details**
|
|
2500
2821
|
*
|
|
2501
2822
|
* - The function receives `(element, index)`.
|
|
@@ -2531,6 +2852,11 @@ export const flatMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2531
2852
|
/**
|
|
2532
2853
|
* Flattens a nested array of arrays into a single array.
|
|
2533
2854
|
*
|
|
2855
|
+
* **When to use**
|
|
2856
|
+
*
|
|
2857
|
+
* Use to collapse one level of nested arrays when no per-element mapping is
|
|
2858
|
+
* needed.
|
|
2859
|
+
*
|
|
2534
2860
|
* **Example** (Flattening nested arrays)
|
|
2535
2861
|
*
|
|
2536
2862
|
* ```ts
|
|
@@ -2548,6 +2874,11 @@ export const flatten = /*#__PURE__*/flatMap(identity);
|
|
|
2548
2874
|
/**
|
|
2549
2875
|
* Extracts all `Some` values from an iterable of `Option`s, discarding `None`s.
|
|
2550
2876
|
*
|
|
2877
|
+
* **When to use**
|
|
2878
|
+
*
|
|
2879
|
+
* Use to collect only present values from `Option` values while discarding
|
|
2880
|
+
* `None` values.
|
|
2881
|
+
*
|
|
2551
2882
|
* **Example** (Extracting Some values)
|
|
2552
2883
|
*
|
|
2553
2884
|
* ```ts
|
|
@@ -2575,6 +2906,11 @@ export const getSomes = self => {
|
|
|
2575
2906
|
* Extracts all failure values from an iterable of `Result`s, discarding
|
|
2576
2907
|
* successes.
|
|
2577
2908
|
*
|
|
2909
|
+
* **When to use**
|
|
2910
|
+
*
|
|
2911
|
+
* Use to collect only failure values from `Result` values while discarding
|
|
2912
|
+
* successes.
|
|
2913
|
+
*
|
|
2578
2914
|
* **Example** (Extracting failures)
|
|
2579
2915
|
*
|
|
2580
2916
|
* ```ts
|
|
@@ -2603,6 +2939,11 @@ export const getFailures = self => {
|
|
|
2603
2939
|
* Extracts all success values from an iterable of `Result`s, discarding
|
|
2604
2940
|
* failures.
|
|
2605
2941
|
*
|
|
2942
|
+
* **When to use**
|
|
2943
|
+
*
|
|
2944
|
+
* Use to collect only success values from `Result` values while discarding
|
|
2945
|
+
* failures.
|
|
2946
|
+
*
|
|
2606
2947
|
* **Example** (Extracting successes)
|
|
2607
2948
|
*
|
|
2608
2949
|
* ```ts
|
|
@@ -2630,6 +2971,11 @@ export const getSuccesses = self => {
|
|
|
2630
2971
|
/**
|
|
2631
2972
|
* Keeps transformed values for elements where a `Filter` succeeds.
|
|
2632
2973
|
*
|
|
2974
|
+
* **When to use**
|
|
2975
|
+
*
|
|
2976
|
+
* Use to transform elements with a `Result`-returning filter while discarding
|
|
2977
|
+
* failures.
|
|
2978
|
+
*
|
|
2633
2979
|
* **Details**
|
|
2634
2980
|
*
|
|
2635
2981
|
* - The filter receives `(element, index)`.
|
|
@@ -2645,6 +2991,7 @@ export const getSuccesses = self => {
|
|
|
2645
2991
|
* ```
|
|
2646
2992
|
*
|
|
2647
2993
|
* @see {@link filter} — keep original elements matching a predicate
|
|
2994
|
+
* @see {@link partition} for keeping both failures and successes
|
|
2648
2995
|
*
|
|
2649
2996
|
* @category filtering
|
|
2650
2997
|
* @since 2.0.0
|
|
@@ -2663,6 +3010,10 @@ export const filterMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2663
3010
|
/**
|
|
2664
3011
|
* Keeps only elements satisfying a predicate (or refinement).
|
|
2665
3012
|
*
|
|
3013
|
+
* **When to use**
|
|
3014
|
+
*
|
|
3015
|
+
* Use to keep original elements that satisfy a boolean predicate or refinement.
|
|
3016
|
+
*
|
|
2666
3017
|
* **Details**
|
|
2667
3018
|
*
|
|
2668
3019
|
* - The predicate receives `(element, index)`.
|
|
@@ -2677,6 +3028,7 @@ export const filterMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2677
3028
|
* ```
|
|
2678
3029
|
*
|
|
2679
3030
|
* @see {@link partition} — split into matching and non-matching
|
|
3031
|
+
* @see {@link filterMap} for transforming while filtering
|
|
2680
3032
|
*
|
|
2681
3033
|
* @category filtering
|
|
2682
3034
|
* @since 2.0.0
|
|
@@ -2694,6 +3046,11 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
2694
3046
|
/**
|
|
2695
3047
|
* Splits an iterable using a `Filter` into failures and successes.
|
|
2696
3048
|
*
|
|
3049
|
+
* **When to use**
|
|
3050
|
+
*
|
|
3051
|
+
* Use to evaluate each element with a `Result`-returning filter and keep both
|
|
3052
|
+
* failure and success values.
|
|
3053
|
+
*
|
|
2697
3054
|
* **Details**
|
|
2698
3055
|
*
|
|
2699
3056
|
* - Returns `[excluded, satisfying]`.
|
|
@@ -2711,6 +3068,7 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => {
|
|
|
2711
3068
|
* ```
|
|
2712
3069
|
*
|
|
2713
3070
|
* @see {@link filter} — keep only matching elements
|
|
3071
|
+
* @see {@link filterMap} for discarding failures
|
|
2714
3072
|
* @see {@link separate} — split an iterable of `Result` values
|
|
2715
3073
|
*
|
|
2716
3074
|
* @category filtering
|
|
@@ -2733,6 +3091,10 @@ export const partition = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2733
3091
|
/**
|
|
2734
3092
|
* Separates an iterable of `Result`s into failure values and success values.
|
|
2735
3093
|
*
|
|
3094
|
+
* **When to use**
|
|
3095
|
+
*
|
|
3096
|
+
* Use to split existing `Result` values into failure and success arrays.
|
|
3097
|
+
*
|
|
2736
3098
|
* **Details**
|
|
2737
3099
|
*
|
|
2738
3100
|
* - Returns `[failures, successes]`.
|
|
@@ -2752,6 +3114,7 @@ export const partition = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
2752
3114
|
*
|
|
2753
3115
|
* @see {@link getFailures} — extract only failures
|
|
2754
3116
|
* @see {@link getSuccesses} — extract only successes
|
|
3117
|
+
* @see {@link partition} for computing `Result` values while splitting
|
|
2755
3118
|
*
|
|
2756
3119
|
* @category filtering
|
|
2757
3120
|
* @since 2.0.0
|
|
@@ -2760,6 +3123,10 @@ export const separate = /*#__PURE__*/partition(identity);
|
|
|
2760
3123
|
/**
|
|
2761
3124
|
* Folds an iterable from left to right into a single value.
|
|
2762
3125
|
*
|
|
3126
|
+
* **When to use**
|
|
3127
|
+
*
|
|
3128
|
+
* Use to combine all elements into one accumulated value from left to right.
|
|
3129
|
+
*
|
|
2763
3130
|
* **Details**
|
|
2764
3131
|
*
|
|
2765
3132
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -2782,6 +3149,11 @@ export const reduce = /*#__PURE__*/dual(3, (self, b, f) => fromIterable(self).re
|
|
|
2782
3149
|
/**
|
|
2783
3150
|
* Folds an iterable from right to left into a single value.
|
|
2784
3151
|
*
|
|
3152
|
+
* **When to use**
|
|
3153
|
+
*
|
|
3154
|
+
* Use when folding order matters and values must be combined from right to
|
|
3155
|
+
* left.
|
|
3156
|
+
*
|
|
2785
3157
|
* **Details**
|
|
2786
3158
|
*
|
|
2787
3159
|
* - The function receives `(accumulator, element, index)`.
|
|
@@ -2850,6 +3222,10 @@ export const liftOption = f => (...a) => fromOption(f(...a));
|
|
|
2850
3222
|
* Converts a nullable value to an array: `null`/`undefined` becomes `[]`,
|
|
2851
3223
|
* anything else becomes `[value]`.
|
|
2852
3224
|
*
|
|
3225
|
+
* **When to use**
|
|
3226
|
+
*
|
|
3227
|
+
* Use to treat a nullable single value as zero or one array element.
|
|
3228
|
+
*
|
|
2853
3229
|
* **Example** (Nullable to array)
|
|
2854
3230
|
*
|
|
2855
3231
|
* ```ts
|
|
@@ -2895,6 +3271,11 @@ export const liftNullishOr = f => (...a) => fromNullishOr(f(...a));
|
|
|
2895
3271
|
* Maps each element with a nullable-returning function, keeping only non-null /
|
|
2896
3272
|
* non-undefined results.
|
|
2897
3273
|
*
|
|
3274
|
+
* **When to use**
|
|
3275
|
+
*
|
|
3276
|
+
* Use when mapping and filtering in one step, where the mapper can return
|
|
3277
|
+
* `null` or `undefined` to skip elements.
|
|
3278
|
+
*
|
|
2898
3279
|
* **Example** (FlatMapping with nullable)
|
|
2899
3280
|
*
|
|
2900
3281
|
* ```ts
|
|
@@ -2904,6 +3285,9 @@ export const liftNullishOr = f => (...a) => fromNullishOr(f(...a));
|
|
|
2904
3285
|
* // [1, 3]
|
|
2905
3286
|
* ```
|
|
2906
3287
|
*
|
|
3288
|
+
* @see {@link flatMap} for mapping each element to an array and flattening
|
|
3289
|
+
* @see {@link fromNullishOr} for converting a single nullable value to an array
|
|
3290
|
+
*
|
|
2907
3291
|
* @category sequencing
|
|
2908
3292
|
* @since 4.0.0
|
|
2909
3293
|
*/
|
|
@@ -2938,9 +3322,14 @@ export const liftResult = f => (...a) => {
|
|
|
2938
3322
|
return Result.isFailure(e) ? [] : [e.success];
|
|
2939
3323
|
};
|
|
2940
3324
|
/**
|
|
2941
|
-
*
|
|
3325
|
+
* Checks whether all elements satisfy the predicate. Supports refinements for
|
|
2942
3326
|
* type narrowing.
|
|
2943
3327
|
*
|
|
3328
|
+
* **When to use**
|
|
3329
|
+
*
|
|
3330
|
+
* Use to check that all elements satisfy a predicate, including
|
|
3331
|
+
* refinement-based type narrowing.
|
|
3332
|
+
*
|
|
2944
3333
|
* **Example** (Testing all elements)
|
|
2945
3334
|
*
|
|
2946
3335
|
* ```ts
|
|
@@ -2957,7 +3346,7 @@ export const liftResult = f => (...a) => {
|
|
|
2957
3346
|
*/
|
|
2958
3347
|
export const every = /*#__PURE__*/dual(2, (self, refinement) => self.every(refinement));
|
|
2959
3348
|
/**
|
|
2960
|
-
*
|
|
3349
|
+
* Checks whether at least one element satisfies the predicate. Narrows the type
|
|
2961
3350
|
* to `NonEmptyReadonlyArray` on success.
|
|
2962
3351
|
*
|
|
2963
3352
|
* **Example** (Testing for any match)
|
|
@@ -2980,6 +3369,11 @@ export const some = /*#__PURE__*/dual(2, (self, predicate) => self.some(predicat
|
|
|
2980
3369
|
* Applies a function to each suffix of the array (starting from each index),
|
|
2981
3370
|
* collecting the results.
|
|
2982
3371
|
*
|
|
3372
|
+
* **When to use**
|
|
3373
|
+
*
|
|
3374
|
+
* Use when a computation depends on every suffix of an array, such as
|
|
3375
|
+
* cumulative aggregations from each position.
|
|
3376
|
+
*
|
|
2983
3377
|
* **Details**
|
|
2984
3378
|
*
|
|
2985
3379
|
* - For index `i`, the function receives `self.slice(i)`.
|
|
@@ -2992,6 +3386,8 @@ export const some = /*#__PURE__*/dual(2, (self, predicate) => self.some(predicat
|
|
|
2992
3386
|
* console.log(Array.extend([1, 2, 3], (as) => as.length)) // [3, 2, 1]
|
|
2993
3387
|
* ```
|
|
2994
3388
|
*
|
|
3389
|
+
* @see {@link scan} for keeping intermediate accumulator values during a fold
|
|
3390
|
+
*
|
|
2995
3391
|
* @category mapping
|
|
2996
3392
|
* @since 2.0.0
|
|
2997
3393
|
*/
|
|
@@ -3111,6 +3507,11 @@ export const makeEquivalence = Equivalence.Array;
|
|
|
3111
3507
|
/**
|
|
3112
3508
|
* Runs a side-effect for each element. The callback receives `(element, index)`.
|
|
3113
3509
|
*
|
|
3510
|
+
* **When to use**
|
|
3511
|
+
*
|
|
3512
|
+
* Use to iterate over an array for side-effects only, when no transformed
|
|
3513
|
+
* result is needed.
|
|
3514
|
+
*
|
|
3114
3515
|
* **Example** (Iterating with side-effects)
|
|
3115
3516
|
*
|
|
3116
3517
|
* ```ts
|
|
@@ -3119,6 +3520,8 @@ export const makeEquivalence = Equivalence.Array;
|
|
|
3119
3520
|
* Array.forEach([1, 2, 3], (n) => console.log(n)) // 1, 2, 3
|
|
3120
3521
|
* ```
|
|
3121
3522
|
*
|
|
3523
|
+
* @see {@link map} for transforming each element into a new array
|
|
3524
|
+
*
|
|
3122
3525
|
* @category elements
|
|
3123
3526
|
* @since 2.0.0
|
|
3124
3527
|
*/
|
|
@@ -3127,6 +3530,11 @@ export const forEach = /*#__PURE__*/dual(2, (self, f) => fromIterable(self).forE
|
|
|
3127
3530
|
* Removes duplicates using a custom equivalence, preserving the order of the
|
|
3128
3531
|
* first occurrence.
|
|
3129
3532
|
*
|
|
3533
|
+
* **When to use**
|
|
3534
|
+
*
|
|
3535
|
+
* Use to remove all duplicate elements with a custom equivalence when default
|
|
3536
|
+
* equality is not appropriate.
|
|
3537
|
+
*
|
|
3130
3538
|
* **Example** (Deduplicating with custom equality)
|
|
3131
3539
|
*
|
|
3132
3540
|
* ```ts
|
|
@@ -3159,6 +3567,11 @@ export const dedupeWith = /*#__PURE__*/dual(2, (self, isEquivalent) => {
|
|
|
3159
3567
|
* Removes duplicates using `Equal.equivalence()`, preserving the order of the
|
|
3160
3568
|
* first occurrence.
|
|
3161
3569
|
*
|
|
3570
|
+
* **When to use**
|
|
3571
|
+
*
|
|
3572
|
+
* Use to remove repeated values from an iterable when Effect's default equality
|
|
3573
|
+
* is the right comparison, preserving the first occurrence.
|
|
3574
|
+
*
|
|
3162
3575
|
* **Example** (Removing duplicates)
|
|
3163
3576
|
*
|
|
3164
3577
|
* ```ts
|
|
@@ -3177,6 +3590,12 @@ export const dedupe = self => dedupeWith(self, Equal.asEquivalence());
|
|
|
3177
3590
|
/**
|
|
3178
3591
|
* Removes consecutive duplicate elements using a custom equivalence.
|
|
3179
3592
|
*
|
|
3593
|
+
* **When to use**
|
|
3594
|
+
*
|
|
3595
|
+
* Use when consecutive duplicates should be collapsed using a custom
|
|
3596
|
+
* equivalence, while equivalent values that appear later should remain in the
|
|
3597
|
+
* result.
|
|
3598
|
+
*
|
|
3180
3599
|
* **Details**
|
|
3181
3600
|
*
|
|
3182
3601
|
* - Non-adjacent duplicates are preserved.
|
|
@@ -3210,6 +3629,11 @@ export const dedupeAdjacentWith = /*#__PURE__*/dual(2, (self, isEquivalent) => {
|
|
|
3210
3629
|
/**
|
|
3211
3630
|
* Removes consecutive duplicate elements using `Equal.equivalence()`.
|
|
3212
3631
|
*
|
|
3632
|
+
* **When to use**
|
|
3633
|
+
*
|
|
3634
|
+
* Use when you need to collapse consecutive duplicates while preserving later
|
|
3635
|
+
* non-consecutive repeats, and the default equality is sufficient.
|
|
3636
|
+
*
|
|
3213
3637
|
* **Example** (Removing adjacent duplicates)
|
|
3214
3638
|
*
|
|
3215
3639
|
* ```ts
|
|
@@ -3245,6 +3669,11 @@ export const join = /*#__PURE__*/dual(2, (self, sep) => fromIterable(self).join(
|
|
|
3245
3669
|
/**
|
|
3246
3670
|
* Maps over an array while threading an accumulator through each step, returning both the final state and the mapped array.
|
|
3247
3671
|
*
|
|
3672
|
+
* **When to use**
|
|
3673
|
+
*
|
|
3674
|
+
* Use when mapping needs state threaded through each element and the final state
|
|
3675
|
+
* is also needed.
|
|
3676
|
+
*
|
|
3248
3677
|
* **Details**
|
|
3249
3678
|
*
|
|
3250
3679
|
* - Combines `map` and `reduce` in a single pass.
|
|
@@ -3282,6 +3711,11 @@ export const mapAccum = /*#__PURE__*/dual(3, (self, s, f) => {
|
|
|
3282
3711
|
/**
|
|
3283
3712
|
* Computes the cartesian product of two arrays, applying a combiner to each pair.
|
|
3284
3713
|
*
|
|
3714
|
+
* **When to use**
|
|
3715
|
+
*
|
|
3716
|
+
* Use to compute every combination from two arrays and immediately transform
|
|
3717
|
+
* each pair into a custom result.
|
|
3718
|
+
*
|
|
3285
3719
|
* **Details**
|
|
3286
3720
|
*
|
|
3287
3721
|
* - Produces every combination of an element from `self` with an element from `that`.
|
|
@@ -3297,7 +3731,7 @@ export const mapAccum = /*#__PURE__*/dual(3, (self, s, f) => {
|
|
|
3297
3731
|
* console.log(result) // ["1-a", "1-b", "2-a", "2-b"]
|
|
3298
3732
|
* ```
|
|
3299
3733
|
*
|
|
3300
|
-
* @see {@link cartesian}
|
|
3734
|
+
* @see {@link cartesian} for returning tuples instead of applying a combiner
|
|
3301
3735
|
*
|
|
3302
3736
|
* @category elements
|
|
3303
3737
|
* @since 2.0.0
|
|
@@ -3306,6 +3740,10 @@ export const cartesianWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(sel
|
|
|
3306
3740
|
/**
|
|
3307
3741
|
* Computes the cartesian product of two arrays, returning all pairs as tuples.
|
|
3308
3742
|
*
|
|
3743
|
+
* **When to use**
|
|
3744
|
+
*
|
|
3745
|
+
* Use when you need every `[a, b]` pair from two arrays as tuples.
|
|
3746
|
+
*
|
|
3309
3747
|
* **Details**
|
|
3310
3748
|
*
|
|
3311
3749
|
* - Produces every `[a, b]` combination of an element from `self` with an element from `that`.
|
|
@@ -3330,11 +3768,11 @@ export const cartesian = /*#__PURE__*/dual(2, (self, that) => cartesianWith(self
|
|
|
3330
3768
|
// do notation
|
|
3331
3769
|
// -------------------------------------------------------------------------------------
|
|
3332
3770
|
/**
|
|
3333
|
-
*
|
|
3771
|
+
* Provides the starting point for the "do simulation" — an array comprehension pattern.
|
|
3334
3772
|
*
|
|
3335
3773
|
* **When to use**
|
|
3336
3774
|
*
|
|
3337
|
-
*
|
|
3775
|
+
* Use when begin a pipeline with `Do`, then use {@link bind} to introduce array variables and {@link let_ let} for plain values.
|
|
3338
3776
|
* - Each `bind` produces the cartesian product of all bound variables (like nested loops).
|
|
3339
3777
|
* - Use `filter` and `map` in the pipeline to add conditions and transformations.
|
|
3340
3778
|
*
|
|
@@ -3362,7 +3800,12 @@ export const cartesian = /*#__PURE__*/dual(2, (self, that) => cartesianWith(self
|
|
|
3362
3800
|
*/
|
|
3363
3801
|
export const Do = /*#__PURE__*/of({});
|
|
3364
3802
|
/**
|
|
3365
|
-
*
|
|
3803
|
+
* Adds a new array variable to a do-notation scope, producing the cartesian product with all previous bindings.
|
|
3804
|
+
*
|
|
3805
|
+
* **When to use**
|
|
3806
|
+
*
|
|
3807
|
+
* Use to add another array-producing binding to an `Array.Do` pipeline, pairing
|
|
3808
|
+
* each existing scope with every value returned by the callback.
|
|
3366
3809
|
*
|
|
3367
3810
|
* **Details**
|
|
3368
3811
|
*
|
|
@@ -3393,7 +3836,12 @@ export const Do = /*#__PURE__*/of({});
|
|
|
3393
3836
|
*/
|
|
3394
3837
|
export const bind = /*#__PURE__*/internalDoNotation.bind(map, flatMap);
|
|
3395
3838
|
/**
|
|
3396
|
-
*
|
|
3839
|
+
* Wraps each array element in an object with the given key, starting a do-notation scope.
|
|
3840
|
+
*
|
|
3841
|
+
* **When to use**
|
|
3842
|
+
*
|
|
3843
|
+
* Use when you already have an array and want to start a do-notation pipeline
|
|
3844
|
+
* by naming each element.
|
|
3397
3845
|
*
|
|
3398
3846
|
* **Details**
|
|
3399
3847
|
*
|
|
@@ -3474,7 +3922,12 @@ export function makeReducerConcat() {
|
|
|
3474
3922
|
return reducer;
|
|
3475
3923
|
}
|
|
3476
3924
|
/**
|
|
3477
|
-
*
|
|
3925
|
+
* Computes the number of elements in an iterable that satisfy a predicate.
|
|
3926
|
+
*
|
|
3927
|
+
* **When to use**
|
|
3928
|
+
*
|
|
3929
|
+
* Use to count how many elements satisfy a predicate when you only need the
|
|
3930
|
+
* number of matches instead of the matching elements.
|
|
3478
3931
|
*
|
|
3479
3932
|
* **Details**
|
|
3480
3933
|
*
|