effect 4.0.0-beta.70 → 4.0.0-beta.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +1428 -138
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +595 -126
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +594 -8
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +307 -8
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +457 -3
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +279 -3
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +229 -7
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +155 -5
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +51 -5
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +80 -8
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +64 -3
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +50 -12
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +475 -183
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +336 -114
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +398 -59
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +166 -47
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +78 -3
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +44 -3
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +112 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +32 -0
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +57 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +30 -0
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +15 -11
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -8
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +126 -40
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +102 -29
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +48 -25
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +17 -17
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +22 -1
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +22 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +491 -36
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +185 -11
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +110 -1
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +86 -1
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +29 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +29 -0
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +77 -26
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +10 -7
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +149 -6
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +81 -2
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +340 -74
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +128 -9
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +5 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +164 -11
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +91 -11
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +1822 -537
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +684 -224
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +14 -0
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +14 -0
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +89 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +131 -1
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +7 -7
- package/dist/Equal.js +5 -5
- package/dist/Equivalence.d.ts +41 -24
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +38 -21
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +123 -5
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +85 -5
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +89 -24
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +21 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +128 -82
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +106 -69
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +317 -68
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +150 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FileSystem.d.ts +69 -10
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +85 -29
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +221 -2
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +155 -2
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +3 -3
- package/dist/Formatter.js +2 -2
- package/dist/Function.d.ts +152 -6
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +104 -3
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +275 -3
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +63 -0
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +55 -23
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +92 -16
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +116 -14
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +2 -2
- package/dist/HashMap.js +2 -2
- package/dist/HashRing.d.ts +203 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +92 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/Inspectable.d.ts +43 -0
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +70 -13
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +179 -25
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +95 -23
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +33 -18
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +51 -43
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +2 -2
- package/dist/JsonPointer.js +2 -2
- package/dist/JsonSchema.d.ts +64 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +32 -8
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +156 -11
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +77 -2
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +250 -74
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +71 -21
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +8 -0
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +93 -18
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +65 -6
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +19 -5
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +24 -11
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +81 -9
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +32 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +185 -7
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +212 -24
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +33 -20
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +26 -13
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +272 -21
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +123 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +107 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +96 -37
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +10 -2
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +10 -2
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +136 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +70 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +20 -11
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -6
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +20 -4
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +5 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +417 -2
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +255 -2
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +17 -17
- package/dist/Optic.js +12 -12
- package/dist/Option.d.ts +168 -129
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +67 -63
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +82 -82
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +138 -109
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +32 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +19 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +238 -11
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +107 -5
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +35 -4
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +21 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +27 -2
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +14 -2
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +53 -4
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +45 -4
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +140 -14
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +63 -8
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +96 -87
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +107 -73
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +74 -8
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +69 -8
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +94 -20
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +94 -20
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +147 -2
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +68 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +127 -35
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +127 -35
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +71 -16
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +168 -6
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +48 -2
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +73 -18
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +23 -3
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +95 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +95 -1
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +20 -16
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +15 -11
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +82 -4
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +64 -4
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +17 -5
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -2
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +156 -20
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +125 -20
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +208 -12
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +144 -5
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +13 -0
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +47 -1
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +215 -32
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +54 -7
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +202 -15
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +94 -5
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +62 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +52 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +328 -23
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +132 -12
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +123 -13
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +149 -24
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +418 -93
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +334 -97
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +50 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +39 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +467 -42
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +248 -48
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +205 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +205 -2
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +123 -123
- package/dist/SchemaGetter.js +111 -111
- package/dist/SchemaIssue.d.ts +25 -24
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +19 -19
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +238 -3
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +279 -21
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +61 -17
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +58 -14
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +76 -38
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +73 -35
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +9 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +38 -11
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +79 -14
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +63 -14
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +352 -7
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +151 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +67 -5
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +47 -3
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +347 -28
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +102 -7
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +307 -4
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +173 -2
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +69 -15
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +60 -15
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +516 -65
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +234 -33
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +173 -2
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +149 -2
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +19 -10
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +13 -4
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +73 -14
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +72 -13
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +24 -6
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +24 -6
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +502 -2
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +184 -2
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +36 -13
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +5 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +68 -17
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +33 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +49 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +49 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +48 -9
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +70 -35
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +32 -21
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +40 -7
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +40 -7
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +85 -2
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +56 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +29 -2
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +29 -2
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +94 -4
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +66 -4
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +48 -7
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +40 -4
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +40 -4
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +112 -7
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +81 -7
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +173 -14
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +130 -14
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +205 -2
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +110 -2
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +60 -6
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +171 -30
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +115 -30
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +120 -12
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +36 -12
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +20 -14
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +13 -4
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -5205
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5205
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/request.js +3 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +11 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/representation.js +21 -12
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +69 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +73 -9
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +81 -24
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +71 -25
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -107
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -107
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +24 -1
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +24 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +9 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +43 -11
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +25 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +53 -28
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +100 -5
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +100 -5
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +1 -1
- package/dist/unstable/ai/IdGenerator.js +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +41 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +40 -1
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +10 -2
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +10 -2
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +59 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +59 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +35 -13
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +34 -12
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +48 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +23 -2
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +22 -1
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +71 -13
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +35 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +34 -12
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +33 -11
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +40 -27
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +34 -26
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +34 -23
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +34 -23
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +82 -21
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +81 -20
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +1 -1
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +0 -560
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +0 -560
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +133 -5
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +49 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +13 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +41 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +15 -3
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +15 -3
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +28 -4
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +28 -4
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +126 -0
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +57 -5
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +2 -2
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +58 -9
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +26 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +25 -0
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +0 -220
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +0 -220
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +61 -22
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +61 -22
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +53 -0
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +53 -0
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +76 -24
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +76 -24
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +18 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +17 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +19 -0
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +19 -0
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +44 -7
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +44 -7
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +19 -0
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +19 -0
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +26 -14
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +26 -14
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +33 -14
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +35 -9
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +35 -9
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +1 -1
- package/dist/unstable/cluster/Message.js +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +31 -17
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +31 -17
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +46 -13
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +46 -13
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +45 -9
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +45 -9
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +30 -13
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +30 -13
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +15 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +15 -1
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +24 -0
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +24 -0
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +22 -0
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +22 -0
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +19 -0
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +55 -17
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +57 -13
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +58 -14
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +26 -12
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +27 -13
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +25 -0
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +25 -0
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +51 -9
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +51 -9
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +27 -13
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +27 -13
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +13 -0
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +13 -0
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +21 -0
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +21 -0
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +38 -0
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +73 -13
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +27 -16
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +27 -16
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +0 -790
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +0 -790
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +41 -11
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +41 -11
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +38 -0
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +68 -11
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +24 -16
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +20 -13
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +20 -13
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +0 -58
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +0 -58
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +30 -15
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +28 -14
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +28 -14
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +35 -14
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +0 -49
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +0 -49
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +28 -13
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +22 -14
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +21 -13
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +31 -14
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +52 -15
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +52 -15
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +21 -12
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +17 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +17 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +45 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +82 -15
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +33 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +21 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +50 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +30 -11
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +0 -240
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +0 -240
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +59 -13
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +59 -13
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +43 -13
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +43 -13
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +53 -16
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +53 -16
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +52 -15
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +52 -15
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +53 -13
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +37 -21
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -2
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +27 -11
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +38 -17
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +38 -17
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +35 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +33 -14
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +30 -15
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +30 -15
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +1 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +40 -17
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +30 -17
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +30 -17
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +32 -19
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +32 -19
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +33 -16
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +28 -14
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +49 -27
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +43 -21
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +30 -13
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +29 -12
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +28 -15
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +28 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +37 -17
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +37 -17
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +27 -14
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +25 -12
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +29 -13
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +29 -13
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +33 -18
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +34 -19
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +0 -452
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +0 -452
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +48 -24
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +37 -23
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +28 -16
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +51 -23
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +36 -16
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +34 -23
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +4 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +28 -16
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +39 -36
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +39 -36
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +28 -16
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +36 -24
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +0 -311
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +0 -311
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +31 -16
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +30 -14
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +33 -15
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +27 -16
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +27 -16
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +1 -1
- package/dist/unstable/observability/index.d.ts +0 -183
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +0 -183
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +4 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +4 -1
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +29 -16
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +27 -14
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +33 -15
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +0 -147
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +0 -147
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +15 -3
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +15 -3
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +0 -45
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +0 -45
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +40 -19
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +40 -19
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +36 -22
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +36 -22
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +32 -16
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +52 -25
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +74 -18
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +74 -18
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +29 -14
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +38 -20
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +38 -20
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +0 -166
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +0 -166
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +29 -18
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +29 -15
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +29 -15
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +29 -18
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +34 -16
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +31 -21
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +31 -21
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +29 -19
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +29 -19
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +33 -23
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +31 -21
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +31 -15
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +31 -15
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +29 -14
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +0 -272
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +0 -272
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +0 -37
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +0 -37
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +0 -44
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +0 -44
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +39 -18
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +31 -15
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +30 -15
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +30 -15
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +34 -14
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +0 -178
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +0 -178
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +29 -15
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +29 -15
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +36 -23
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +34 -21
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +32 -16
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +31 -20
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +31 -20
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +0 -80
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +0 -80
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +23 -11
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +33 -15
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +33 -15
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +0 -160
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +0 -160
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1504 -211
- package/src/BigDecimal.ts +594 -8
- package/src/BigInt.ts +457 -3
- package/src/Boolean.ts +229 -7
- package/src/Brand.ts +100 -8
- package/src/Cache.ts +87 -15
- package/src/Cause.ts +475 -183
- package/src/Channel.ts +498 -84
- package/src/ChannelSchema.ts +96 -3
- package/src/Chunk.ts +120 -0
- package/src/Clock.ts +57 -0
- package/src/Combiner.ts +15 -11
- package/src/Config.ts +126 -40
- package/src/ConfigProvider.ts +48 -25
- package/src/Console.ts +22 -1
- package/src/Context.ts +503 -37
- package/src/Cron.ts +110 -1
- package/src/Crypto.ts +29 -0
- package/src/Data.ts +77 -26
- package/src/DateTime.ts +149 -6
- package/src/Deferred.ts +340 -74
- package/src/Differ.ts +5 -0
- package/src/Duration.ts +164 -11
- package/src/Effect.ts +1860 -543
- package/src/Effectable.ts +14 -0
- package/src/Encoding.ts +135 -1
- package/src/Equal.ts +7 -7
- package/src/Equivalence.ts +44 -27
- package/src/ErrorReporter.ts +123 -5
- package/src/ExecutionPlan.ts +89 -24
- package/src/Exit.ts +128 -82
- package/src/Fiber.ts +317 -68
- package/src/FileSystem.ts +109 -33
- package/src/Filter.ts +221 -2
- package/src/Formatter.ts +3 -3
- package/src/Function.ts +152 -6
- package/src/Graph.ts +275 -3
- package/src/HKT.ts +55 -23
- package/src/Hash.ts +140 -20
- package/src/HashMap.ts +2 -2
- package/src/HashRing.ts +203 -0
- package/src/Inspectable.ts +82 -13
- package/src/Iterable.ts +179 -25
- package/src/JsonPatch.ts +78 -55
- package/src/JsonPointer.ts +2 -2
- package/src/JsonSchema.ts +64 -10
- package/src/Latch.ts +162 -11
- package/src/Layer.ts +250 -74
- package/src/LayerMap.ts +8 -0
- package/src/LogLevel.ts +93 -18
- package/src/Logger.ts +25 -9
- package/src/ManagedRuntime.ts +81 -9
- package/src/Match.ts +220 -24
- package/src/Metric.ts +33 -20
- package/src/MutableHashMap.ts +360 -21
- package/src/MutableHashSet.ts +141 -37
- package/src/MutableList.ts +10 -2
- package/src/MutableRef.ts +136 -0
- package/src/Newtype.ts +20 -11
- package/src/NonEmptyIterable.ts +20 -4
- package/src/Number.ts +417 -2
- package/src/Optic.ts +17 -17
- package/src/Option.ts +168 -129
- package/src/Order.ts +152 -123
- package/src/Ordering.ts +32 -0
- package/src/PartitionedSemaphore.ts +238 -11
- package/src/Path.ts +35 -4
- package/src/Pipeable.ts +27 -2
- package/src/PlatformError.ts +53 -4
- package/src/Pool.ts +174 -32
- package/src/Predicate.ts +149 -115
- package/src/PrimaryKey.ts +74 -8
- package/src/PubSub.ts +94 -20
- package/src/Pull.ts +147 -2
- package/src/Queue.ts +127 -35
- package/src/Random.ts +71 -16
- package/src/RcMap.ts +168 -6
- package/src/RcRef.ts +73 -18
- package/src/Record.ts +95 -1
- package/src/Redactable.ts +20 -16
- package/src/Redacted.ts +82 -4
- package/src/Reducer.ts +17 -5
- package/src/Ref.ts +300 -22
- package/src/References.ts +208 -12
- package/src/RegExp.ts +47 -1
- package/src/Request.ts +215 -32
- package/src/RequestResolver.ts +257 -22
- package/src/Resource.ts +62 -3
- package/src/Result.ts +328 -23
- package/src/Runtime.ts +171 -31
- package/src/Schedule.ts +484 -111
- package/src/Scheduler.ts +50 -1
- package/src/Schema.ts +508 -67
- package/src/SchemaAST.ts +205 -2
- package/src/SchemaGetter.ts +123 -123
- package/src/SchemaIssue.ts +25 -24
- package/src/SchemaParser.ts +279 -21
- package/src/SchemaRepresentation.ts +61 -17
- package/src/SchemaTransformation.ts +76 -38
- package/src/SchemaUtils.ts +38 -11
- package/src/Scope.ts +79 -14
- package/src/ScopedCache.ts +404 -7
- package/src/ScopedRef.ts +67 -5
- package/src/Semaphore.ts +347 -28
- package/src/Sink.ts +307 -4
- package/src/Stdio.ts +69 -15
- package/src/Stream.ts +611 -72
- package/src/String.ts +173 -2
- package/src/Struct.ts +19 -10
- package/src/SubscriptionRef.ts +73 -14
- package/src/Symbol.ts +24 -6
- package/src/SynchronizedRef.ts +502 -2
- package/src/Take.ts +36 -13
- package/src/Terminal.ts +68 -17
- package/src/Tracer.ts +49 -0
- package/src/Trie.ts +48 -9
- package/src/Tuple.ts +70 -35
- package/src/TxChunk.ts +40 -7
- package/src/TxDeferred.ts +85 -2
- package/src/TxPriorityQueue.ts +29 -2
- package/src/TxPubSub.ts +94 -4
- package/src/TxQueue.ts +48 -7
- package/src/TxReentrantLock.ts +40 -4
- package/src/TxRef.ts +112 -7
- package/src/TxSemaphore.ts +173 -14
- package/src/TxSubscriptionRef.ts +205 -2
- package/src/Types.ts +60 -6
- package/src/UndefinedOr.ts +171 -30
- package/src/Unify.ts +120 -12
- package/src/Utils.ts +20 -14
- package/src/index.ts +0 -5205
- package/src/internal/effect.ts +59 -29
- package/src/internal/request.ts +3 -1
- package/src/internal/schema/arbitrary.ts +14 -1
- package/src/internal/schema/representation.ts +37 -14
- package/src/testing/TestConsole.ts +105 -9
- package/src/testing/TestSchema.ts +83 -25
- package/src/testing/index.ts +0 -107
- package/src/unstable/ai/AiError.ts +24 -1
- package/src/unstable/ai/AnthropicStructuredOutput.ts +43 -11
- package/src/unstable/ai/Chat.ts +62 -28
- package/src/unstable/ai/EmbeddingModel.ts +100 -5
- package/src/unstable/ai/IdGenerator.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +41 -2
- package/src/unstable/ai/McpSchema.ts +10 -2
- package/src/unstable/ai/McpServer.ts +59 -1
- package/src/unstable/ai/Model.ts +35 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +48 -1
- package/src/unstable/ai/Prompt.ts +23 -2
- package/src/unstable/ai/Response.ts +71 -13
- package/src/unstable/ai/ResponseIdTracker.ts +34 -12
- package/src/unstable/ai/Telemetry.ts +40 -27
- package/src/unstable/ai/Tokenizer.ts +34 -23
- package/src/unstable/ai/Tool.ts +82 -21
- package/src/unstable/ai/Toolkit.ts +32 -4
- package/src/unstable/ai/index.ts +0 -560
- package/src/unstable/cli/Argument.ts +1 -1
- package/src/unstable/cli/Command.ts +133 -5
- package/src/unstable/cli/Completions.ts +41 -1
- package/src/unstable/cli/Flag.ts +15 -3
- package/src/unstable/cli/GlobalFlag.ts +28 -4
- package/src/unstable/cli/Param.ts +135 -9
- package/src/unstable/cli/Primitive.ts +58 -9
- package/src/unstable/cli/Prompt.ts +26 -1
- package/src/unstable/cli/index.ts +0 -220
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterError.ts +61 -22
- package/src/unstable/cluster/ClusterMetrics.ts +53 -0
- package/src/unstable/cluster/ClusterSchema.ts +76 -24
- package/src/unstable/cluster/Entity.ts +18 -1
- package/src/unstable/cluster/EntityAddress.ts +19 -0
- package/src/unstable/cluster/EntityId.ts +44 -7
- package/src/unstable/cluster/EntityType.ts +19 -0
- package/src/unstable/cluster/HttpRunner.ts +26 -14
- package/src/unstable/cluster/K8sHttpClient.ts +32 -13
- package/src/unstable/cluster/MachineId.ts +35 -9
- package/src/unstable/cluster/Message.ts +1 -1
- package/src/unstable/cluster/MessageStorage.ts +31 -17
- package/src/unstable/cluster/Runner.ts +46 -13
- package/src/unstable/cluster/RunnerAddress.ts +45 -9
- package/src/unstable/cluster/RunnerHealth.ts +30 -13
- package/src/unstable/cluster/RunnerServer.ts +15 -1
- package/src/unstable/cluster/Runners.ts +24 -0
- package/src/unstable/cluster/ShardId.ts +22 -0
- package/src/unstable/cluster/Sharding.ts +55 -17
- package/src/unstable/cluster/ShardingConfig.ts +57 -13
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +26 -12
- package/src/unstable/cluster/SingleRunner.ts +25 -0
- package/src/unstable/cluster/Singleton.ts +51 -9
- package/src/unstable/cluster/SingletonAddress.ts +27 -13
- package/src/unstable/cluster/Snowflake.ts +13 -0
- package/src/unstable/cluster/SocketRunner.ts +21 -0
- package/src/unstable/cluster/SqlMessageStorage.ts +73 -13
- package/src/unstable/cluster/SqlRunnerStorage.ts +20 -0
- package/src/unstable/cluster/TestRunner.ts +27 -16
- package/src/unstable/cluster/index.ts +0 -790
- package/src/unstable/devtools/DevTools.ts +41 -11
- package/src/unstable/devtools/DevToolsClient.ts +68 -11
- package/src/unstable/devtools/DevToolsSchema.ts +24 -16
- package/src/unstable/devtools/DevToolsServer.ts +18 -11
- package/src/unstable/devtools/index.ts +0 -58
- package/src/unstable/encoding/Msgpack.ts +30 -15
- package/src/unstable/encoding/Ndjson.ts +28 -14
- package/src/unstable/encoding/Sse.ts +35 -14
- package/src/unstable/encoding/index.ts +0 -49
- package/src/unstable/eventlog/Event.ts +30 -15
- package/src/unstable/eventlog/EventGroup.ts +22 -14
- package/src/unstable/eventlog/EventJournal.ts +31 -14
- package/src/unstable/eventlog/EventLog.ts +52 -15
- package/src/unstable/eventlog/EventLogMessage.ts +21 -12
- package/src/unstable/eventlog/EventLogServer.ts +27 -13
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +17 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +82 -15
- package/src/unstable/eventlog/EventLogSessionAuth.ts +35 -17
- package/src/unstable/eventlog/SqlEventJournal.ts +50 -14
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +39 -15
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +30 -11
- package/src/unstable/eventlog/index.ts +0 -240
- package/src/unstable/http/Cookies.ts +59 -13
- package/src/unstable/http/Etag.ts +43 -13
- package/src/unstable/http/FetchHttpClient.ts +53 -16
- package/src/unstable/http/Headers.ts +52 -15
- package/src/unstable/http/HttpBody.ts +53 -13
- package/src/unstable/http/HttpClient.ts +88 -22
- package/src/unstable/http/HttpClientError.ts +26 -10
- package/src/unstable/http/HttpClientRequest.ts +36 -15
- package/src/unstable/http/HttpClientResponse.ts +33 -14
- package/src/unstable/http/HttpEffect.ts +32 -15
- package/src/unstable/http/HttpMethod.ts +30 -15
- package/src/unstable/http/HttpRouter.ts +40 -17
- package/src/unstable/http/HttpServer.ts +30 -17
- package/src/unstable/http/HttpServerError.ts +32 -19
- package/src/unstable/http/HttpServerRequest.ts +31 -14
- package/src/unstable/http/HttpServerRespondable.ts +28 -14
- package/src/unstable/http/HttpServerResponse.ts +51 -29
- package/src/unstable/http/HttpStaticServer.ts +29 -12
- package/src/unstable/http/HttpTraceContext.ts +28 -15
- package/src/unstable/http/Multipart.ts +37 -17
- package/src/unstable/http/Template.ts +25 -12
- package/src/unstable/http/Url.ts +29 -13
- package/src/unstable/http/UrlParams.ts +33 -18
- package/src/unstable/http/index.ts +0 -452
- package/src/unstable/httpapi/HttpApi.ts +46 -22
- package/src/unstable/httpapi/HttpApiBuilder.ts +37 -23
- package/src/unstable/httpapi/HttpApiClient.ts +28 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +51 -23
- package/src/unstable/httpapi/HttpApiError.ts +36 -16
- package/src/unstable/httpapi/HttpApiGroup.ts +34 -23
- package/src/unstable/httpapi/HttpApiMiddleware.ts +49 -25
- package/src/unstable/httpapi/HttpApiScalar.ts +32 -17
- package/src/unstable/httpapi/HttpApiSchema.ts +39 -36
- package/src/unstable/httpapi/HttpApiSecurity.ts +54 -24
- package/src/unstable/httpapi/HttpApiSwagger.ts +28 -16
- package/src/unstable/httpapi/OpenApi.ts +38 -26
- package/src/unstable/httpapi/index.ts +0 -311
- package/src/unstable/observability/Otlp.ts +31 -16
- package/src/unstable/observability/OtlpLogger.ts +30 -14
- package/src/unstable/observability/OtlpResource.ts +33 -15
- package/src/unstable/observability/OtlpSerialization.ts +25 -14
- package/src/unstable/observability/PrometheusMetrics.ts +1 -1
- package/src/unstable/observability/index.ts +0 -183
- package/src/unstable/persistence/KeyValueStore.ts +4 -1
- package/src/unstable/persistence/PersistedCache.ts +27 -14
- package/src/unstable/persistence/Redis.ts +33 -15
- package/src/unstable/persistence/index.ts +0 -147
- package/src/unstable/process/ChildProcessSpawner.ts +15 -3
- package/src/unstable/process/index.ts +0 -45
- package/src/unstable/reactivity/AsyncResult.ts +38 -17
- package/src/unstable/reactivity/Atom.ts +36 -22
- package/src/unstable/reactivity/AtomRef.ts +58 -25
- package/src/unstable/reactivity/AtomRegistry.ts +72 -16
- package/src/unstable/reactivity/Hydration.ts +31 -16
- package/src/unstable/reactivity/Reactivity.ts +36 -18
- package/src/unstable/reactivity/index.ts +0 -166
- package/src/unstable/rpc/Rpc.ts +29 -18
- package/src/unstable/rpc/RpcClient.ts +31 -22
- package/src/unstable/rpc/RpcClientError.ts +27 -13
- package/src/unstable/rpc/RpcGroup.ts +28 -17
- package/src/unstable/rpc/RpcMessage.ts +34 -16
- package/src/unstable/rpc/RpcMiddleware.ts +31 -21
- package/src/unstable/rpc/RpcSchema.ts +29 -19
- package/src/unstable/rpc/RpcSerialization.ts +31 -21
- package/src/unstable/rpc/RpcServer.ts +31 -23
- package/src/unstable/rpc/RpcTest.ts +29 -13
- package/src/unstable/rpc/RpcWorker.ts +29 -14
- package/src/unstable/rpc/index.ts +0 -272
- package/src/unstable/schema/index.ts +0 -37
- package/src/unstable/socket/index.ts +0 -44
- package/src/unstable/sql/Migrator.ts +39 -18
- package/src/unstable/sql/SqlError.ts +31 -15
- package/src/unstable/sql/SqlSchema.ts +30 -15
- package/src/unstable/sql/Statement.ts +35 -15
- package/src/unstable/sql/index.ts +0 -178
- package/src/unstable/workers/Transferable.ts +29 -15
- package/src/unstable/workers/Worker.ts +34 -21
- package/src/unstable/workers/WorkerError.ts +34 -18
- package/src/unstable/workers/WorkerRunner.ts +29 -18
- package/src/unstable/workers/index.ts +0 -80
- package/src/unstable/workflow/DurableClock.ts +23 -11
- package/src/unstable/workflow/DurableQueue.ts +31 -13
- package/src/unstable/workflow/index.ts +0 -160
package/src/BigDecimal.ts
CHANGED
|
@@ -1,15 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Decimal arithmetic backed by an unscaled `bigint` and a decimal scale.
|
|
3
|
+
*
|
|
4
|
+
* `BigDecimal` is useful when values must keep their decimal representation
|
|
5
|
+
* instead of inheriting JavaScript's binary floating-point rounding, such as
|
|
6
|
+
* money, quantities, measurements, or protocol values exchanged as decimal
|
|
7
|
+
* strings. The module includes constructors, parsers, arithmetic operations,
|
|
8
|
+
* comparisons, rounding helpers, and string formatting.
|
|
9
|
+
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* - A `BigDecimal` stores `value * 10^-scale`; `make(12345n, 2)` represents
|
|
13
|
+
* `123.45`
|
|
14
|
+
* - Values are immutable; arithmetic returns new `BigDecimal` values
|
|
15
|
+
* - Equivalent values can have different internal scales, so equality and
|
|
16
|
+
* ordering normalize trailing zeros
|
|
17
|
+
* - Division can produce repeating decimals, so {@link divide} and
|
|
18
|
+
* {@link divideUnsafe} use the module's default division precision
|
|
19
|
+
*
|
|
20
|
+
* **Common tasks**
|
|
21
|
+
*
|
|
22
|
+
* - Construct values: {@link make}, {@link fromBigInt}, {@link fromString},
|
|
23
|
+
* {@link fromNumber}
|
|
24
|
+
* - Render values: {@link format}, {@link toExponential},
|
|
25
|
+
* {@link toNumberUnsafe}
|
|
26
|
+
* - Do arithmetic: {@link sum}, {@link subtract}, {@link multiply},
|
|
27
|
+
* {@link divide}, {@link remainder}, {@link negate}, {@link abs}
|
|
28
|
+
* - Compare and constrain values: {@link equals}, {@link Order},
|
|
29
|
+
* {@link isLessThan}, {@link between}, {@link clamp}, {@link min},
|
|
30
|
+
* {@link max}
|
|
31
|
+
* - Adjust decimal places: {@link scale}, {@link round}, {@link truncate},
|
|
32
|
+
* {@link ceil}, {@link floor}
|
|
4
33
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
34
|
+
* **Gotchas**
|
|
35
|
+
*
|
|
36
|
+
* - Prefer {@link fromString} or {@link fromBigInt} for external decimal data.
|
|
37
|
+
* {@link fromNumber} can only preserve the decimal spelling of a finite
|
|
38
|
+
* JavaScript number after any binary floating-point precision has already
|
|
39
|
+
* been lost.
|
|
40
|
+
* - {@link divide} and {@link remainder} return `Option.none()` for division
|
|
41
|
+
* by zero; {@link divideUnsafe} and {@link remainderUnsafe} throw instead.
|
|
42
|
+
* - Parsed scales must fit in JavaScript's safe integer range.
|
|
43
|
+
*
|
|
44
|
+
* **Example** (Decimal arithmetic)
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { BigDecimal } from "effect"
|
|
7
48
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
49
|
+
* const subtotal = BigDecimal.multiply(
|
|
50
|
+
* BigDecimal.fromStringUnsafe("19.99"),
|
|
51
|
+
* BigDecimal.fromBigInt(3n)
|
|
52
|
+
* )
|
|
53
|
+
* const total = BigDecimal.sum(subtotal, BigDecimal.fromStringUnsafe("1.50"))
|
|
10
54
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
55
|
+
* console.log(BigDecimal.format(total)) // "61.47"
|
|
56
|
+
* ```
|
|
13
57
|
*
|
|
14
58
|
* @since 2.0.0
|
|
15
59
|
*/
|
|
@@ -33,6 +77,11 @@ const TypeId = "~effect/BigDecimal"
|
|
|
33
77
|
/**
|
|
34
78
|
* Represents an arbitrary precision decimal number.
|
|
35
79
|
*
|
|
80
|
+
* **When to use**
|
|
81
|
+
*
|
|
82
|
+
* Use when decimal arithmetic needs to avoid JavaScript floating point
|
|
83
|
+
* representation errors.
|
|
84
|
+
*
|
|
36
85
|
* **Example** (Inspecting BigDecimal storage)
|
|
37
86
|
*
|
|
38
87
|
* ```ts
|
|
@@ -85,6 +134,10 @@ const BigDecimalProto: Omit<BigDecimal, "value" | "scale" | "normalized"> = {
|
|
|
85
134
|
/**
|
|
86
135
|
* Checks if a given value is a `BigDecimal`.
|
|
87
136
|
*
|
|
137
|
+
* **When to use**
|
|
138
|
+
*
|
|
139
|
+
* Use to validate unknown input and narrow it to `BigDecimal`.
|
|
140
|
+
*
|
|
88
141
|
* **Example** (Checking BigDecimal values)
|
|
89
142
|
*
|
|
90
143
|
* ```ts
|
|
@@ -104,6 +157,11 @@ export const isBigDecimal = (u: unknown): u is BigDecimal => hasProperty(u, Type
|
|
|
104
157
|
/**
|
|
105
158
|
* Creates a `BigDecimal` from a `bigint` value and a scale.
|
|
106
159
|
*
|
|
160
|
+
* **When to use**
|
|
161
|
+
*
|
|
162
|
+
* Use to construct a decimal directly from its unscaled integer value and
|
|
163
|
+
* decimal scale.
|
|
164
|
+
*
|
|
107
165
|
* **Example** (Creating decimals from bigint and scale)
|
|
108
166
|
*
|
|
109
167
|
* ```ts
|
|
@@ -118,6 +176,8 @@ export const isBigDecimal = (u: unknown): u is BigDecimal => hasProperty(u, Type
|
|
|
118
176
|
* console.log(BigDecimal.format(integer)) // "42"
|
|
119
177
|
* ```
|
|
120
178
|
*
|
|
179
|
+
* @see {@link fromBigInt} for constructing an integer decimal from a `bigint`
|
|
180
|
+
*
|
|
121
181
|
* @category constructors
|
|
122
182
|
* @since 2.0.0
|
|
123
183
|
*/
|
|
@@ -156,6 +216,11 @@ const one = makeNormalizedUnsafe(bigint1, 0)
|
|
|
156
216
|
/**
|
|
157
217
|
* Normalizes a given `BigDecimal` by removing trailing zeros.
|
|
158
218
|
*
|
|
219
|
+
* **When to use**
|
|
220
|
+
*
|
|
221
|
+
* Use to canonicalize decimals that have equivalent values but different
|
|
222
|
+
* internal scales.
|
|
223
|
+
*
|
|
159
224
|
* **Example** (Normalizing trailing zeros)
|
|
160
225
|
*
|
|
161
226
|
* ```ts
|
|
@@ -172,6 +237,8 @@ const one = makeNormalizedUnsafe(bigint1, 0)
|
|
|
172
237
|
* )
|
|
173
238
|
* ```
|
|
174
239
|
*
|
|
240
|
+
* @see {@link format} for rendering normalized decimals as strings
|
|
241
|
+
*
|
|
175
242
|
* @category scaling
|
|
176
243
|
* @since 2.0.0
|
|
177
244
|
*/
|
|
@@ -207,6 +274,10 @@ export const normalize = (self: BigDecimal): BigDecimal => {
|
|
|
207
274
|
/**
|
|
208
275
|
* Scales a `BigDecimal` to the specified scale.
|
|
209
276
|
*
|
|
277
|
+
* **When to use**
|
|
278
|
+
*
|
|
279
|
+
* Use to change how many decimal places are represented by a `BigDecimal`.
|
|
280
|
+
*
|
|
210
281
|
* **Details**
|
|
211
282
|
*
|
|
212
283
|
* Increasing the scale appends decimal zeros. Decreasing the scale discards
|
|
@@ -229,6 +300,8 @@ export const normalize = (self: BigDecimal): BigDecimal => {
|
|
|
229
300
|
* console.log(BigDecimal.format(reduced)) // "123.4"
|
|
230
301
|
* ```
|
|
231
302
|
*
|
|
303
|
+
* @see {@link round} for changing scale with configurable rounding
|
|
304
|
+
*
|
|
232
305
|
* @category scaling
|
|
233
306
|
* @since 2.0.0
|
|
234
307
|
*/
|
|
@@ -236,6 +309,10 @@ export const scale: {
|
|
|
236
309
|
/**
|
|
237
310
|
* Scales a `BigDecimal` to the specified scale.
|
|
238
311
|
*
|
|
312
|
+
* **When to use**
|
|
313
|
+
*
|
|
314
|
+
* Use to change how many decimal places are represented by a `BigDecimal`.
|
|
315
|
+
*
|
|
239
316
|
* **Details**
|
|
240
317
|
*
|
|
241
318
|
* Increasing the scale appends decimal zeros. Decreasing the scale discards
|
|
@@ -258,6 +335,8 @@ export const scale: {
|
|
|
258
335
|
* console.log(BigDecimal.format(reduced)) // "123.4"
|
|
259
336
|
* ```
|
|
260
337
|
*
|
|
338
|
+
* @see {@link round} for changing scale with configurable rounding
|
|
339
|
+
*
|
|
261
340
|
* @category scaling
|
|
262
341
|
* @since 2.0.0
|
|
263
342
|
*/
|
|
@@ -265,6 +344,10 @@ export const scale: {
|
|
|
265
344
|
/**
|
|
266
345
|
* Scales a `BigDecimal` to the specified scale.
|
|
267
346
|
*
|
|
347
|
+
* **When to use**
|
|
348
|
+
*
|
|
349
|
+
* Use to change how many decimal places are represented by a `BigDecimal`.
|
|
350
|
+
*
|
|
268
351
|
* **Details**
|
|
269
352
|
*
|
|
270
353
|
* Increasing the scale appends decimal zeros. Decreasing the scale discards
|
|
@@ -287,6 +370,8 @@ export const scale: {
|
|
|
287
370
|
* console.log(BigDecimal.format(reduced)) // "123.4"
|
|
288
371
|
* ```
|
|
289
372
|
*
|
|
373
|
+
* @see {@link round} for changing scale with configurable rounding
|
|
374
|
+
*
|
|
290
375
|
* @category scaling
|
|
291
376
|
* @since 2.0.0
|
|
292
377
|
*/
|
|
@@ -306,6 +391,10 @@ export const scale: {
|
|
|
306
391
|
/**
|
|
307
392
|
* Provides an addition operation on `BigDecimal`s.
|
|
308
393
|
*
|
|
394
|
+
* **When to use**
|
|
395
|
+
*
|
|
396
|
+
* Use to add two `BigDecimal` values.
|
|
397
|
+
*
|
|
309
398
|
* **Example** (Adding decimals)
|
|
310
399
|
*
|
|
311
400
|
* ```ts
|
|
@@ -318,6 +407,8 @@ export const scale: {
|
|
|
318
407
|
* )
|
|
319
408
|
* ```
|
|
320
409
|
*
|
|
410
|
+
* @see {@link sumAll} for summing an iterable of `BigDecimal` values
|
|
411
|
+
*
|
|
321
412
|
* @category math
|
|
322
413
|
* @since 2.0.0
|
|
323
414
|
*/
|
|
@@ -325,6 +416,10 @@ export const sum: {
|
|
|
325
416
|
/**
|
|
326
417
|
* Provides an addition operation on `BigDecimal`s.
|
|
327
418
|
*
|
|
419
|
+
* **When to use**
|
|
420
|
+
*
|
|
421
|
+
* Use to add two `BigDecimal` values.
|
|
422
|
+
*
|
|
328
423
|
* **Example** (Adding decimals)
|
|
329
424
|
*
|
|
330
425
|
* ```ts
|
|
@@ -337,6 +432,8 @@ export const sum: {
|
|
|
337
432
|
* )
|
|
338
433
|
* ```
|
|
339
434
|
*
|
|
435
|
+
* @see {@link sumAll} for summing an iterable of `BigDecimal` values
|
|
436
|
+
*
|
|
340
437
|
* @category math
|
|
341
438
|
* @since 2.0.0
|
|
342
439
|
*/
|
|
@@ -344,6 +441,10 @@ export const sum: {
|
|
|
344
441
|
/**
|
|
345
442
|
* Provides an addition operation on `BigDecimal`s.
|
|
346
443
|
*
|
|
444
|
+
* **When to use**
|
|
445
|
+
*
|
|
446
|
+
* Use to add two `BigDecimal` values.
|
|
447
|
+
*
|
|
347
448
|
* **Example** (Adding decimals)
|
|
348
449
|
*
|
|
349
450
|
* ```ts
|
|
@@ -356,6 +457,8 @@ export const sum: {
|
|
|
356
457
|
* )
|
|
357
458
|
* ```
|
|
358
459
|
*
|
|
460
|
+
* @see {@link sumAll} for summing an iterable of `BigDecimal` values
|
|
461
|
+
*
|
|
359
462
|
* @category math
|
|
360
463
|
* @since 2.0.0
|
|
361
464
|
*/
|
|
@@ -383,6 +486,10 @@ export const sum: {
|
|
|
383
486
|
/**
|
|
384
487
|
* Takes an `Iterable` of `BigDecimal`s and returns their sum as a single `BigDecimal`.
|
|
385
488
|
*
|
|
489
|
+
* **When to use**
|
|
490
|
+
*
|
|
491
|
+
* Use to sum all `BigDecimal` values in an iterable.
|
|
492
|
+
*
|
|
386
493
|
* **Example** (Adding multiple decimals)
|
|
387
494
|
*
|
|
388
495
|
* ```ts
|
|
@@ -395,6 +502,8 @@ export const sum: {
|
|
|
395
502
|
* )
|
|
396
503
|
* ```
|
|
397
504
|
*
|
|
505
|
+
* @see {@link sum} for adding two `BigDecimal` values
|
|
506
|
+
*
|
|
398
507
|
* @category math
|
|
399
508
|
* @since 3.16.0
|
|
400
509
|
*/
|
|
@@ -409,6 +518,10 @@ export const sumAll = (collection: Iterable<BigDecimal>): BigDecimal => {
|
|
|
409
518
|
/**
|
|
410
519
|
* Provides a multiplication operation on `BigDecimal`s.
|
|
411
520
|
*
|
|
521
|
+
* **When to use**
|
|
522
|
+
*
|
|
523
|
+
* Use to multiply two `BigDecimal` values.
|
|
524
|
+
*
|
|
412
525
|
* **Example** (Multiplying decimals)
|
|
413
526
|
*
|
|
414
527
|
* ```ts
|
|
@@ -421,6 +534,8 @@ export const sumAll = (collection: Iterable<BigDecimal>): BigDecimal => {
|
|
|
421
534
|
* )
|
|
422
535
|
* ```
|
|
423
536
|
*
|
|
537
|
+
* @see {@link multiplyAll} for multiplying an iterable of `BigDecimal` values
|
|
538
|
+
*
|
|
424
539
|
* @category math
|
|
425
540
|
* @since 2.0.0
|
|
426
541
|
*/
|
|
@@ -428,6 +543,10 @@ export const multiply: {
|
|
|
428
543
|
/**
|
|
429
544
|
* Provides a multiplication operation on `BigDecimal`s.
|
|
430
545
|
*
|
|
546
|
+
* **When to use**
|
|
547
|
+
*
|
|
548
|
+
* Use to multiply two `BigDecimal` values.
|
|
549
|
+
*
|
|
431
550
|
* **Example** (Multiplying decimals)
|
|
432
551
|
*
|
|
433
552
|
* ```ts
|
|
@@ -440,6 +559,8 @@ export const multiply: {
|
|
|
440
559
|
* )
|
|
441
560
|
* ```
|
|
442
561
|
*
|
|
562
|
+
* @see {@link multiplyAll} for multiplying an iterable of `BigDecimal` values
|
|
563
|
+
*
|
|
443
564
|
* @category math
|
|
444
565
|
* @since 2.0.0
|
|
445
566
|
*/
|
|
@@ -447,6 +568,10 @@ export const multiply: {
|
|
|
447
568
|
/**
|
|
448
569
|
* Provides a multiplication operation on `BigDecimal`s.
|
|
449
570
|
*
|
|
571
|
+
* **When to use**
|
|
572
|
+
*
|
|
573
|
+
* Use to multiply two `BigDecimal` values.
|
|
574
|
+
*
|
|
450
575
|
* **Example** (Multiplying decimals)
|
|
451
576
|
*
|
|
452
577
|
* ```ts
|
|
@@ -459,6 +584,8 @@ export const multiply: {
|
|
|
459
584
|
* )
|
|
460
585
|
* ```
|
|
461
586
|
*
|
|
587
|
+
* @see {@link multiplyAll} for multiplying an iterable of `BigDecimal` values
|
|
588
|
+
*
|
|
462
589
|
* @category math
|
|
463
590
|
* @since 2.0.0
|
|
464
591
|
*/
|
|
@@ -474,6 +601,10 @@ export const multiply: {
|
|
|
474
601
|
/**
|
|
475
602
|
* Takes an `Iterable` of `BigDecimal`s and returns their multiplication as a single `BigDecimal`.
|
|
476
603
|
*
|
|
604
|
+
* **When to use**
|
|
605
|
+
*
|
|
606
|
+
* Use to multiply all `BigDecimal` values in an iterable.
|
|
607
|
+
*
|
|
477
608
|
* **Example** (Multiplying multiple decimals)
|
|
478
609
|
*
|
|
479
610
|
* ```ts
|
|
@@ -486,6 +617,8 @@ export const multiply: {
|
|
|
486
617
|
* )
|
|
487
618
|
* ```
|
|
488
619
|
*
|
|
620
|
+
* @see {@link multiply} for multiplying two `BigDecimal` values
|
|
621
|
+
*
|
|
489
622
|
* @category math
|
|
490
623
|
* @since 4.0.0
|
|
491
624
|
*/
|
|
@@ -503,6 +636,10 @@ export const multiplyAll = (collection: Iterable<BigDecimal>): BigDecimal => {
|
|
|
503
636
|
/**
|
|
504
637
|
* Provides a subtraction operation on `BigDecimal`s.
|
|
505
638
|
*
|
|
639
|
+
* **When to use**
|
|
640
|
+
*
|
|
641
|
+
* Use to subtract one `BigDecimal` value from another.
|
|
642
|
+
*
|
|
506
643
|
* **Example** (Subtracting decimals)
|
|
507
644
|
*
|
|
508
645
|
* ```ts
|
|
@@ -522,6 +659,10 @@ export const subtract: {
|
|
|
522
659
|
/**
|
|
523
660
|
* Provides a subtraction operation on `BigDecimal`s.
|
|
524
661
|
*
|
|
662
|
+
* **When to use**
|
|
663
|
+
*
|
|
664
|
+
* Use to subtract one `BigDecimal` value from another.
|
|
665
|
+
*
|
|
525
666
|
* **Example** (Subtracting decimals)
|
|
526
667
|
*
|
|
527
668
|
* ```ts
|
|
@@ -541,6 +682,10 @@ export const subtract: {
|
|
|
541
682
|
/**
|
|
542
683
|
* Provides a subtraction operation on `BigDecimal`s.
|
|
543
684
|
*
|
|
685
|
+
* **When to use**
|
|
686
|
+
*
|
|
687
|
+
* Use to subtract one `BigDecimal` value from another.
|
|
688
|
+
*
|
|
544
689
|
* **Example** (Subtracting decimals)
|
|
545
690
|
*
|
|
546
691
|
* ```ts
|
|
@@ -648,6 +793,11 @@ export const roundTerminal = (n: bigint): bigint => {
|
|
|
648
793
|
/**
|
|
649
794
|
* Provides a division operation on `BigDecimal`s.
|
|
650
795
|
*
|
|
796
|
+
* **When to use**
|
|
797
|
+
*
|
|
798
|
+
* Use to divide `BigDecimal` values while representing division by zero as
|
|
799
|
+
* `Option.none`.
|
|
800
|
+
*
|
|
651
801
|
* **Details**
|
|
652
802
|
*
|
|
653
803
|
* If the dividend is not a multiple of the divisor, the result will be a `BigDecimal` value
|
|
@@ -685,6 +835,9 @@ export const roundTerminal = (n: bigint): bigint => {
|
|
|
685
835
|
* ) // true
|
|
686
836
|
* ```
|
|
687
837
|
*
|
|
838
|
+
* @see {@link divideUnsafe} for division that throws when the divisor is zero
|
|
839
|
+
* @see {@link remainder} for the decimal remainder operation
|
|
840
|
+
*
|
|
688
841
|
* @category math
|
|
689
842
|
* @since 2.0.0
|
|
690
843
|
*/
|
|
@@ -692,6 +845,11 @@ export const divide: {
|
|
|
692
845
|
/**
|
|
693
846
|
* Provides a division operation on `BigDecimal`s.
|
|
694
847
|
*
|
|
848
|
+
* **When to use**
|
|
849
|
+
*
|
|
850
|
+
* Use to divide `BigDecimal` values while representing division by zero as
|
|
851
|
+
* `Option.none`.
|
|
852
|
+
*
|
|
695
853
|
* **Details**
|
|
696
854
|
*
|
|
697
855
|
* If the dividend is not a multiple of the divisor, the result will be a `BigDecimal` value
|
|
@@ -729,6 +887,9 @@ export const divide: {
|
|
|
729
887
|
* ) // true
|
|
730
888
|
* ```
|
|
731
889
|
*
|
|
890
|
+
* @see {@link divideUnsafe} for division that throws when the divisor is zero
|
|
891
|
+
* @see {@link remainder} for the decimal remainder operation
|
|
892
|
+
*
|
|
732
893
|
* @category math
|
|
733
894
|
* @since 2.0.0
|
|
734
895
|
*/
|
|
@@ -736,6 +897,11 @@ export const divide: {
|
|
|
736
897
|
/**
|
|
737
898
|
* Provides a division operation on `BigDecimal`s.
|
|
738
899
|
*
|
|
900
|
+
* **When to use**
|
|
901
|
+
*
|
|
902
|
+
* Use to divide `BigDecimal` values while representing division by zero as
|
|
903
|
+
* `Option.none`.
|
|
904
|
+
*
|
|
739
905
|
* **Details**
|
|
740
906
|
*
|
|
741
907
|
* If the dividend is not a multiple of the divisor, the result will be a `BigDecimal` value
|
|
@@ -773,6 +939,9 @@ export const divide: {
|
|
|
773
939
|
* ) // true
|
|
774
940
|
* ```
|
|
775
941
|
*
|
|
942
|
+
* @see {@link divideUnsafe} for division that throws when the divisor is zero
|
|
943
|
+
* @see {@link remainder} for the decimal remainder operation
|
|
944
|
+
*
|
|
776
945
|
* @category math
|
|
777
946
|
* @since 2.0.0
|
|
778
947
|
*/
|
|
@@ -797,6 +966,11 @@ export const divide: {
|
|
|
797
966
|
/**
|
|
798
967
|
* Provides an unsafe division operation on `BigDecimal`s.
|
|
799
968
|
*
|
|
969
|
+
* **When to use**
|
|
970
|
+
*
|
|
971
|
+
* Use when the divisor is known to be non-zero and division by zero should be a
|
|
972
|
+
* thrown exception.
|
|
973
|
+
*
|
|
800
974
|
* **Details**
|
|
801
975
|
*
|
|
802
976
|
* If the dividend is not a multiple of the divisor, the result will be a `BigDecimal` value
|
|
@@ -815,6 +989,8 @@ export const divide: {
|
|
|
815
989
|
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
816
990
|
* ```
|
|
817
991
|
*
|
|
992
|
+
* @see {@link divide} for division that returns `Option.none` when the divisor is zero
|
|
993
|
+
*
|
|
818
994
|
* @category math
|
|
819
995
|
* @since 4.0.0
|
|
820
996
|
*/
|
|
@@ -822,6 +998,11 @@ export const divideUnsafe: {
|
|
|
822
998
|
/**
|
|
823
999
|
* Provides an unsafe division operation on `BigDecimal`s.
|
|
824
1000
|
*
|
|
1001
|
+
* **When to use**
|
|
1002
|
+
*
|
|
1003
|
+
* Use when the divisor is known to be non-zero and division by zero should be a
|
|
1004
|
+
* thrown exception.
|
|
1005
|
+
*
|
|
825
1006
|
* **Details**
|
|
826
1007
|
*
|
|
827
1008
|
* If the dividend is not a multiple of the divisor, the result will be a `BigDecimal` value
|
|
@@ -840,6 +1021,8 @@ export const divideUnsafe: {
|
|
|
840
1021
|
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
841
1022
|
* ```
|
|
842
1023
|
*
|
|
1024
|
+
* @see {@link divide} for division that returns `Option.none` when the divisor is zero
|
|
1025
|
+
*
|
|
843
1026
|
* @category math
|
|
844
1027
|
* @since 4.0.0
|
|
845
1028
|
*/
|
|
@@ -847,6 +1030,11 @@ export const divideUnsafe: {
|
|
|
847
1030
|
/**
|
|
848
1031
|
* Provides an unsafe division operation on `BigDecimal`s.
|
|
849
1032
|
*
|
|
1033
|
+
* **When to use**
|
|
1034
|
+
*
|
|
1035
|
+
* Use when the divisor is known to be non-zero and division by zero should be a
|
|
1036
|
+
* thrown exception.
|
|
1037
|
+
*
|
|
850
1038
|
* **Details**
|
|
851
1039
|
*
|
|
852
1040
|
* If the dividend is not a multiple of the divisor, the result will be a `BigDecimal` value
|
|
@@ -865,6 +1053,8 @@ export const divideUnsafe: {
|
|
|
865
1053
|
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
866
1054
|
* ```
|
|
867
1055
|
*
|
|
1056
|
+
* @see {@link divide} for division that returns `Option.none` when the divisor is zero
|
|
1057
|
+
*
|
|
868
1058
|
* @category math
|
|
869
1059
|
* @since 4.0.0
|
|
870
1060
|
*/
|
|
@@ -888,6 +1078,10 @@ export const divideUnsafe: {
|
|
|
888
1078
|
/**
|
|
889
1079
|
* Provides an `Order` instance for `BigDecimal` that allows comparing and sorting BigDecimal values.
|
|
890
1080
|
*
|
|
1081
|
+
* **When to use**
|
|
1082
|
+
*
|
|
1083
|
+
* Use when an API needs an `Order` instance for `BigDecimal` values.
|
|
1084
|
+
*
|
|
891
1085
|
* **Example** (Comparing decimals)
|
|
892
1086
|
*
|
|
893
1087
|
* ```ts
|
|
@@ -925,6 +1119,10 @@ export const Order: order.Order<BigDecimal> = order.make((self, that) => {
|
|
|
925
1119
|
/**
|
|
926
1120
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
927
1121
|
*
|
|
1122
|
+
* **When to use**
|
|
1123
|
+
*
|
|
1124
|
+
* Use to test whether one `BigDecimal` is strictly less than another.
|
|
1125
|
+
*
|
|
928
1126
|
* **Example** (Checking less-than comparisons)
|
|
929
1127
|
*
|
|
930
1128
|
* ```ts
|
|
@@ -952,6 +1150,10 @@ export const isLessThan: {
|
|
|
952
1150
|
/**
|
|
953
1151
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
954
1152
|
*
|
|
1153
|
+
* **When to use**
|
|
1154
|
+
*
|
|
1155
|
+
* Use to test whether one `BigDecimal` is strictly less than another.
|
|
1156
|
+
*
|
|
955
1157
|
* **Example** (Checking less-than comparisons)
|
|
956
1158
|
*
|
|
957
1159
|
* ```ts
|
|
@@ -979,6 +1181,10 @@ export const isLessThan: {
|
|
|
979
1181
|
/**
|
|
980
1182
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
981
1183
|
*
|
|
1184
|
+
* **When to use**
|
|
1185
|
+
*
|
|
1186
|
+
* Use to test whether one `BigDecimal` is strictly less than another.
|
|
1187
|
+
*
|
|
982
1188
|
* **Example** (Checking less-than comparisons)
|
|
983
1189
|
*
|
|
984
1190
|
* ```ts
|
|
@@ -1008,6 +1214,10 @@ export const isLessThan: {
|
|
|
1008
1214
|
/**
|
|
1009
1215
|
* Checks if a given `BigDecimal` is less than or equal to the provided one.
|
|
1010
1216
|
*
|
|
1217
|
+
* **When to use**
|
|
1218
|
+
*
|
|
1219
|
+
* Use to test whether one `BigDecimal` is less than or equal to another.
|
|
1220
|
+
*
|
|
1011
1221
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1012
1222
|
*
|
|
1013
1223
|
* ```ts
|
|
@@ -1035,6 +1245,10 @@ export const isLessThanOrEqualTo: {
|
|
|
1035
1245
|
/**
|
|
1036
1246
|
* Checks if a given `BigDecimal` is less than or equal to the provided one.
|
|
1037
1247
|
*
|
|
1248
|
+
* **When to use**
|
|
1249
|
+
*
|
|
1250
|
+
* Use to test whether one `BigDecimal` is less than or equal to another.
|
|
1251
|
+
*
|
|
1038
1252
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1039
1253
|
*
|
|
1040
1254
|
* ```ts
|
|
@@ -1062,6 +1276,10 @@ export const isLessThanOrEqualTo: {
|
|
|
1062
1276
|
/**
|
|
1063
1277
|
* Checks if a given `BigDecimal` is less than or equal to the provided one.
|
|
1064
1278
|
*
|
|
1279
|
+
* **When to use**
|
|
1280
|
+
*
|
|
1281
|
+
* Use to test whether one `BigDecimal` is less than or equal to another.
|
|
1282
|
+
*
|
|
1065
1283
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1066
1284
|
*
|
|
1067
1285
|
* ```ts
|
|
@@ -1091,6 +1309,10 @@ export const isLessThanOrEqualTo: {
|
|
|
1091
1309
|
/**
|
|
1092
1310
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
1093
1311
|
*
|
|
1312
|
+
* **When to use**
|
|
1313
|
+
*
|
|
1314
|
+
* Use to test whether one `BigDecimal` is strictly greater than another.
|
|
1315
|
+
*
|
|
1094
1316
|
* **Example** (Checking greater-than comparisons)
|
|
1095
1317
|
*
|
|
1096
1318
|
* ```ts
|
|
@@ -1118,6 +1340,10 @@ export const isGreaterThan: {
|
|
|
1118
1340
|
/**
|
|
1119
1341
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
1120
1342
|
*
|
|
1343
|
+
* **When to use**
|
|
1344
|
+
*
|
|
1345
|
+
* Use to test whether one `BigDecimal` is strictly greater than another.
|
|
1346
|
+
*
|
|
1121
1347
|
* **Example** (Checking greater-than comparisons)
|
|
1122
1348
|
*
|
|
1123
1349
|
* ```ts
|
|
@@ -1145,6 +1371,10 @@ export const isGreaterThan: {
|
|
|
1145
1371
|
/**
|
|
1146
1372
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
1147
1373
|
*
|
|
1374
|
+
* **When to use**
|
|
1375
|
+
*
|
|
1376
|
+
* Use to test whether one `BigDecimal` is strictly greater than another.
|
|
1377
|
+
*
|
|
1148
1378
|
* **Example** (Checking greater-than comparisons)
|
|
1149
1379
|
*
|
|
1150
1380
|
* ```ts
|
|
@@ -1174,6 +1404,10 @@ export const isGreaterThan: {
|
|
|
1174
1404
|
/**
|
|
1175
1405
|
* Checks if a given `BigDecimal` is greater than or equal to the provided one.
|
|
1176
1406
|
*
|
|
1407
|
+
* **When to use**
|
|
1408
|
+
*
|
|
1409
|
+
* Use to test whether one `BigDecimal` is greater than or equal to another.
|
|
1410
|
+
*
|
|
1177
1411
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1178
1412
|
*
|
|
1179
1413
|
* ```ts
|
|
@@ -1201,6 +1435,10 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1201
1435
|
/**
|
|
1202
1436
|
* Checks if a given `BigDecimal` is greater than or equal to the provided one.
|
|
1203
1437
|
*
|
|
1438
|
+
* **When to use**
|
|
1439
|
+
*
|
|
1440
|
+
* Use to test whether one `BigDecimal` is greater than or equal to another.
|
|
1441
|
+
*
|
|
1204
1442
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1205
1443
|
*
|
|
1206
1444
|
* ```ts
|
|
@@ -1228,6 +1466,10 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1228
1466
|
/**
|
|
1229
1467
|
* Checks if a given `BigDecimal` is greater than or equal to the provided one.
|
|
1230
1468
|
*
|
|
1469
|
+
* **When to use**
|
|
1470
|
+
*
|
|
1471
|
+
* Use to test whether one `BigDecimal` is greater than or equal to another.
|
|
1472
|
+
*
|
|
1231
1473
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1232
1474
|
*
|
|
1233
1475
|
* ```ts
|
|
@@ -1257,6 +1499,10 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1257
1499
|
/**
|
|
1258
1500
|
* Checks if a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
|
|
1259
1501
|
*
|
|
1502
|
+
* **When to use**
|
|
1503
|
+
*
|
|
1504
|
+
* Use to test whether a `BigDecimal` falls inside an inclusive range.
|
|
1505
|
+
*
|
|
1260
1506
|
* **Example** (Checking decimal ranges)
|
|
1261
1507
|
*
|
|
1262
1508
|
* ```ts
|
|
@@ -1273,6 +1519,8 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1273
1519
|
* assert.deepStrictEqual(between(BigDecimal.fromStringUnsafe("6")), false)
|
|
1274
1520
|
* ```
|
|
1275
1521
|
*
|
|
1522
|
+
* @see {@link clamp} for forcing a `BigDecimal` into an inclusive range
|
|
1523
|
+
*
|
|
1276
1524
|
* @category predicates
|
|
1277
1525
|
* @since 2.0.0
|
|
1278
1526
|
*/
|
|
@@ -1280,6 +1528,10 @@ export const between: {
|
|
|
1280
1528
|
/**
|
|
1281
1529
|
* Checks if a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
|
|
1282
1530
|
*
|
|
1531
|
+
* **When to use**
|
|
1532
|
+
*
|
|
1533
|
+
* Use to test whether a `BigDecimal` falls inside an inclusive range.
|
|
1534
|
+
*
|
|
1283
1535
|
* **Example** (Checking decimal ranges)
|
|
1284
1536
|
*
|
|
1285
1537
|
* ```ts
|
|
@@ -1296,6 +1548,8 @@ export const between: {
|
|
|
1296
1548
|
* assert.deepStrictEqual(between(BigDecimal.fromStringUnsafe("6")), false)
|
|
1297
1549
|
* ```
|
|
1298
1550
|
*
|
|
1551
|
+
* @see {@link clamp} for forcing a `BigDecimal` into an inclusive range
|
|
1552
|
+
*
|
|
1299
1553
|
* @category predicates
|
|
1300
1554
|
* @since 2.0.0
|
|
1301
1555
|
*/
|
|
@@ -1308,6 +1562,10 @@ export const between: {
|
|
|
1308
1562
|
/**
|
|
1309
1563
|
* Checks if a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
|
|
1310
1564
|
*
|
|
1565
|
+
* **When to use**
|
|
1566
|
+
*
|
|
1567
|
+
* Use to test whether a `BigDecimal` falls inside an inclusive range.
|
|
1568
|
+
*
|
|
1311
1569
|
* **Example** (Checking decimal ranges)
|
|
1312
1570
|
*
|
|
1313
1571
|
* ```ts
|
|
@@ -1324,6 +1582,8 @@ export const between: {
|
|
|
1324
1582
|
* assert.deepStrictEqual(between(BigDecimal.fromStringUnsafe("6")), false)
|
|
1325
1583
|
* ```
|
|
1326
1584
|
*
|
|
1585
|
+
* @see {@link clamp} for forcing a `BigDecimal` into an inclusive range
|
|
1586
|
+
*
|
|
1327
1587
|
* @category predicates
|
|
1328
1588
|
* @since 2.0.0
|
|
1329
1589
|
*/
|
|
@@ -1339,6 +1599,10 @@ export const between: {
|
|
|
1339
1599
|
/**
|
|
1340
1600
|
* Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
|
|
1341
1601
|
*
|
|
1602
|
+
* **When to use**
|
|
1603
|
+
*
|
|
1604
|
+
* Use to force a `BigDecimal` into an inclusive range.
|
|
1605
|
+
*
|
|
1342
1606
|
* **Details**
|
|
1343
1607
|
*
|
|
1344
1608
|
* If the `BigDecimal` is less than the `minimum` value, the function returns
|
|
@@ -1370,6 +1634,8 @@ export const between: {
|
|
|
1370
1634
|
* )
|
|
1371
1635
|
* ```
|
|
1372
1636
|
*
|
|
1637
|
+
* @see {@link between} for checking whether a `BigDecimal` is already inside a range
|
|
1638
|
+
*
|
|
1373
1639
|
* @category math
|
|
1374
1640
|
* @since 2.0.0
|
|
1375
1641
|
*/
|
|
@@ -1377,6 +1643,10 @@ export const clamp: {
|
|
|
1377
1643
|
/**
|
|
1378
1644
|
* Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
|
|
1379
1645
|
*
|
|
1646
|
+
* **When to use**
|
|
1647
|
+
*
|
|
1648
|
+
* Use to force a `BigDecimal` into an inclusive range.
|
|
1649
|
+
*
|
|
1380
1650
|
* **Details**
|
|
1381
1651
|
*
|
|
1382
1652
|
* If the `BigDecimal` is less than the `minimum` value, the function returns
|
|
@@ -1408,6 +1678,8 @@ export const clamp: {
|
|
|
1408
1678
|
* )
|
|
1409
1679
|
* ```
|
|
1410
1680
|
*
|
|
1681
|
+
* @see {@link between} for checking whether a `BigDecimal` is already inside a range
|
|
1682
|
+
*
|
|
1411
1683
|
* @category math
|
|
1412
1684
|
* @since 2.0.0
|
|
1413
1685
|
*/
|
|
@@ -1420,6 +1692,10 @@ export const clamp: {
|
|
|
1420
1692
|
/**
|
|
1421
1693
|
* Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
|
|
1422
1694
|
*
|
|
1695
|
+
* **When to use**
|
|
1696
|
+
*
|
|
1697
|
+
* Use to force a `BigDecimal` into an inclusive range.
|
|
1698
|
+
*
|
|
1423
1699
|
* **Details**
|
|
1424
1700
|
*
|
|
1425
1701
|
* If the `BigDecimal` is less than the `minimum` value, the function returns
|
|
@@ -1451,6 +1727,8 @@ export const clamp: {
|
|
|
1451
1727
|
* )
|
|
1452
1728
|
* ```
|
|
1453
1729
|
*
|
|
1730
|
+
* @see {@link between} for checking whether a `BigDecimal` is already inside a range
|
|
1731
|
+
*
|
|
1454
1732
|
* @category math
|
|
1455
1733
|
* @since 2.0.0
|
|
1456
1734
|
*/
|
|
@@ -1466,6 +1744,10 @@ export const clamp: {
|
|
|
1466
1744
|
/**
|
|
1467
1745
|
* Returns the minimum between two `BigDecimal`s.
|
|
1468
1746
|
*
|
|
1747
|
+
* **When to use**
|
|
1748
|
+
*
|
|
1749
|
+
* Use to select the smaller of two `BigDecimal` values.
|
|
1750
|
+
*
|
|
1469
1751
|
* **Example** (Selecting the smaller decimal)
|
|
1470
1752
|
*
|
|
1471
1753
|
* ```ts
|
|
@@ -1478,6 +1760,8 @@ export const clamp: {
|
|
|
1478
1760
|
* )
|
|
1479
1761
|
* ```
|
|
1480
1762
|
*
|
|
1763
|
+
* @see {@link max} for selecting the larger value
|
|
1764
|
+
*
|
|
1481
1765
|
* @category math
|
|
1482
1766
|
* @since 2.0.0
|
|
1483
1767
|
*/
|
|
@@ -1485,6 +1769,10 @@ export const min: {
|
|
|
1485
1769
|
/**
|
|
1486
1770
|
* Returns the minimum between two `BigDecimal`s.
|
|
1487
1771
|
*
|
|
1772
|
+
* **When to use**
|
|
1773
|
+
*
|
|
1774
|
+
* Use to select the smaller of two `BigDecimal` values.
|
|
1775
|
+
*
|
|
1488
1776
|
* **Example** (Selecting the smaller decimal)
|
|
1489
1777
|
*
|
|
1490
1778
|
* ```ts
|
|
@@ -1497,6 +1785,8 @@ export const min: {
|
|
|
1497
1785
|
* )
|
|
1498
1786
|
* ```
|
|
1499
1787
|
*
|
|
1788
|
+
* @see {@link max} for selecting the larger value
|
|
1789
|
+
*
|
|
1500
1790
|
* @category math
|
|
1501
1791
|
* @since 2.0.0
|
|
1502
1792
|
*/
|
|
@@ -1504,6 +1794,10 @@ export const min: {
|
|
|
1504
1794
|
/**
|
|
1505
1795
|
* Returns the minimum between two `BigDecimal`s.
|
|
1506
1796
|
*
|
|
1797
|
+
* **When to use**
|
|
1798
|
+
*
|
|
1799
|
+
* Use to select the smaller of two `BigDecimal` values.
|
|
1800
|
+
*
|
|
1507
1801
|
* **Example** (Selecting the smaller decimal)
|
|
1508
1802
|
*
|
|
1509
1803
|
* ```ts
|
|
@@ -1516,6 +1810,8 @@ export const min: {
|
|
|
1516
1810
|
* )
|
|
1517
1811
|
* ```
|
|
1518
1812
|
*
|
|
1813
|
+
* @see {@link max} for selecting the larger value
|
|
1814
|
+
*
|
|
1519
1815
|
* @category math
|
|
1520
1816
|
* @since 2.0.0
|
|
1521
1817
|
*/
|
|
@@ -1525,6 +1821,10 @@ export const min: {
|
|
|
1525
1821
|
/**
|
|
1526
1822
|
* Returns the maximum between two `BigDecimal`s.
|
|
1527
1823
|
*
|
|
1824
|
+
* **When to use**
|
|
1825
|
+
*
|
|
1826
|
+
* Use to select the larger of two `BigDecimal` values.
|
|
1827
|
+
*
|
|
1528
1828
|
* **Example** (Selecting the larger decimal)
|
|
1529
1829
|
*
|
|
1530
1830
|
* ```ts
|
|
@@ -1537,6 +1837,8 @@ export const min: {
|
|
|
1537
1837
|
* )
|
|
1538
1838
|
* ```
|
|
1539
1839
|
*
|
|
1840
|
+
* @see {@link min} for selecting the smaller value
|
|
1841
|
+
*
|
|
1540
1842
|
* @category math
|
|
1541
1843
|
* @since 2.0.0
|
|
1542
1844
|
*/
|
|
@@ -1544,6 +1846,10 @@ export const max: {
|
|
|
1544
1846
|
/**
|
|
1545
1847
|
* Returns the maximum between two `BigDecimal`s.
|
|
1546
1848
|
*
|
|
1849
|
+
* **When to use**
|
|
1850
|
+
*
|
|
1851
|
+
* Use to select the larger of two `BigDecimal` values.
|
|
1852
|
+
*
|
|
1547
1853
|
* **Example** (Selecting the larger decimal)
|
|
1548
1854
|
*
|
|
1549
1855
|
* ```ts
|
|
@@ -1556,6 +1862,8 @@ export const max: {
|
|
|
1556
1862
|
* )
|
|
1557
1863
|
* ```
|
|
1558
1864
|
*
|
|
1865
|
+
* @see {@link min} for selecting the smaller value
|
|
1866
|
+
*
|
|
1559
1867
|
* @category math
|
|
1560
1868
|
* @since 2.0.0
|
|
1561
1869
|
*/
|
|
@@ -1563,6 +1871,10 @@ export const max: {
|
|
|
1563
1871
|
/**
|
|
1564
1872
|
* Returns the maximum between two `BigDecimal`s.
|
|
1565
1873
|
*
|
|
1874
|
+
* **When to use**
|
|
1875
|
+
*
|
|
1876
|
+
* Use to select the larger of two `BigDecimal` values.
|
|
1877
|
+
*
|
|
1566
1878
|
* **Example** (Selecting the larger decimal)
|
|
1567
1879
|
*
|
|
1568
1880
|
* ```ts
|
|
@@ -1575,6 +1887,8 @@ export const max: {
|
|
|
1575
1887
|
* )
|
|
1576
1888
|
* ```
|
|
1577
1889
|
*
|
|
1890
|
+
* @see {@link min} for selecting the smaller value
|
|
1891
|
+
*
|
|
1578
1892
|
* @category math
|
|
1579
1893
|
* @since 2.0.0
|
|
1580
1894
|
*/
|
|
@@ -1584,6 +1898,10 @@ export const max: {
|
|
|
1584
1898
|
/**
|
|
1585
1899
|
* Determines the sign of a given `BigDecimal`.
|
|
1586
1900
|
*
|
|
1901
|
+
* **When to use**
|
|
1902
|
+
*
|
|
1903
|
+
* Use to classify a `BigDecimal` as negative, zero, or positive.
|
|
1904
|
+
*
|
|
1587
1905
|
* **Example** (Reading decimal signs)
|
|
1588
1906
|
*
|
|
1589
1907
|
* ```ts
|
|
@@ -1603,6 +1921,10 @@ export const sign = (n: BigDecimal): Ordering => n.value === bigint0 ? 0 : n.val
|
|
|
1603
1921
|
/**
|
|
1604
1922
|
* Determines the absolute value of a given `BigDecimal`.
|
|
1605
1923
|
*
|
|
1924
|
+
* **When to use**
|
|
1925
|
+
*
|
|
1926
|
+
* Use to remove the sign from a `BigDecimal` while preserving its magnitude.
|
|
1927
|
+
*
|
|
1606
1928
|
* **Example** (Calculating absolute values)
|
|
1607
1929
|
*
|
|
1608
1930
|
* ```ts
|
|
@@ -1622,6 +1944,10 @@ export const abs = (n: BigDecimal): BigDecimal => n.value < bigint0 ? make(-n.va
|
|
|
1622
1944
|
/**
|
|
1623
1945
|
* Provides a negate operation on `BigDecimal`s.
|
|
1624
1946
|
*
|
|
1947
|
+
* **When to use**
|
|
1948
|
+
*
|
|
1949
|
+
* Use to flip the sign of a `BigDecimal`.
|
|
1950
|
+
*
|
|
1625
1951
|
* **Example** (Negating decimals)
|
|
1626
1952
|
*
|
|
1627
1953
|
* ```ts
|
|
@@ -1640,6 +1966,11 @@ export const negate = (n: BigDecimal): BigDecimal => make(-n.value, n.scale)
|
|
|
1640
1966
|
/**
|
|
1641
1967
|
* Returns the remainder left over when one operand is divided by a second operand.
|
|
1642
1968
|
*
|
|
1969
|
+
* **When to use**
|
|
1970
|
+
*
|
|
1971
|
+
* Use to compute a decimal remainder while representing division by zero as
|
|
1972
|
+
* `Option.none`.
|
|
1973
|
+
*
|
|
1643
1974
|
* **Details**
|
|
1644
1975
|
*
|
|
1645
1976
|
* If the divisor is `0`, the result will be `Option.none()`.
|
|
@@ -1673,6 +2004,9 @@ export const negate = (n: BigDecimal): BigDecimal => make(-n.value, n.scale)
|
|
|
1673
2004
|
* )
|
|
1674
2005
|
* ```
|
|
1675
2006
|
*
|
|
2007
|
+
* @see {@link remainderUnsafe} for remainder calculation that throws when the divisor is zero
|
|
2008
|
+
* @see {@link divide} for decimal quotient calculation
|
|
2009
|
+
*
|
|
1676
2010
|
* @category math
|
|
1677
2011
|
* @since 2.0.0
|
|
1678
2012
|
*/
|
|
@@ -1680,6 +2014,11 @@ export const remainder: {
|
|
|
1680
2014
|
/**
|
|
1681
2015
|
* Returns the remainder left over when one operand is divided by a second operand.
|
|
1682
2016
|
*
|
|
2017
|
+
* **When to use**
|
|
2018
|
+
*
|
|
2019
|
+
* Use to compute a decimal remainder while representing division by zero as
|
|
2020
|
+
* `Option.none`.
|
|
2021
|
+
*
|
|
1683
2022
|
* **Details**
|
|
1684
2023
|
*
|
|
1685
2024
|
* If the divisor is `0`, the result will be `Option.none()`.
|
|
@@ -1713,6 +2052,9 @@ export const remainder: {
|
|
|
1713
2052
|
* )
|
|
1714
2053
|
* ```
|
|
1715
2054
|
*
|
|
2055
|
+
* @see {@link remainderUnsafe} for remainder calculation that throws when the divisor is zero
|
|
2056
|
+
* @see {@link divide} for decimal quotient calculation
|
|
2057
|
+
*
|
|
1716
2058
|
* @category math
|
|
1717
2059
|
* @since 2.0.0
|
|
1718
2060
|
*/
|
|
@@ -1720,6 +2062,11 @@ export const remainder: {
|
|
|
1720
2062
|
/**
|
|
1721
2063
|
* Returns the remainder left over when one operand is divided by a second operand.
|
|
1722
2064
|
*
|
|
2065
|
+
* **When to use**
|
|
2066
|
+
*
|
|
2067
|
+
* Use to compute a decimal remainder while representing division by zero as
|
|
2068
|
+
* `Option.none`.
|
|
2069
|
+
*
|
|
1723
2070
|
* **Details**
|
|
1724
2071
|
*
|
|
1725
2072
|
* If the divisor is `0`, the result will be `Option.none()`.
|
|
@@ -1753,6 +2100,9 @@ export const remainder: {
|
|
|
1753
2100
|
* )
|
|
1754
2101
|
* ```
|
|
1755
2102
|
*
|
|
2103
|
+
* @see {@link remainderUnsafe} for remainder calculation that throws when the divisor is zero
|
|
2104
|
+
* @see {@link divide} for decimal quotient calculation
|
|
2105
|
+
*
|
|
1756
2106
|
* @category math
|
|
1757
2107
|
* @since 2.0.0
|
|
1758
2108
|
*/
|
|
@@ -1769,6 +2119,11 @@ export const remainder: {
|
|
|
1769
2119
|
/**
|
|
1770
2120
|
* Returns the remainder left over when one operand is divided by a second operand.
|
|
1771
2121
|
*
|
|
2122
|
+
* **When to use**
|
|
2123
|
+
*
|
|
2124
|
+
* Use when the divisor is known to be non-zero and division by zero should be a
|
|
2125
|
+
* thrown exception.
|
|
2126
|
+
*
|
|
1772
2127
|
* **Gotchas**
|
|
1773
2128
|
*
|
|
1774
2129
|
* Throws a `RangeError` if the divisor is `0`.
|
|
@@ -1793,6 +2148,8 @@ export const remainder: {
|
|
|
1793
2148
|
* )
|
|
1794
2149
|
* ```
|
|
1795
2150
|
*
|
|
2151
|
+
* @see {@link remainder} for returning `Option.none` when the divisor is zero
|
|
2152
|
+
*
|
|
1796
2153
|
* @category math
|
|
1797
2154
|
* @since 4.0.0
|
|
1798
2155
|
*/
|
|
@@ -1800,6 +2157,11 @@ export const remainderUnsafe: {
|
|
|
1800
2157
|
/**
|
|
1801
2158
|
* Returns the remainder left over when one operand is divided by a second operand.
|
|
1802
2159
|
*
|
|
2160
|
+
* **When to use**
|
|
2161
|
+
*
|
|
2162
|
+
* Use when the divisor is known to be non-zero and division by zero should be a
|
|
2163
|
+
* thrown exception.
|
|
2164
|
+
*
|
|
1803
2165
|
* **Gotchas**
|
|
1804
2166
|
*
|
|
1805
2167
|
* Throws a `RangeError` if the divisor is `0`.
|
|
@@ -1824,6 +2186,8 @@ export const remainderUnsafe: {
|
|
|
1824
2186
|
* )
|
|
1825
2187
|
* ```
|
|
1826
2188
|
*
|
|
2189
|
+
* @see {@link remainder} for returning `Option.none` when the divisor is zero
|
|
2190
|
+
*
|
|
1827
2191
|
* @category math
|
|
1828
2192
|
* @since 4.0.0
|
|
1829
2193
|
*/
|
|
@@ -1831,6 +2195,11 @@ export const remainderUnsafe: {
|
|
|
1831
2195
|
/**
|
|
1832
2196
|
* Returns the remainder left over when one operand is divided by a second operand.
|
|
1833
2197
|
*
|
|
2198
|
+
* **When to use**
|
|
2199
|
+
*
|
|
2200
|
+
* Use when the divisor is known to be non-zero and division by zero should be a
|
|
2201
|
+
* thrown exception.
|
|
2202
|
+
*
|
|
1834
2203
|
* **Gotchas**
|
|
1835
2204
|
*
|
|
1836
2205
|
* Throws a `RangeError` if the divisor is `0`.
|
|
@@ -1855,6 +2224,8 @@ export const remainderUnsafe: {
|
|
|
1855
2224
|
* )
|
|
1856
2225
|
* ```
|
|
1857
2226
|
*
|
|
2227
|
+
* @see {@link remainder} for returning `Option.none` when the divisor is zero
|
|
2228
|
+
*
|
|
1858
2229
|
* @category math
|
|
1859
2230
|
* @since 4.0.0
|
|
1860
2231
|
*/
|
|
@@ -1871,6 +2242,10 @@ export const remainderUnsafe: {
|
|
|
1871
2242
|
/**
|
|
1872
2243
|
* Provides an `Equivalence` instance for `BigDecimal` that determines equality between BigDecimal values.
|
|
1873
2244
|
*
|
|
2245
|
+
* **When to use**
|
|
2246
|
+
*
|
|
2247
|
+
* Use when an API needs an `Equivalence` instance for decimal equality.
|
|
2248
|
+
*
|
|
1874
2249
|
* **Example** (Checking decimal equivalence)
|
|
1875
2250
|
*
|
|
1876
2251
|
* ```ts
|
|
@@ -1902,6 +2277,10 @@ export const Equivalence: Equ.Equivalence<BigDecimal> = Equ.make((self, that) =>
|
|
|
1902
2277
|
/**
|
|
1903
2278
|
* Checks if two `BigDecimal`s are equal.
|
|
1904
2279
|
*
|
|
2280
|
+
* **When to use**
|
|
2281
|
+
*
|
|
2282
|
+
* Use to compare two `BigDecimal` values for numeric equality.
|
|
2283
|
+
*
|
|
1905
2284
|
* **Example** (Checking decimal equality)
|
|
1906
2285
|
*
|
|
1907
2286
|
* ```ts
|
|
@@ -1915,6 +2294,8 @@ export const Equivalence: Equ.Equivalence<BigDecimal> = Equ.make((self, that) =>
|
|
|
1915
2294
|
* console.log(BigDecimal.equals(a, c)) // false
|
|
1916
2295
|
* ```
|
|
1917
2296
|
*
|
|
2297
|
+
* @see {@link Equivalence} for passing decimal equality to APIs that require an `Equivalence`
|
|
2298
|
+
*
|
|
1918
2299
|
* @category predicates
|
|
1919
2300
|
* @since 2.0.0
|
|
1920
2301
|
*/
|
|
@@ -1922,6 +2303,10 @@ export const equals: {
|
|
|
1922
2303
|
/**
|
|
1923
2304
|
* Checks if two `BigDecimal`s are equal.
|
|
1924
2305
|
*
|
|
2306
|
+
* **When to use**
|
|
2307
|
+
*
|
|
2308
|
+
* Use to compare two `BigDecimal` values for numeric equality.
|
|
2309
|
+
*
|
|
1925
2310
|
* **Example** (Checking decimal equality)
|
|
1926
2311
|
*
|
|
1927
2312
|
* ```ts
|
|
@@ -1935,6 +2320,8 @@ export const equals: {
|
|
|
1935
2320
|
* console.log(BigDecimal.equals(a, c)) // false
|
|
1936
2321
|
* ```
|
|
1937
2322
|
*
|
|
2323
|
+
* @see {@link Equivalence} for passing decimal equality to APIs that require an `Equivalence`
|
|
2324
|
+
*
|
|
1938
2325
|
* @category predicates
|
|
1939
2326
|
* @since 2.0.0
|
|
1940
2327
|
*/
|
|
@@ -1942,6 +2329,10 @@ export const equals: {
|
|
|
1942
2329
|
/**
|
|
1943
2330
|
* Checks if two `BigDecimal`s are equal.
|
|
1944
2331
|
*
|
|
2332
|
+
* **When to use**
|
|
2333
|
+
*
|
|
2334
|
+
* Use to compare two `BigDecimal` values for numeric equality.
|
|
2335
|
+
*
|
|
1945
2336
|
* **Example** (Checking decimal equality)
|
|
1946
2337
|
*
|
|
1947
2338
|
* ```ts
|
|
@@ -1955,6 +2346,8 @@ export const equals: {
|
|
|
1955
2346
|
* console.log(BigDecimal.equals(a, c)) // false
|
|
1956
2347
|
* ```
|
|
1957
2348
|
*
|
|
2349
|
+
* @see {@link Equivalence} for passing decimal equality to APIs that require an `Equivalence`
|
|
2350
|
+
*
|
|
1958
2351
|
* @category predicates
|
|
1959
2352
|
* @since 2.0.0
|
|
1960
2353
|
*/
|
|
@@ -1964,6 +2357,10 @@ export const equals: {
|
|
|
1964
2357
|
/**
|
|
1965
2358
|
* Creates a `BigDecimal` from a `bigint` value.
|
|
1966
2359
|
*
|
|
2360
|
+
* **When to use**
|
|
2361
|
+
*
|
|
2362
|
+
* Use to construct an integer `BigDecimal` from a `bigint`.
|
|
2363
|
+
*
|
|
1967
2364
|
* **Example** (Creating decimals from bigint)
|
|
1968
2365
|
*
|
|
1969
2366
|
* ```ts
|
|
@@ -1976,6 +2373,8 @@ export const equals: {
|
|
|
1976
2373
|
* console.log(BigDecimal.format(largeBigInt)) // "9007199254740991"
|
|
1977
2374
|
* ```
|
|
1978
2375
|
*
|
|
2376
|
+
* @see {@link make} for constructing a decimal with an explicit scale
|
|
2377
|
+
*
|
|
1979
2378
|
* @category constructors
|
|
1980
2379
|
* @since 2.0.0
|
|
1981
2380
|
*/
|
|
@@ -1984,6 +2383,11 @@ export const fromBigInt = (n: bigint): BigDecimal => make(n, 0)
|
|
|
1984
2383
|
/**
|
|
1985
2384
|
* Creates a `BigDecimal` from a `number` value.
|
|
1986
2385
|
*
|
|
2386
|
+
* **When to use**
|
|
2387
|
+
*
|
|
2388
|
+
* Use when a finite JavaScript number must become a `BigDecimal` and invalid
|
|
2389
|
+
* input should throw.
|
|
2390
|
+
*
|
|
1987
2391
|
* **Gotchas**
|
|
1988
2392
|
*
|
|
1989
2393
|
* It is not recommended to convert a floating point number to a decimal
|
|
@@ -2000,6 +2404,8 @@ export const fromBigInt = (n: bigint): BigDecimal => make(n, 0)
|
|
|
2000
2404
|
* assert.deepStrictEqual(BigDecimal.fromNumberUnsafe(123.456), BigDecimal.make(123456n, 3))
|
|
2001
2405
|
* ```
|
|
2002
2406
|
*
|
|
2407
|
+
* @see {@link fromNumber} for returning `Option.none` when the number is not finite
|
|
2408
|
+
*
|
|
2003
2409
|
* @category constructors
|
|
2004
2410
|
* @since 4.0.0
|
|
2005
2411
|
*/
|
|
@@ -2010,6 +2416,11 @@ export const fromNumberUnsafe = (n: number): BigDecimal => {
|
|
|
2010
2416
|
/**
|
|
2011
2417
|
* Creates a `BigDecimal` from a `number` value.
|
|
2012
2418
|
*
|
|
2419
|
+
* **When to use**
|
|
2420
|
+
*
|
|
2421
|
+
* Use to convert a finite JavaScript number to a `BigDecimal` without throwing
|
|
2422
|
+
* on invalid input.
|
|
2423
|
+
*
|
|
2013
2424
|
* **Details**
|
|
2014
2425
|
*
|
|
2015
2426
|
* Returns `Option.none()` for `NaN`, `+Infinity` or `-Infinity`.
|
|
@@ -2033,6 +2444,9 @@ export const fromNumberUnsafe = (n: number): BigDecimal => {
|
|
|
2033
2444
|
* assert.deepStrictEqual(BigDecimal.fromNumber(Infinity), Option.none())
|
|
2034
2445
|
* ```
|
|
2035
2446
|
*
|
|
2447
|
+
* @see {@link fromNumberUnsafe} for throwing when the number is not finite
|
|
2448
|
+
* @see {@link fromString} for parsing decimal strings directly
|
|
2449
|
+
*
|
|
2036
2450
|
* @category constructors
|
|
2037
2451
|
* @since 2.0.0
|
|
2038
2452
|
*/
|
|
@@ -2053,6 +2467,10 @@ export const fromNumber = (n: number): Option.Option<BigDecimal> => {
|
|
|
2053
2467
|
/**
|
|
2054
2468
|
* Safely parses a decimal string into a `BigDecimal`.
|
|
2055
2469
|
*
|
|
2470
|
+
* **When to use**
|
|
2471
|
+
*
|
|
2472
|
+
* Use to parse external decimal text without throwing on invalid input.
|
|
2473
|
+
*
|
|
2056
2474
|
* **Details**
|
|
2057
2475
|
*
|
|
2058
2476
|
* Returns `Option.some` for valid decimal or exponent notation and
|
|
@@ -2073,6 +2491,9 @@ export const fromNumber = (n: number): Option.Option<BigDecimal> => {
|
|
|
2073
2491
|
* assert.deepStrictEqual(BigDecimal.fromString("123.abc"), Option.none())
|
|
2074
2492
|
* ```
|
|
2075
2493
|
*
|
|
2494
|
+
* @see {@link fromStringUnsafe} for parsing that throws on invalid input
|
|
2495
|
+
* @see {@link fromNumber} for converting finite JavaScript numbers
|
|
2496
|
+
*
|
|
2076
2497
|
* @category constructors
|
|
2077
2498
|
* @since 2.0.0
|
|
2078
2499
|
*/
|
|
@@ -2125,6 +2546,10 @@ export const fromString = (s: string): Option.Option<BigDecimal> => {
|
|
|
2125
2546
|
* Parses a decimal string into a `BigDecimal`, throwing if the string is
|
|
2126
2547
|
* invalid.
|
|
2127
2548
|
*
|
|
2549
|
+
* **When to use**
|
|
2550
|
+
*
|
|
2551
|
+
* Use when decimal text is expected to be valid and parse errors should throw.
|
|
2552
|
+
*
|
|
2128
2553
|
* **Details**
|
|
2129
2554
|
*
|
|
2130
2555
|
* Accepts the same syntax as `fromString`. Use `fromString` when invalid input
|
|
@@ -2141,6 +2566,8 @@ export const fromString = (s: string): Option.Option<BigDecimal> => {
|
|
|
2141
2566
|
* assert.throws(() => BigDecimal.fromStringUnsafe("123.abc"))
|
|
2142
2567
|
* ```
|
|
2143
2568
|
*
|
|
2569
|
+
* @see {@link fromString} for returning `Option.none` on invalid input
|
|
2570
|
+
*
|
|
2144
2571
|
* @category constructors
|
|
2145
2572
|
* @since 4.0.0
|
|
2146
2573
|
*/
|
|
@@ -2151,6 +2578,10 @@ export const fromStringUnsafe = (s: string): BigDecimal => {
|
|
|
2151
2578
|
/**
|
|
2152
2579
|
* Formats a `BigDecimal` as a string.
|
|
2153
2580
|
*
|
|
2581
|
+
* **When to use**
|
|
2582
|
+
*
|
|
2583
|
+
* Use to render a `BigDecimal` as plain decimal text when possible.
|
|
2584
|
+
*
|
|
2154
2585
|
* **Details**
|
|
2155
2586
|
*
|
|
2156
2587
|
* The value is normalized before formatting. Scientific notation is used when
|
|
@@ -2168,6 +2599,8 @@ export const fromStringUnsafe = (s: string): BigDecimal => {
|
|
|
2168
2599
|
* assert.deepStrictEqual(BigDecimal.format(BigDecimal.fromStringUnsafe("-0.00000123")), "-0.00000123")
|
|
2169
2600
|
* ```
|
|
2170
2601
|
*
|
|
2602
|
+
* @see {@link toExponential} for always rendering scientific notation
|
|
2603
|
+
*
|
|
2171
2604
|
* @category converting
|
|
2172
2605
|
* @since 2.0.0
|
|
2173
2606
|
*/
|
|
@@ -2205,6 +2638,10 @@ export const format = (n: BigDecimal): string => {
|
|
|
2205
2638
|
/**
|
|
2206
2639
|
* Formats a given `BigDecimal` as a `string` in scientific notation.
|
|
2207
2640
|
*
|
|
2641
|
+
* **When to use**
|
|
2642
|
+
*
|
|
2643
|
+
* Use to render a `BigDecimal` in scientific notation.
|
|
2644
|
+
*
|
|
2208
2645
|
* **Example** (Formatting decimals exponentially)
|
|
2209
2646
|
*
|
|
2210
2647
|
* ```ts
|
|
@@ -2214,6 +2651,8 @@ export const format = (n: BigDecimal): string => {
|
|
|
2214
2651
|
* assert.deepStrictEqual(BigDecimal.toExponential(BigDecimal.make(123456n, -5)), "1.23456e+10")
|
|
2215
2652
|
* ```
|
|
2216
2653
|
*
|
|
2654
|
+
* @see {@link format} for plain decimal formatting when possible
|
|
2655
|
+
*
|
|
2217
2656
|
* @category converting
|
|
2218
2657
|
* @since 3.11.0
|
|
2219
2658
|
*/
|
|
@@ -2239,6 +2678,11 @@ export const toExponential = (n: BigDecimal): string => {
|
|
|
2239
2678
|
/**
|
|
2240
2679
|
* Converts a `BigDecimal` to a JavaScript `number`.
|
|
2241
2680
|
*
|
|
2681
|
+
* **When to use**
|
|
2682
|
+
*
|
|
2683
|
+
* Use when an interop boundary requires a JavaScript number and can tolerate
|
|
2684
|
+
* precision loss.
|
|
2685
|
+
*
|
|
2242
2686
|
* **Gotchas**
|
|
2243
2687
|
*
|
|
2244
2688
|
* This conversion is unsafe because the result can lose integer or fractional
|
|
@@ -2254,6 +2698,8 @@ export const toExponential = (n: BigDecimal): string => {
|
|
|
2254
2698
|
* assert.deepStrictEqual(BigDecimal.toNumberUnsafe(BigDecimal.fromStringUnsafe("123.456")), 123.456)
|
|
2255
2699
|
* ```
|
|
2256
2700
|
*
|
|
2701
|
+
* @see {@link format} for preserving decimal precision as text
|
|
2702
|
+
*
|
|
2257
2703
|
* @category converting
|
|
2258
2704
|
* @since 4.0.0
|
|
2259
2705
|
*/
|
|
@@ -2262,6 +2708,10 @@ export const toNumberUnsafe = (n: BigDecimal): number => Number(format(n))
|
|
|
2262
2708
|
/**
|
|
2263
2709
|
* Checks if a given `BigDecimal` is an integer.
|
|
2264
2710
|
*
|
|
2711
|
+
* **When to use**
|
|
2712
|
+
*
|
|
2713
|
+
* Use to test whether a `BigDecimal` has no fractional decimal part.
|
|
2714
|
+
*
|
|
2265
2715
|
* **Example** (Checking integer decimals)
|
|
2266
2716
|
*
|
|
2267
2717
|
* ```ts
|
|
@@ -2281,6 +2731,10 @@ export const isInteger = (n: BigDecimal): boolean => normalize(n).scale <= 0
|
|
|
2281
2731
|
/**
|
|
2282
2732
|
* Checks if a given `BigDecimal` is `0`.
|
|
2283
2733
|
*
|
|
2734
|
+
* **When to use**
|
|
2735
|
+
*
|
|
2736
|
+
* Use to test whether a `BigDecimal` is exactly zero.
|
|
2737
|
+
*
|
|
2284
2738
|
* **Example** (Checking zero decimals)
|
|
2285
2739
|
*
|
|
2286
2740
|
* ```ts
|
|
@@ -2299,6 +2753,10 @@ export const isZero = (n: BigDecimal): boolean => n.value === bigint0
|
|
|
2299
2753
|
/**
|
|
2300
2754
|
* Checks if a given `BigDecimal` is negative.
|
|
2301
2755
|
*
|
|
2756
|
+
* **When to use**
|
|
2757
|
+
*
|
|
2758
|
+
* Use to test whether a `BigDecimal` is less than zero.
|
|
2759
|
+
*
|
|
2302
2760
|
* **Example** (Checking negative decimals)
|
|
2303
2761
|
*
|
|
2304
2762
|
* ```ts
|
|
@@ -2318,6 +2776,10 @@ export const isNegative = (n: BigDecimal): boolean => n.value < bigint0
|
|
|
2318
2776
|
/**
|
|
2319
2777
|
* Checks if a given `BigDecimal` is positive.
|
|
2320
2778
|
*
|
|
2779
|
+
* **When to use**
|
|
2780
|
+
*
|
|
2781
|
+
* Use to test whether a `BigDecimal` is greater than zero.
|
|
2782
|
+
*
|
|
2321
2783
|
* **Example** (Checking positive decimals)
|
|
2322
2784
|
*
|
|
2323
2785
|
* ```ts
|
|
@@ -2339,6 +2801,11 @@ const isBigDecimalArgs = (args: IArguments) => isBigDecimal(args[0])
|
|
|
2339
2801
|
/**
|
|
2340
2802
|
* Rounding modes for `BigDecimal`.
|
|
2341
2803
|
*
|
|
2804
|
+
* **When to use**
|
|
2805
|
+
*
|
|
2806
|
+
* Use with `round` to choose how discarded digits affect a `BigDecimal`
|
|
2807
|
+
* rounded to a target scale.
|
|
2808
|
+
*
|
|
2342
2809
|
* **Details**
|
|
2343
2810
|
*
|
|
2344
2811
|
* - `ceil`: round towards positive infinity
|
|
@@ -2352,6 +2819,11 @@ const isBigDecimalArgs = (args: IArguments) => isBigDecimal(args[0])
|
|
|
2352
2819
|
* - `half-even`: round to the nearest neighbor; if equidistant round to the neighbor with an even digit
|
|
2353
2820
|
* - `half-odd`: round to the nearest neighbor; if equidistant round to the neighbor with an odd digit
|
|
2354
2821
|
*
|
|
2822
|
+
* @see {@link round} for configurable rounding with a `RoundingMode`
|
|
2823
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2824
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2825
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2826
|
+
*
|
|
2355
2827
|
* @category math
|
|
2356
2828
|
* @since 3.16.0
|
|
2357
2829
|
*/
|
|
@@ -2370,6 +2842,10 @@ export type RoundingMode =
|
|
|
2370
2842
|
/**
|
|
2371
2843
|
* Rounds a `BigDecimal` at the given scale with the specified rounding mode.
|
|
2372
2844
|
*
|
|
2845
|
+
* **When to use**
|
|
2846
|
+
*
|
|
2847
|
+
* Use to round a decimal at a requested scale with an explicit rounding mode.
|
|
2848
|
+
*
|
|
2373
2849
|
* **Example** (Rounding decimals)
|
|
2374
2850
|
*
|
|
2375
2851
|
* ```ts
|
|
@@ -2386,6 +2862,10 @@ export type RoundingMode =
|
|
|
2386
2862
|
* )
|
|
2387
2863
|
* ```
|
|
2388
2864
|
*
|
|
2865
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2866
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2867
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2868
|
+
*
|
|
2389
2869
|
* @category math
|
|
2390
2870
|
* @since 3.16.0
|
|
2391
2871
|
*/
|
|
@@ -2393,6 +2873,10 @@ export const round: {
|
|
|
2393
2873
|
/**
|
|
2394
2874
|
* Rounds a `BigDecimal` at the given scale with the specified rounding mode.
|
|
2395
2875
|
*
|
|
2876
|
+
* **When to use**
|
|
2877
|
+
*
|
|
2878
|
+
* Use to round a decimal at a requested scale with an explicit rounding mode.
|
|
2879
|
+
*
|
|
2396
2880
|
* **Example** (Rounding decimals)
|
|
2397
2881
|
*
|
|
2398
2882
|
* ```ts
|
|
@@ -2409,6 +2893,10 @@ export const round: {
|
|
|
2409
2893
|
* )
|
|
2410
2894
|
* ```
|
|
2411
2895
|
*
|
|
2896
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2897
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2898
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2899
|
+
*
|
|
2412
2900
|
* @category math
|
|
2413
2901
|
* @since 3.16.0
|
|
2414
2902
|
*/
|
|
@@ -2416,6 +2904,10 @@ export const round: {
|
|
|
2416
2904
|
/**
|
|
2417
2905
|
* Rounds a `BigDecimal` at the given scale with the specified rounding mode.
|
|
2418
2906
|
*
|
|
2907
|
+
* **When to use**
|
|
2908
|
+
*
|
|
2909
|
+
* Use to round a decimal at a requested scale with an explicit rounding mode.
|
|
2910
|
+
*
|
|
2419
2911
|
* **Example** (Rounding decimals)
|
|
2420
2912
|
*
|
|
2421
2913
|
* ```ts
|
|
@@ -2432,6 +2924,10 @@ export const round: {
|
|
|
2432
2924
|
* )
|
|
2433
2925
|
* ```
|
|
2434
2926
|
*
|
|
2927
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2928
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2929
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2930
|
+
*
|
|
2435
2931
|
* @category math
|
|
2436
2932
|
* @since 3.16.0
|
|
2437
2933
|
*/
|
|
@@ -2487,6 +2983,10 @@ export const round: {
|
|
|
2487
2983
|
* Truncate a `BigDecimal` at the given scale. This removes fractional digits beyond the scale,
|
|
2488
2984
|
* rounding toward zero.
|
|
2489
2985
|
*
|
|
2986
|
+
* **When to use**
|
|
2987
|
+
*
|
|
2988
|
+
* Use to remove digits beyond a requested scale by rounding toward zero.
|
|
2989
|
+
*
|
|
2490
2990
|
* **Example** (Truncating decimals)
|
|
2491
2991
|
*
|
|
2492
2992
|
* ```ts
|
|
@@ -2496,6 +2996,10 @@ export const round: {
|
|
|
2496
2996
|
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2497
2997
|
* ```
|
|
2498
2998
|
*
|
|
2999
|
+
* @see {@link round} for configurable rounding modes
|
|
3000
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3001
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3002
|
+
*
|
|
2499
3003
|
* @category math
|
|
2500
3004
|
* @since 3.16.0
|
|
2501
3005
|
*/
|
|
@@ -2504,6 +3008,10 @@ export const truncate: {
|
|
|
2504
3008
|
* Truncate a `BigDecimal` at the given scale. This removes fractional digits beyond the scale,
|
|
2505
3009
|
* rounding toward zero.
|
|
2506
3010
|
*
|
|
3011
|
+
* **When to use**
|
|
3012
|
+
*
|
|
3013
|
+
* Use to remove digits beyond a requested scale by rounding toward zero.
|
|
3014
|
+
*
|
|
2507
3015
|
* **Example** (Truncating decimals)
|
|
2508
3016
|
*
|
|
2509
3017
|
* ```ts
|
|
@@ -2513,6 +3021,10 @@ export const truncate: {
|
|
|
2513
3021
|
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2514
3022
|
* ```
|
|
2515
3023
|
*
|
|
3024
|
+
* @see {@link round} for configurable rounding modes
|
|
3025
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3026
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3027
|
+
*
|
|
2516
3028
|
* @category math
|
|
2517
3029
|
* @since 3.16.0
|
|
2518
3030
|
*/
|
|
@@ -2521,6 +3033,10 @@ export const truncate: {
|
|
|
2521
3033
|
* Truncate a `BigDecimal` at the given scale. This removes fractional digits beyond the scale,
|
|
2522
3034
|
* rounding toward zero.
|
|
2523
3035
|
*
|
|
3036
|
+
* **When to use**
|
|
3037
|
+
*
|
|
3038
|
+
* Use to remove digits beyond a requested scale by rounding toward zero.
|
|
3039
|
+
*
|
|
2524
3040
|
* **Example** (Truncating decimals)
|
|
2525
3041
|
*
|
|
2526
3042
|
* ```ts
|
|
@@ -2530,6 +3046,10 @@ export const truncate: {
|
|
|
2530
3046
|
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2531
3047
|
* ```
|
|
2532
3048
|
*
|
|
3049
|
+
* @see {@link round} for configurable rounding modes
|
|
3050
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3051
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3052
|
+
*
|
|
2533
3053
|
* @category math
|
|
2534
3054
|
* @since 3.16.0
|
|
2535
3055
|
*/
|
|
@@ -2546,6 +3066,20 @@ export const truncate: {
|
|
|
2546
3066
|
/**
|
|
2547
3067
|
* Calculate the ceiling of a `BigDecimal` at the given scale.
|
|
2548
3068
|
*
|
|
3069
|
+
* **When to use**
|
|
3070
|
+
*
|
|
3071
|
+
* Use to round a decimal toward positive infinity at a requested scale.
|
|
3072
|
+
*
|
|
3073
|
+
* **Details**
|
|
3074
|
+
*
|
|
3075
|
+
* The default scale is `0`. Positive scales keep digits to the right of the
|
|
3076
|
+
* decimal point, and negative scales round positions to the left of the decimal
|
|
3077
|
+
* point.
|
|
3078
|
+
*
|
|
3079
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3080
|
+
* @see {@link truncate} for rounding toward zero
|
|
3081
|
+
* @see {@link round} for configurable rounding modes
|
|
3082
|
+
*
|
|
2549
3083
|
* **Example** (Rounding decimals up)
|
|
2550
3084
|
*
|
|
2551
3085
|
* ```ts
|
|
@@ -2566,6 +3100,20 @@ export const ceil: {
|
|
|
2566
3100
|
/**
|
|
2567
3101
|
* Calculate the ceiling of a `BigDecimal` at the given scale.
|
|
2568
3102
|
*
|
|
3103
|
+
* **When to use**
|
|
3104
|
+
*
|
|
3105
|
+
* Use to round a decimal toward positive infinity at a requested scale.
|
|
3106
|
+
*
|
|
3107
|
+
* **Details**
|
|
3108
|
+
*
|
|
3109
|
+
* The default scale is `0`. Positive scales keep digits to the right of the
|
|
3110
|
+
* decimal point, and negative scales round positions to the left of the decimal
|
|
3111
|
+
* point.
|
|
3112
|
+
*
|
|
3113
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3114
|
+
* @see {@link truncate} for rounding toward zero
|
|
3115
|
+
* @see {@link round} for configurable rounding modes
|
|
3116
|
+
*
|
|
2569
3117
|
* **Example** (Rounding decimals up)
|
|
2570
3118
|
*
|
|
2571
3119
|
* ```ts
|
|
@@ -2586,6 +3134,20 @@ export const ceil: {
|
|
|
2586
3134
|
/**
|
|
2587
3135
|
* Calculate the ceiling of a `BigDecimal` at the given scale.
|
|
2588
3136
|
*
|
|
3137
|
+
* **When to use**
|
|
3138
|
+
*
|
|
3139
|
+
* Use to round a decimal toward positive infinity at a requested scale.
|
|
3140
|
+
*
|
|
3141
|
+
* **Details**
|
|
3142
|
+
*
|
|
3143
|
+
* The default scale is `0`. Positive scales keep digits to the right of the
|
|
3144
|
+
* decimal point, and negative scales round positions to the left of the decimal
|
|
3145
|
+
* point.
|
|
3146
|
+
*
|
|
3147
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3148
|
+
* @see {@link truncate} for rounding toward zero
|
|
3149
|
+
* @see {@link round} for configurable rounding modes
|
|
3150
|
+
*
|
|
2589
3151
|
* **Example** (Rounding decimals up)
|
|
2590
3152
|
*
|
|
2591
3153
|
* ```ts
|
|
@@ -2649,6 +3211,10 @@ export const digitAt: {
|
|
|
2649
3211
|
/**
|
|
2650
3212
|
* Calculate the floor of a `BigDecimal` at the given scale.
|
|
2651
3213
|
*
|
|
3214
|
+
* **When to use**
|
|
3215
|
+
*
|
|
3216
|
+
* Use to round a decimal toward negative infinity at a requested scale.
|
|
3217
|
+
*
|
|
2652
3218
|
* **Example** (Rounding decimals down)
|
|
2653
3219
|
*
|
|
2654
3220
|
* ```ts
|
|
@@ -2665,6 +3231,10 @@ export const digitAt: {
|
|
|
2665
3231
|
* )
|
|
2666
3232
|
* ```
|
|
2667
3233
|
*
|
|
3234
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3235
|
+
* @see {@link truncate} for rounding toward zero
|
|
3236
|
+
* @see {@link round} for configurable rounding modes
|
|
3237
|
+
*
|
|
2668
3238
|
* @category math
|
|
2669
3239
|
* @since 3.16.0
|
|
2670
3240
|
*/
|
|
@@ -2672,6 +3242,10 @@ export const floor: {
|
|
|
2672
3242
|
/**
|
|
2673
3243
|
* Calculate the floor of a `BigDecimal` at the given scale.
|
|
2674
3244
|
*
|
|
3245
|
+
* **When to use**
|
|
3246
|
+
*
|
|
3247
|
+
* Use to round a decimal toward negative infinity at a requested scale.
|
|
3248
|
+
*
|
|
2675
3249
|
* **Example** (Rounding decimals down)
|
|
2676
3250
|
*
|
|
2677
3251
|
* ```ts
|
|
@@ -2688,6 +3262,10 @@ export const floor: {
|
|
|
2688
3262
|
* )
|
|
2689
3263
|
* ```
|
|
2690
3264
|
*
|
|
3265
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3266
|
+
* @see {@link truncate} for rounding toward zero
|
|
3267
|
+
* @see {@link round} for configurable rounding modes
|
|
3268
|
+
*
|
|
2691
3269
|
* @category math
|
|
2692
3270
|
* @since 3.16.0
|
|
2693
3271
|
*/
|
|
@@ -2695,6 +3273,10 @@ export const floor: {
|
|
|
2695
3273
|
/**
|
|
2696
3274
|
* Calculate the floor of a `BigDecimal` at the given scale.
|
|
2697
3275
|
*
|
|
3276
|
+
* **When to use**
|
|
3277
|
+
*
|
|
3278
|
+
* Use to round a decimal toward negative infinity at a requested scale.
|
|
3279
|
+
*
|
|
2698
3280
|
* **Example** (Rounding decimals down)
|
|
2699
3281
|
*
|
|
2700
3282
|
* ```ts
|
|
@@ -2711,6 +3293,10 @@ export const floor: {
|
|
|
2711
3293
|
* )
|
|
2712
3294
|
* ```
|
|
2713
3295
|
*
|
|
3296
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3297
|
+
* @see {@link truncate} for rounding toward zero
|
|
3298
|
+
* @see {@link round} for configurable rounding modes
|
|
3299
|
+
*
|
|
2714
3300
|
* @category math
|
|
2715
3301
|
* @since 3.16.0
|
|
2716
3302
|
*/
|