effect 4.0.0-beta.70 → 4.0.0-beta.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +1483 -239
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +617 -164
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +646 -52
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +331 -28
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +474 -18
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +292 -14
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +239 -19
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +163 -13
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +53 -8
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +82 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +73 -12
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +53 -15
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +488 -200
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +349 -129
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +539 -158
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +222 -89
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +81 -6
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -4
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +179 -54
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +65 -22
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +60 -3
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +31 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +21 -21
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +14 -18
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +135 -50
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +109 -37
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +52 -29
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +21 -21
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +32 -7
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +32 -7
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +503 -48
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +191 -17
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +116 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +92 -6
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +30 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +30 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +92 -47
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +16 -12
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +313 -128
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +167 -68
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +345 -79
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +131 -12
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +5 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +203 -50
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +112 -32
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2006 -810
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +785 -350
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +16 -2
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +16 -2
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +100 -8
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +141 -8
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +10 -11
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +7 -8
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +46 -43
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +43 -35
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +135 -16
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +93 -12
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -26
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +28 -2
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +149 -101
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +117 -80
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +321 -72
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +152 -3
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +6 -6
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberMap.d.ts +18 -18
- package/dist/FiberMap.js +8 -8
- package/dist/FiberSet.d.ts +21 -13
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -9
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +79 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +93 -33
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +221 -2
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +155 -2
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +4 -6
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -5
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +164 -18
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +116 -15
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +297 -25
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +75 -12
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +59 -26
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +95 -19
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +119 -17
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +35 -37
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +13 -15
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +210 -9
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +95 -5
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +16 -16
- package/dist/HashSet.js +6 -6
- package/dist/Inspectable.d.ts +47 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +74 -17
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +261 -81
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +123 -43
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +34 -19
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +52 -44
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -5
- package/dist/JsonPointer.js +5 -5
- package/dist/JsonSchema.d.ts +77 -33
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +45 -31
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +158 -13
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +79 -4
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +297 -101
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +94 -36
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +9 -2
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +1 -2
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +96 -21
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +68 -9
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +21 -7
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +26 -13
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +82 -10
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +33 -2
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +215 -42
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +242 -59
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +68 -41
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +60 -33
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +285 -40
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +128 -7
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +111 -4
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +98 -39
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +24 -6
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +23 -5
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +141 -4
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +73 -2
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +20 -11
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -6
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +22 -6
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +6 -1
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +434 -17
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +268 -13
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +26 -33
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +18 -25
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +186 -150
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +75 -72
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +93 -120
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +149 -142
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +37 -5
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +22 -3
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +238 -15
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +106 -8
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +34 -6
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +19 -5
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +29 -4
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +16 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +53 -4
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +45 -4
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +140 -14
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +63 -8
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +98 -168
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +109 -120
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +75 -9
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +70 -9
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +241 -66
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +187 -52
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +148 -3
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +69 -2
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +167 -59
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +163 -55
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +71 -16
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +171 -9
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +49 -3
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +73 -18
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +23 -3
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +174 -53
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +128 -23
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +27 -23
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +22 -18
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +82 -4
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +64 -4
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +17 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -4
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +168 -32
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +135 -30
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +226 -30
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +162 -23
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +15 -2
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +49 -3
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +218 -35
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +57 -10
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +213 -29
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +99 -11
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +62 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +52 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +380 -57
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +176 -32
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +124 -14
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +150 -25
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +436 -115
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +344 -107
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +53 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +42 -3
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +934 -239
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +655 -217
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +239 -28
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +239 -28
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +127 -129
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +115 -117
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +45 -56
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +39 -50
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +254 -15
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +295 -33
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +101 -71
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +92 -56
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +86 -50
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +9 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +38 -11
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +127 -25
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +91 -21
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +364 -19
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +155 -7
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +69 -7
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +49 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +348 -29
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +103 -8
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +343 -45
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +194 -26
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +72 -17
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +62 -16
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +774 -224
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +333 -91
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +219 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +179 -29
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +54 -110
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +26 -42
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +341 -105
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +162 -44
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +25 -7
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +25 -7
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +529 -29
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +193 -11
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +36 -13
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +5 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +76 -20
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +41 -5
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +74 -7
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +74 -7
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +67 -30
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +7 -7
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +96 -108
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -52
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +42 -9
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +42 -9
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +85 -2
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +56 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +20 -20
- package/dist/TxHashMap.js +8 -8
- package/dist/TxHashSet.d.ts +14 -14
- package/dist/TxHashSet.js +6 -6
- package/dist/TxPriorityQueue.d.ts +43 -8
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +41 -6
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +98 -8
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +70 -8
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +58 -17
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +10 -10
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +88 -16
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +78 -14
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +113 -8
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +82 -8
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +173 -14
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +130 -14
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +206 -3
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +111 -3
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +68 -13
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +171 -30
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +115 -30
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +130 -22
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +36 -12
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +21 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +14 -6
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -5205
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5205
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/request.js +3 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +11 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/representation.js +21 -12
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +69 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +73 -9
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +79 -30
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +69 -31
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -107
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -107
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +33 -5
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +33 -5
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +9 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +43 -11
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +45 -6
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +73 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +104 -8
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +103 -7
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +8 -3
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -3
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +51 -7
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +50 -6
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +299 -169
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +278 -147
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +108 -14
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +80 -10
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +35 -13
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +34 -12
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +48 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +24 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +23 -2
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +71 -13
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +35 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +34 -12
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +33 -11
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +40 -27
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +34 -26
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +41 -25
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +41 -25
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +85 -24
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +84 -23
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +1 -1
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +0 -560
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +0 -560
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +3 -3
- package/dist/unstable/cli/CliOutput.d.ts +1 -1
- package/dist/unstable/cli/Command.d.ts +136 -8
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +50 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +13 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +41 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +24 -12
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +18 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +39 -8
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +39 -8
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +128 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +59 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +3 -3
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +59 -10
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +37 -7
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +51 -9
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +0 -220
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +0 -220
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +61 -22
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +61 -22
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +58 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +58 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +87 -26
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +87 -26
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +49 -10
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +6 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +6 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +33 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +32 -5
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +19 -0
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +19 -0
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +44 -7
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +44 -7
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +5 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +4 -5
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +19 -0
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +19 -0
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +11 -11
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +11 -11
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +42 -22
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +42 -22
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +33 -14
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +35 -9
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +35 -9
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +11 -11
- package/dist/unstable/cluster/Message.js +11 -11
- package/dist/unstable/cluster/MessageStorage.d.ts +38 -24
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +37 -23
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +18 -8
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +18 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -14
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -14
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +52 -10
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +52 -10
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +33 -16
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +33 -16
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +19 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +19 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +25 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +24 -0
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +24 -2
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +24 -2
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +27 -3
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +63 -20
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +60 -16
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +61 -17
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -14
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -15
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +26 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +26 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +51 -9
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +51 -9
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +27 -13
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +27 -13
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +19 -5
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +19 -5
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +27 -1
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +27 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +38 -0
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +73 -13
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +25 -14
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +25 -14
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +0 -790
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +0 -790
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +41 -11
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +41 -11
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +38 -0
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +68 -11
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +24 -16
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +20 -13
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +20 -13
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +0 -58
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +0 -58
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +30 -14
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +28 -14
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +28 -14
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +38 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +3 -3
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +0 -49
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +0 -49
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +28 -13
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +23 -15
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +22 -14
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +7 -7
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +36 -19
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +63 -25
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +61 -23
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +49 -40
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +28 -28
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +14 -4
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +14 -4
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +7 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +7 -2
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +82 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +119 -22
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +33 -7
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +68 -24
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +21 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +50 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +30 -11
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +0 -240
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +0 -240
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +99 -52
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +77 -30
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +43 -13
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +43 -13
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +59 -17
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +59 -17
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -22
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +58 -20
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +6 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +59 -15
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +66 -30
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +17 -7
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +15 -14
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +39 -22
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +37 -16
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +37 -16
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +35 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +33 -14
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -3
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +46 -20
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +46 -20
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +19 -14
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +54 -26
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +34 -21
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +34 -21
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +41 -28
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -26
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +53 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +20 -5
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +28 -14
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +64 -42
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +48 -26
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +30 -13
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +29 -12
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +32 -19
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +32 -19
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +39 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +39 -19
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +27 -14
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +25 -12
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +41 -28
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +32 -17
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +43 -28
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +40 -25
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +0 -452
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +0 -452
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +50 -26
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +39 -25
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +28 -16
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +51 -23
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +37 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +34 -23
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +4 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +28 -16
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +43 -43
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +42 -42
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +28 -16
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +7 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -27
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +0 -311
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +0 -311
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +31 -16
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +31 -15
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +33 -15
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +27 -16
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +27 -16
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.js +3 -3
- package/dist/unstable/observability/index.d.ts +0 -183
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +0 -183
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +12 -4
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +10 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -3
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +8 -3
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +29 -16
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +27 -14
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +10 -5
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -4
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +20 -10
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +19 -9
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +33 -15
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +0 -147
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +0 -147
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +14 -14
- package/dist/unstable/process/ChildProcess.js +7 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts +17 -5
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +17 -5
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +0 -45
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +0 -45
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +74 -22
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +52 -20
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +81 -35
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +70 -32
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +32 -16
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +52 -25
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +81 -20
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +81 -20
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +37 -17
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +44 -21
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +44 -21
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +0 -166
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +0 -166
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +47 -32
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +15 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +27 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +27 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +31 -17
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +31 -17
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +29 -18
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +37 -19
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +4 -4
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +31 -21
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +31 -21
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +30 -20
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +30 -20
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +50 -33
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +48 -31
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +22 -17
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +22 -17
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +31 -15
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +31 -15
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +29 -14
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +0 -272
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +0 -272
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +32 -33
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +25 -26
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/index.d.ts +0 -37
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +0 -37
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +8 -2
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +8 -2
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +2 -2
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/socket/index.d.ts +0 -44
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +0 -44
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +39 -18
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +7 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +33 -17
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +3 -3
- package/dist/unstable/sql/SqlResolver.js +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +51 -21
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +51 -21
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +34 -14
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +0 -178
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +0 -178
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +32 -21
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +32 -21
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +37 -24
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +35 -22
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +32 -16
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +31 -20
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +31 -20
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +0 -80
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +0 -80
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +25 -13
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +12 -12
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableQueue.d.ts +36 -18
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +36 -18
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +22 -23
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +17 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +26 -8
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +25 -7
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +0 -160
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +0 -160
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1557 -312
- package/src/BigDecimal.ts +646 -52
- package/src/BigInt.ts +474 -18
- package/src/Boolean.ts +239 -19
- package/src/Brand.ts +102 -11
- package/src/Cache.ts +96 -24
- package/src/Cause.ts +488 -200
- package/src/Channel.ts +647 -191
- package/src/ChannelSchema.ts +99 -6
- package/src/Chunk.ts +187 -54
- package/src/Clock.ts +60 -3
- package/src/Combiner.ts +21 -21
- package/src/Config.ts +135 -50
- package/src/ConfigProvider.ts +52 -29
- package/src/Console.ts +32 -7
- package/src/Context.ts +516 -50
- package/src/Cron.ts +116 -6
- package/src/Crypto.ts +30 -1
- package/src/Data.ts +92 -47
- package/src/DateTime.ts +313 -128
- package/src/Deferred.ts +345 -79
- package/src/Differ.ts +5 -0
- package/src/Duration.ts +203 -50
- package/src/Effect.ts +2044 -816
- package/src/Effectable.ts +16 -2
- package/src/Encoding.ts +146 -9
- package/src/Equal.ts +10 -11
- package/src/Equivalence.ts +49 -46
- package/src/ErrorReporter.ts +135 -16
- package/src/ExecutionPlan.ts +96 -26
- package/src/Exit.ts +149 -101
- package/src/Fiber.ts +321 -72
- package/src/FiberHandle.ts +6 -6
- package/src/FiberMap.ts +20 -20
- package/src/FiberSet.ts +21 -13
- package/src/FileSystem.ts +119 -39
- package/src/Filter.ts +221 -2
- package/src/Formatter.ts +4 -6
- package/src/Function.ts +164 -18
- package/src/Graph.ts +297 -25
- package/src/HKT.ts +59 -26
- package/src/Hash.ts +143 -23
- package/src/HashMap.ts +35 -37
- package/src/HashRing.ts +210 -9
- package/src/HashSet.ts +16 -16
- package/src/Inspectable.ts +86 -17
- package/src/Iterable.ts +261 -81
- package/src/JsonPatch.ts +79 -56
- package/src/JsonPointer.ts +5 -5
- package/src/JsonSchema.ts +77 -33
- package/src/Latch.ts +164 -13
- package/src/Layer.ts +297 -101
- package/src/LayerMap.ts +9 -2
- package/src/LogLevel.ts +96 -21
- package/src/Logger.ts +31 -15
- package/src/ManagedRuntime.ts +82 -10
- package/src/Match.ts +250 -59
- package/src/Metric.ts +68 -41
- package/src/MutableHashMap.ts +381 -52
- package/src/MutableHashSet.ts +145 -41
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +141 -4
- package/src/Newtype.ts +20 -11
- package/src/NonEmptyIterable.ts +22 -6
- package/src/Number.ts +434 -17
- package/src/Optic.ts +26 -33
- package/src/Option.ts +186 -150
- package/src/Order.ts +163 -161
- package/src/Ordering.ts +37 -5
- package/src/PartitionedSemaphore.ts +238 -15
- package/src/Path.ts +34 -6
- package/src/Pipeable.ts +29 -4
- package/src/PlatformError.ts +53 -4
- package/src/Pool.ts +174 -32
- package/src/Predicate.ts +151 -196
- package/src/PrimaryKey.ts +75 -9
- package/src/PubSub.ts +241 -66
- package/src/Pull.ts +148 -3
- package/src/Queue.ts +167 -59
- package/src/Random.ts +71 -16
- package/src/RcMap.ts +171 -9
- package/src/RcRef.ts +73 -18
- package/src/Record.ts +174 -53
- package/src/Redactable.ts +27 -23
- package/src/Redacted.ts +82 -4
- package/src/Reducer.ts +17 -7
- package/src/Ref.ts +332 -54
- package/src/References.ts +226 -30
- package/src/RegExp.ts +49 -3
- package/src/Request.ts +218 -35
- package/src/RequestResolver.ts +268 -36
- package/src/Resource.ts +62 -3
- package/src/Result.ts +380 -57
- package/src/Runtime.ts +172 -32
- package/src/Schedule.ts +510 -145
- package/src/Scheduler.ts +53 -4
- package/src/Schema.ts +975 -264
- package/src/SchemaAST.ts +239 -28
- package/src/SchemaGetter.ts +127 -129
- package/src/SchemaIssue.ts +45 -56
- package/src/SchemaParser.ts +295 -33
- package/src/SchemaRepresentation.ts +106 -77
- package/src/SchemaTransformation.ts +92 -56
- package/src/SchemaUtils.ts +38 -11
- package/src/Scope.ts +127 -25
- package/src/ScopedCache.ts +418 -21
- package/src/ScopedRef.ts +69 -7
- package/src/Semaphore.ts +348 -29
- package/src/Sink.ts +343 -45
- package/src/Stdio.ts +72 -17
- package/src/Stream.ts +880 -242
- package/src/String.ts +221 -49
- package/src/Struct.ts +54 -110
- package/src/SubscriptionRef.ts +341 -105
- package/src/Symbol.ts +25 -7
- package/src/SynchronizedRef.ts +529 -29
- package/src/Take.ts +36 -13
- package/src/Terminal.ts +76 -20
- package/src/Tracer.ts +74 -7
- package/src/Trie.ts +67 -30
- package/src/Tuple.ts +96 -108
- package/src/TxChunk.ts +42 -9
- package/src/TxDeferred.ts +85 -2
- package/src/TxHashMap.ts +22 -22
- package/src/TxHashSet.ts +22 -22
- package/src/TxPriorityQueue.ts +43 -8
- package/src/TxPubSub.ts +98 -8
- package/src/TxQueue.ts +58 -17
- package/src/TxReentrantLock.ts +88 -16
- package/src/TxRef.ts +113 -8
- package/src/TxSemaphore.ts +173 -14
- package/src/TxSubscriptionRef.ts +206 -3
- package/src/Types.ts +68 -13
- package/src/UndefinedOr.ts +171 -30
- package/src/Unify.ts +130 -22
- package/src/Utils.ts +21 -16
- package/src/index.ts +0 -5205
- package/src/internal/effect.ts +59 -29
- package/src/internal/request.ts +3 -1
- package/src/internal/schema/arbitrary.ts +14 -1
- package/src/internal/schema/representation.ts +37 -14
- package/src/testing/TestConsole.ts +105 -9
- package/src/testing/TestSchema.ts +81 -31
- package/src/testing/index.ts +0 -107
- package/src/unstable/ai/AiError.ts +33 -5
- package/src/unstable/ai/AnthropicStructuredOutput.ts +43 -11
- package/src/unstable/ai/Chat.ts +82 -33
- package/src/unstable/ai/EmbeddingModel.ts +104 -8
- package/src/unstable/ai/IdGenerator.ts +8 -3
- package/src/unstable/ai/LanguageModel.ts +51 -7
- package/src/unstable/ai/McpSchema.ts +299 -169
- package/src/unstable/ai/McpServer.ts +108 -14
- package/src/unstable/ai/Model.ts +35 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +48 -1
- package/src/unstable/ai/Prompt.ts +24 -3
- package/src/unstable/ai/Response.ts +71 -13
- package/src/unstable/ai/ResponseIdTracker.ts +34 -12
- package/src/unstable/ai/Telemetry.ts +40 -27
- package/src/unstable/ai/Tokenizer.ts +41 -25
- package/src/unstable/ai/Tool.ts +85 -24
- package/src/unstable/ai/Toolkit.ts +32 -4
- package/src/unstable/ai/index.ts +0 -560
- package/src/unstable/cli/Argument.ts +1 -1
- package/src/unstable/cli/CliError.ts +3 -3
- package/src/unstable/cli/CliOutput.ts +1 -1
- package/src/unstable/cli/Command.ts +136 -8
- package/src/unstable/cli/Completions.ts +41 -1
- package/src/unstable/cli/Flag.ts +24 -12
- package/src/unstable/cli/GlobalFlag.ts +39 -8
- package/src/unstable/cli/Param.ts +137 -11
- package/src/unstable/cli/Primitive.ts +59 -10
- package/src/unstable/cli/Prompt.ts +63 -14
- package/src/unstable/cli/index.ts +0 -220
- package/src/unstable/cli/internal/parser.ts +1 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterError.ts +61 -22
- package/src/unstable/cluster/ClusterMetrics.ts +58 -5
- package/src/unstable/cluster/ClusterSchema.ts +87 -26
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +63 -11
- package/src/unstable/cluster/DeliverAt.ts +6 -1
- package/src/unstable/cluster/Entity.ts +33 -6
- package/src/unstable/cluster/EntityAddress.ts +19 -0
- package/src/unstable/cluster/EntityId.ts +44 -7
- package/src/unstable/cluster/EntityResource.ts +5 -6
- package/src/unstable/cluster/EntityType.ts +19 -0
- package/src/unstable/cluster/Envelope.ts +11 -11
- package/src/unstable/cluster/HttpRunner.ts +42 -22
- package/src/unstable/cluster/K8sHttpClient.ts +32 -13
- package/src/unstable/cluster/MachineId.ts +35 -9
- package/src/unstable/cluster/Message.ts +11 -11
- package/src/unstable/cluster/MessageStorage.ts +38 -24
- package/src/unstable/cluster/Reply.ts +18 -8
- package/src/unstable/cluster/Runner.ts +47 -14
- package/src/unstable/cluster/RunnerAddress.ts +52 -10
- package/src/unstable/cluster/RunnerHealth.ts +33 -16
- package/src/unstable/cluster/RunnerServer.ts +19 -4
- package/src/unstable/cluster/Runners.ts +25 -1
- package/src/unstable/cluster/ShardId.ts +24 -2
- package/src/unstable/cluster/Sharding.ts +63 -20
- package/src/unstable/cluster/ShardingConfig.ts +60 -16
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +27 -14
- package/src/unstable/cluster/SingleRunner.ts +26 -1
- package/src/unstable/cluster/Singleton.ts +51 -9
- package/src/unstable/cluster/SingletonAddress.ts +27 -13
- package/src/unstable/cluster/Snowflake.ts +19 -5
- package/src/unstable/cluster/SocketRunner.ts +27 -1
- package/src/unstable/cluster/SqlMessageStorage.ts +73 -13
- package/src/unstable/cluster/SqlRunnerStorage.ts +20 -0
- package/src/unstable/cluster/TestRunner.ts +25 -14
- package/src/unstable/cluster/index.ts +0 -790
- package/src/unstable/devtools/DevTools.ts +41 -11
- package/src/unstable/devtools/DevToolsClient.ts +68 -11
- package/src/unstable/devtools/DevToolsSchema.ts +24 -16
- package/src/unstable/devtools/DevToolsServer.ts +18 -11
- package/src/unstable/devtools/index.ts +0 -58
- package/src/unstable/encoding/Msgpack.ts +30 -14
- package/src/unstable/encoding/Ndjson.ts +28 -14
- package/src/unstable/encoding/Sse.ts +38 -17
- package/src/unstable/encoding/index.ts +0 -49
- package/src/unstable/eventlog/Event.ts +30 -15
- package/src/unstable/eventlog/EventGroup.ts +23 -15
- package/src/unstable/eventlog/EventJournal.ts +38 -21
- package/src/unstable/eventlog/EventLog.ts +63 -25
- package/src/unstable/eventlog/EventLogEncryption.ts +8 -3
- package/src/unstable/eventlog/EventLogMessage.ts +49 -40
- package/src/unstable/eventlog/EventLogRemote.ts +14 -4
- package/src/unstable/eventlog/EventLogServer.ts +36 -17
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +24 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +119 -22
- package/src/unstable/eventlog/EventLogSessionAuth.ts +68 -24
- package/src/unstable/eventlog/SqlEventJournal.ts +50 -14
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +39 -15
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +30 -11
- package/src/unstable/eventlog/index.ts +0 -240
- package/src/unstable/http/Cookies.ts +97 -50
- package/src/unstable/http/Etag.ts +43 -13
- package/src/unstable/http/FetchHttpClient.ts +59 -17
- package/src/unstable/http/Headers.ts +62 -24
- package/src/unstable/http/HttpBody.ts +59 -15
- package/src/unstable/http/HttpClient.ts +119 -33
- package/src/unstable/http/HttpClientError.ts +41 -24
- package/src/unstable/http/HttpClientRequest.ts +37 -16
- package/src/unstable/http/HttpClientResponse.ts +33 -14
- package/src/unstable/http/HttpEffect.ts +35 -18
- package/src/unstable/http/HttpMethod.ts +46 -20
- package/src/unstable/http/HttpRouter.ts +58 -30
- package/src/unstable/http/HttpServer.ts +34 -21
- package/src/unstable/http/HttpServerError.ts +41 -28
- package/src/unstable/http/HttpServerRequest.ts +51 -19
- package/src/unstable/http/HttpServerRespondable.ts +28 -14
- package/src/unstable/http/HttpServerResponse.ts +66 -44
- package/src/unstable/http/HttpStaticServer.ts +29 -12
- package/src/unstable/http/HttpTraceContext.ts +32 -19
- package/src/unstable/http/Multipart.ts +39 -19
- package/src/unstable/http/Template.ts +25 -12
- package/src/unstable/http/Url.ts +41 -28
- package/src/unstable/http/UrlParams.ts +43 -28
- package/src/unstable/http/index.ts +0 -452
- package/src/unstable/httpapi/HttpApi.ts +48 -24
- package/src/unstable/httpapi/HttpApiBuilder.ts +40 -26
- package/src/unstable/httpapi/HttpApiClient.ts +28 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +51 -23
- package/src/unstable/httpapi/HttpApiError.ts +38 -18
- package/src/unstable/httpapi/HttpApiGroup.ts +34 -23
- package/src/unstable/httpapi/HttpApiMiddleware.ts +49 -25
- package/src/unstable/httpapi/HttpApiScalar.ts +32 -17
- package/src/unstable/httpapi/HttpApiSchema.ts +43 -43
- package/src/unstable/httpapi/HttpApiSecurity.ts +54 -24
- package/src/unstable/httpapi/HttpApiSwagger.ts +28 -16
- package/src/unstable/httpapi/HttpApiTest.ts +1 -1
- package/src/unstable/httpapi/OpenApi.ts +43 -25
- package/src/unstable/httpapi/index.ts +0 -311
- package/src/unstable/observability/Otlp.ts +31 -16
- package/src/unstable/observability/OtlpLogger.ts +31 -15
- package/src/unstable/observability/OtlpResource.ts +33 -15
- package/src/unstable/observability/OtlpSerialization.ts +25 -14
- package/src/unstable/observability/PrometheusMetrics.ts +3 -3
- package/src/unstable/observability/index.ts +0 -183
- package/src/unstable/persistence/KeyValueStore.ts +12 -4
- package/src/unstable/persistence/Persistable.ts +8 -3
- package/src/unstable/persistence/PersistedCache.ts +27 -14
- package/src/unstable/persistence/PersistedQueue.ts +10 -5
- package/src/unstable/persistence/RateLimiter.ts +20 -10
- package/src/unstable/persistence/Redis.ts +33 -15
- package/src/unstable/persistence/index.ts +0 -147
- package/src/unstable/process/ChildProcess.ts +14 -14
- package/src/unstable/process/ChildProcessSpawner.ts +17 -5
- package/src/unstable/process/index.ts +0 -45
- package/src/unstable/reactivity/AsyncResult.ts +96 -24
- package/src/unstable/reactivity/Atom.ts +89 -35
- package/src/unstable/reactivity/AtomRef.ts +58 -25
- package/src/unstable/reactivity/AtomRegistry.ts +79 -18
- package/src/unstable/reactivity/Hydration.ts +37 -17
- package/src/unstable/reactivity/Reactivity.ts +42 -19
- package/src/unstable/reactivity/index.ts +0 -166
- package/src/unstable/rpc/Rpc.ts +47 -32
- package/src/unstable/rpc/RpcClient.ts +58 -34
- package/src/unstable/rpc/RpcClientError.ts +29 -15
- package/src/unstable/rpc/RpcGroup.ts +28 -17
- package/src/unstable/rpc/RpcMessage.ts +37 -19
- package/src/unstable/rpc/RpcMiddleware.ts +31 -21
- package/src/unstable/rpc/RpcSchema.ts +30 -20
- package/src/unstable/rpc/RpcSerialization.ts +48 -31
- package/src/unstable/rpc/RpcServer.ts +53 -40
- package/src/unstable/rpc/RpcTest.ts +29 -13
- package/src/unstable/rpc/RpcWorker.ts +29 -14
- package/src/unstable/rpc/index.ts +0 -272
- package/src/unstable/schema/Model.ts +32 -33
- package/src/unstable/schema/VariantSchema.ts +1 -1
- package/src/unstable/schema/index.ts +0 -37
- package/src/unstable/socket/Socket.ts +8 -2
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/socket/index.ts +0 -44
- package/src/unstable/sql/Migrator.ts +39 -18
- package/src/unstable/sql/SqlClient.ts +7 -2
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/SqlError.ts +33 -17
- package/src/unstable/sql/SqlResolver.ts +3 -3
- package/src/unstable/sql/SqlSchema.ts +51 -21
- package/src/unstable/sql/Statement.ts +35 -15
- package/src/unstable/sql/index.ts +0 -178
- package/src/unstable/workers/Transferable.ts +32 -21
- package/src/unstable/workers/Worker.ts +35 -22
- package/src/unstable/workers/WorkerError.ts +35 -19
- package/src/unstable/workers/WorkerRunner.ts +29 -18
- package/src/unstable/workers/index.ts +0 -80
- package/src/unstable/workflow/DurableClock.ts +25 -13
- package/src/unstable/workflow/DurableDeferred.ts +12 -12
- package/src/unstable/workflow/DurableQueue.ts +34 -16
- package/src/unstable/workflow/Workflow.ts +22 -23
- package/src/unstable/workflow/WorkflowEngine.ts +26 -8
- package/src/unstable/workflow/index.ts +0 -160
package/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
|
|
@@ -83,7 +132,11 @@ const BigDecimalProto: Omit<BigDecimal, "value" | "scale" | "normalized"> = {
|
|
|
83
132
|
} as const
|
|
84
133
|
|
|
85
134
|
/**
|
|
86
|
-
* Checks
|
|
135
|
+
* Checks whether a given value is a `BigDecimal`.
|
|
136
|
+
*
|
|
137
|
+
* **When to use**
|
|
138
|
+
*
|
|
139
|
+
* Use to validate unknown input and narrow it to `BigDecimal`.
|
|
87
140
|
*
|
|
88
141
|
* **Example** (Checking BigDecimal values)
|
|
89
142
|
*
|
|
@@ -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
|
*/
|
|
@@ -205,7 +272,11 @@ export const normalize = (self: BigDecimal): BigDecimal => {
|
|
|
205
272
|
}
|
|
206
273
|
|
|
207
274
|
/**
|
|
208
|
-
*
|
|
275
|
+
* Changes a `BigDecimal` to the specified scale.
|
|
276
|
+
*
|
|
277
|
+
* **When to use**
|
|
278
|
+
*
|
|
279
|
+
* Use to change how many decimal places are represented by a `BigDecimal`.
|
|
209
280
|
*
|
|
210
281
|
* **Details**
|
|
211
282
|
*
|
|
@@ -229,12 +300,18 @@ 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
|
*/
|
|
235
308
|
export const scale: {
|
|
236
309
|
/**
|
|
237
|
-
*
|
|
310
|
+
* Changes a `BigDecimal` to the specified scale.
|
|
311
|
+
*
|
|
312
|
+
* **When to use**
|
|
313
|
+
*
|
|
314
|
+
* Use to change how many decimal places are represented by a `BigDecimal`.
|
|
238
315
|
*
|
|
239
316
|
* **Details**
|
|
240
317
|
*
|
|
@@ -258,12 +335,18 @@ 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
|
*/
|
|
264
343
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
265
344
|
/**
|
|
266
|
-
*
|
|
345
|
+
* Changes a `BigDecimal` to the specified scale.
|
|
346
|
+
*
|
|
347
|
+
* **When to use**
|
|
348
|
+
*
|
|
349
|
+
* Use to change how many decimal places are represented by a `BigDecimal`.
|
|
267
350
|
*
|
|
268
351
|
* **Details**
|
|
269
352
|
*
|
|
@@ -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
|
|
@@ -646,7 +791,12 @@ export const roundTerminal = (n: bigint): bigint => {
|
|
|
646
791
|
}
|
|
647
792
|
|
|
648
793
|
/**
|
|
649
|
-
*
|
|
794
|
+
* Divides `BigDecimal`s safely.
|
|
795
|
+
*
|
|
796
|
+
* **When to use**
|
|
797
|
+
*
|
|
798
|
+
* Use to divide `BigDecimal` values while representing division by zero as
|
|
799
|
+
* `Option.none`.
|
|
650
800
|
*
|
|
651
801
|
* **Details**
|
|
652
802
|
*
|
|
@@ -685,12 +835,20 @@ 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
|
*/
|
|
691
844
|
export const divide: {
|
|
692
845
|
/**
|
|
693
|
-
*
|
|
846
|
+
* Divides `BigDecimal`s safely.
|
|
847
|
+
*
|
|
848
|
+
* **When to use**
|
|
849
|
+
*
|
|
850
|
+
* Use to divide `BigDecimal` values while representing division by zero as
|
|
851
|
+
* `Option.none`.
|
|
694
852
|
*
|
|
695
853
|
* **Details**
|
|
696
854
|
*
|
|
@@ -729,12 +887,20 @@ 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
|
*/
|
|
735
896
|
(that: BigDecimal): (self: BigDecimal) => Option.Option<BigDecimal>
|
|
736
897
|
/**
|
|
737
|
-
*
|
|
898
|
+
* Divides `BigDecimal`s safely.
|
|
899
|
+
*
|
|
900
|
+
* **When to use**
|
|
901
|
+
*
|
|
902
|
+
* Use to divide `BigDecimal` values while representing division by zero as
|
|
903
|
+
* `Option.none`.
|
|
738
904
|
*
|
|
739
905
|
* **Details**
|
|
740
906
|
*
|
|
@@ -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 you need the decimal quotient and the divisor is known to be
|
|
972
|
+
* non-zero, so division by zero should be a 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 you need the decimal quotient and the divisor is known to be
|
|
1004
|
+
* non-zero, so division by zero should be a 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 you need the decimal quotient and the divisor is known to be
|
|
1036
|
+
* non-zero, so division by zero should be a 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,11 @@ 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 sorting or comparing decimal values through APIs that accept an
|
|
1084
|
+
* ordering instance.
|
|
1085
|
+
*
|
|
891
1086
|
* **Example** (Comparing decimals)
|
|
892
1087
|
*
|
|
893
1088
|
* ```ts
|
|
@@ -925,6 +1120,10 @@ export const Order: order.Order<BigDecimal> = order.make((self, that) => {
|
|
|
925
1120
|
/**
|
|
926
1121
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
927
1122
|
*
|
|
1123
|
+
* **When to use**
|
|
1124
|
+
*
|
|
1125
|
+
* Use to test whether one `BigDecimal` is strictly less than another.
|
|
1126
|
+
*
|
|
928
1127
|
* **Example** (Checking less-than comparisons)
|
|
929
1128
|
*
|
|
930
1129
|
* ```ts
|
|
@@ -952,6 +1151,10 @@ export const isLessThan: {
|
|
|
952
1151
|
/**
|
|
953
1152
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
954
1153
|
*
|
|
1154
|
+
* **When to use**
|
|
1155
|
+
*
|
|
1156
|
+
* Use to test whether one `BigDecimal` is strictly less than another.
|
|
1157
|
+
*
|
|
955
1158
|
* **Example** (Checking less-than comparisons)
|
|
956
1159
|
*
|
|
957
1160
|
* ```ts
|
|
@@ -979,6 +1182,10 @@ export const isLessThan: {
|
|
|
979
1182
|
/**
|
|
980
1183
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
981
1184
|
*
|
|
1185
|
+
* **When to use**
|
|
1186
|
+
*
|
|
1187
|
+
* Use to test whether one `BigDecimal` is strictly less than another.
|
|
1188
|
+
*
|
|
982
1189
|
* **Example** (Checking less-than comparisons)
|
|
983
1190
|
*
|
|
984
1191
|
* ```ts
|
|
@@ -1006,7 +1213,11 @@ export const isLessThan: {
|
|
|
1006
1213
|
} = order.isLessThan(Order)
|
|
1007
1214
|
|
|
1008
1215
|
/**
|
|
1009
|
-
* Checks
|
|
1216
|
+
* Checks whether a given `BigDecimal` is less than or equal to the provided one.
|
|
1217
|
+
*
|
|
1218
|
+
* **When to use**
|
|
1219
|
+
*
|
|
1220
|
+
* Use to test whether one `BigDecimal` is less than or equal to another.
|
|
1010
1221
|
*
|
|
1011
1222
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1012
1223
|
*
|
|
@@ -1033,7 +1244,11 @@ export const isLessThan: {
|
|
|
1033
1244
|
*/
|
|
1034
1245
|
export const isLessThanOrEqualTo: {
|
|
1035
1246
|
/**
|
|
1036
|
-
* Checks
|
|
1247
|
+
* Checks whether a given `BigDecimal` is less than or equal to the provided one.
|
|
1248
|
+
*
|
|
1249
|
+
* **When to use**
|
|
1250
|
+
*
|
|
1251
|
+
* Use to test whether one `BigDecimal` is less than or equal to another.
|
|
1037
1252
|
*
|
|
1038
1253
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1039
1254
|
*
|
|
@@ -1060,7 +1275,11 @@ export const isLessThanOrEqualTo: {
|
|
|
1060
1275
|
*/
|
|
1061
1276
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
1062
1277
|
/**
|
|
1063
|
-
* Checks
|
|
1278
|
+
* Checks whether a given `BigDecimal` is less than or equal to the provided one.
|
|
1279
|
+
*
|
|
1280
|
+
* **When to use**
|
|
1281
|
+
*
|
|
1282
|
+
* Use to test whether one `BigDecimal` is less than or equal to another.
|
|
1064
1283
|
*
|
|
1065
1284
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1066
1285
|
*
|
|
@@ -1091,6 +1310,10 @@ export const isLessThanOrEqualTo: {
|
|
|
1091
1310
|
/**
|
|
1092
1311
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
1093
1312
|
*
|
|
1313
|
+
* **When to use**
|
|
1314
|
+
*
|
|
1315
|
+
* Use to test whether one `BigDecimal` is strictly greater than another.
|
|
1316
|
+
*
|
|
1094
1317
|
* **Example** (Checking greater-than comparisons)
|
|
1095
1318
|
*
|
|
1096
1319
|
* ```ts
|
|
@@ -1118,6 +1341,10 @@ export const isGreaterThan: {
|
|
|
1118
1341
|
/**
|
|
1119
1342
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
1120
1343
|
*
|
|
1344
|
+
* **When to use**
|
|
1345
|
+
*
|
|
1346
|
+
* Use to test whether one `BigDecimal` is strictly greater than another.
|
|
1347
|
+
*
|
|
1121
1348
|
* **Example** (Checking greater-than comparisons)
|
|
1122
1349
|
*
|
|
1123
1350
|
* ```ts
|
|
@@ -1145,6 +1372,10 @@ export const isGreaterThan: {
|
|
|
1145
1372
|
/**
|
|
1146
1373
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
1147
1374
|
*
|
|
1375
|
+
* **When to use**
|
|
1376
|
+
*
|
|
1377
|
+
* Use to test whether one `BigDecimal` is strictly greater than another.
|
|
1378
|
+
*
|
|
1148
1379
|
* **Example** (Checking greater-than comparisons)
|
|
1149
1380
|
*
|
|
1150
1381
|
* ```ts
|
|
@@ -1172,7 +1403,11 @@ export const isGreaterThan: {
|
|
|
1172
1403
|
} = order.isGreaterThan(Order)
|
|
1173
1404
|
|
|
1174
1405
|
/**
|
|
1175
|
-
* Checks
|
|
1406
|
+
* Checks whether a given `BigDecimal` is greater than or equal to the provided one.
|
|
1407
|
+
*
|
|
1408
|
+
* **When to use**
|
|
1409
|
+
*
|
|
1410
|
+
* Use to test whether one `BigDecimal` is greater than or equal to another.
|
|
1176
1411
|
*
|
|
1177
1412
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1178
1413
|
*
|
|
@@ -1199,7 +1434,11 @@ export const isGreaterThan: {
|
|
|
1199
1434
|
*/
|
|
1200
1435
|
export const isGreaterThanOrEqualTo: {
|
|
1201
1436
|
/**
|
|
1202
|
-
* Checks
|
|
1437
|
+
* Checks whether a given `BigDecimal` is greater than or equal to the provided one.
|
|
1438
|
+
*
|
|
1439
|
+
* **When to use**
|
|
1440
|
+
*
|
|
1441
|
+
* Use to test whether one `BigDecimal` is greater than or equal to another.
|
|
1203
1442
|
*
|
|
1204
1443
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1205
1444
|
*
|
|
@@ -1226,7 +1465,11 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1226
1465
|
*/
|
|
1227
1466
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
1228
1467
|
/**
|
|
1229
|
-
* Checks
|
|
1468
|
+
* Checks whether a given `BigDecimal` is greater than or equal to the provided one.
|
|
1469
|
+
*
|
|
1470
|
+
* **When to use**
|
|
1471
|
+
*
|
|
1472
|
+
* Use to test whether one `BigDecimal` is greater than or equal to another.
|
|
1230
1473
|
*
|
|
1231
1474
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1232
1475
|
*
|
|
@@ -1255,7 +1498,11 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1255
1498
|
} = order.isGreaterThanOrEqualTo(Order)
|
|
1256
1499
|
|
|
1257
1500
|
/**
|
|
1258
|
-
* Checks
|
|
1501
|
+
* Checks whether a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
|
|
1502
|
+
*
|
|
1503
|
+
* **When to use**
|
|
1504
|
+
*
|
|
1505
|
+
* Use to test whether a `BigDecimal` falls inside an inclusive range.
|
|
1259
1506
|
*
|
|
1260
1507
|
* **Example** (Checking decimal ranges)
|
|
1261
1508
|
*
|
|
@@ -1273,12 +1520,18 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1273
1520
|
* assert.deepStrictEqual(between(BigDecimal.fromStringUnsafe("6")), false)
|
|
1274
1521
|
* ```
|
|
1275
1522
|
*
|
|
1523
|
+
* @see {@link clamp} for forcing a `BigDecimal` into an inclusive range
|
|
1524
|
+
*
|
|
1276
1525
|
* @category predicates
|
|
1277
1526
|
* @since 2.0.0
|
|
1278
1527
|
*/
|
|
1279
1528
|
export const between: {
|
|
1280
1529
|
/**
|
|
1281
|
-
* Checks
|
|
1530
|
+
* Checks whether a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
|
|
1531
|
+
*
|
|
1532
|
+
* **When to use**
|
|
1533
|
+
*
|
|
1534
|
+
* Use to test whether a `BigDecimal` falls inside an inclusive range.
|
|
1282
1535
|
*
|
|
1283
1536
|
* **Example** (Checking decimal ranges)
|
|
1284
1537
|
*
|
|
@@ -1296,6 +1549,8 @@ export const between: {
|
|
|
1296
1549
|
* assert.deepStrictEqual(between(BigDecimal.fromStringUnsafe("6")), false)
|
|
1297
1550
|
* ```
|
|
1298
1551
|
*
|
|
1552
|
+
* @see {@link clamp} for forcing a `BigDecimal` into an inclusive range
|
|
1553
|
+
*
|
|
1299
1554
|
* @category predicates
|
|
1300
1555
|
* @since 2.0.0
|
|
1301
1556
|
*/
|
|
@@ -1306,7 +1561,11 @@ export const between: {
|
|
|
1306
1561
|
}
|
|
1307
1562
|
): (self: BigDecimal) => boolean
|
|
1308
1563
|
/**
|
|
1309
|
-
* Checks
|
|
1564
|
+
* Checks whether a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
|
|
1565
|
+
*
|
|
1566
|
+
* **When to use**
|
|
1567
|
+
*
|
|
1568
|
+
* Use to test whether a `BigDecimal` falls inside an inclusive range.
|
|
1310
1569
|
*
|
|
1311
1570
|
* **Example** (Checking decimal ranges)
|
|
1312
1571
|
*
|
|
@@ -1324,6 +1583,8 @@ export const between: {
|
|
|
1324
1583
|
* assert.deepStrictEqual(between(BigDecimal.fromStringUnsafe("6")), false)
|
|
1325
1584
|
* ```
|
|
1326
1585
|
*
|
|
1586
|
+
* @see {@link clamp} for forcing a `BigDecimal` into an inclusive range
|
|
1587
|
+
*
|
|
1327
1588
|
* @category predicates
|
|
1328
1589
|
* @since 2.0.0
|
|
1329
1590
|
*/
|
|
@@ -1339,6 +1600,10 @@ export const between: {
|
|
|
1339
1600
|
/**
|
|
1340
1601
|
* Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
|
|
1341
1602
|
*
|
|
1603
|
+
* **When to use**
|
|
1604
|
+
*
|
|
1605
|
+
* Use to force a `BigDecimal` into an inclusive range.
|
|
1606
|
+
*
|
|
1342
1607
|
* **Details**
|
|
1343
1608
|
*
|
|
1344
1609
|
* If the `BigDecimal` is less than the `minimum` value, the function returns
|
|
@@ -1370,6 +1635,8 @@ export const between: {
|
|
|
1370
1635
|
* )
|
|
1371
1636
|
* ```
|
|
1372
1637
|
*
|
|
1638
|
+
* @see {@link between} for checking whether a `BigDecimal` is already inside a range
|
|
1639
|
+
*
|
|
1373
1640
|
* @category math
|
|
1374
1641
|
* @since 2.0.0
|
|
1375
1642
|
*/
|
|
@@ -1377,6 +1644,10 @@ export const clamp: {
|
|
|
1377
1644
|
/**
|
|
1378
1645
|
* Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
|
|
1379
1646
|
*
|
|
1647
|
+
* **When to use**
|
|
1648
|
+
*
|
|
1649
|
+
* Use to force a `BigDecimal` into an inclusive range.
|
|
1650
|
+
*
|
|
1380
1651
|
* **Details**
|
|
1381
1652
|
*
|
|
1382
1653
|
* If the `BigDecimal` is less than the `minimum` value, the function returns
|
|
@@ -1408,6 +1679,8 @@ export const clamp: {
|
|
|
1408
1679
|
* )
|
|
1409
1680
|
* ```
|
|
1410
1681
|
*
|
|
1682
|
+
* @see {@link between} for checking whether a `BigDecimal` is already inside a range
|
|
1683
|
+
*
|
|
1411
1684
|
* @category math
|
|
1412
1685
|
* @since 2.0.0
|
|
1413
1686
|
*/
|
|
@@ -1420,6 +1693,10 @@ export const clamp: {
|
|
|
1420
1693
|
/**
|
|
1421
1694
|
* Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
|
|
1422
1695
|
*
|
|
1696
|
+
* **When to use**
|
|
1697
|
+
*
|
|
1698
|
+
* Use to force a `BigDecimal` into an inclusive range.
|
|
1699
|
+
*
|
|
1423
1700
|
* **Details**
|
|
1424
1701
|
*
|
|
1425
1702
|
* If the `BigDecimal` is less than the `minimum` value, the function returns
|
|
@@ -1451,6 +1728,8 @@ export const clamp: {
|
|
|
1451
1728
|
* )
|
|
1452
1729
|
* ```
|
|
1453
1730
|
*
|
|
1731
|
+
* @see {@link between} for checking whether a `BigDecimal` is already inside a range
|
|
1732
|
+
*
|
|
1454
1733
|
* @category math
|
|
1455
1734
|
* @since 2.0.0
|
|
1456
1735
|
*/
|
|
@@ -1466,6 +1745,10 @@ export const clamp: {
|
|
|
1466
1745
|
/**
|
|
1467
1746
|
* Returns the minimum between two `BigDecimal`s.
|
|
1468
1747
|
*
|
|
1748
|
+
* **When to use**
|
|
1749
|
+
*
|
|
1750
|
+
* Use to select the smaller of two `BigDecimal` values.
|
|
1751
|
+
*
|
|
1469
1752
|
* **Example** (Selecting the smaller decimal)
|
|
1470
1753
|
*
|
|
1471
1754
|
* ```ts
|
|
@@ -1478,6 +1761,8 @@ export const clamp: {
|
|
|
1478
1761
|
* )
|
|
1479
1762
|
* ```
|
|
1480
1763
|
*
|
|
1764
|
+
* @see {@link max} for selecting the larger value
|
|
1765
|
+
*
|
|
1481
1766
|
* @category math
|
|
1482
1767
|
* @since 2.0.0
|
|
1483
1768
|
*/
|
|
@@ -1485,6 +1770,10 @@ export const min: {
|
|
|
1485
1770
|
/**
|
|
1486
1771
|
* Returns the minimum between two `BigDecimal`s.
|
|
1487
1772
|
*
|
|
1773
|
+
* **When to use**
|
|
1774
|
+
*
|
|
1775
|
+
* Use to select the smaller of two `BigDecimal` values.
|
|
1776
|
+
*
|
|
1488
1777
|
* **Example** (Selecting the smaller decimal)
|
|
1489
1778
|
*
|
|
1490
1779
|
* ```ts
|
|
@@ -1497,6 +1786,8 @@ export const min: {
|
|
|
1497
1786
|
* )
|
|
1498
1787
|
* ```
|
|
1499
1788
|
*
|
|
1789
|
+
* @see {@link max} for selecting the larger value
|
|
1790
|
+
*
|
|
1500
1791
|
* @category math
|
|
1501
1792
|
* @since 2.0.0
|
|
1502
1793
|
*/
|
|
@@ -1504,6 +1795,10 @@ export const min: {
|
|
|
1504
1795
|
/**
|
|
1505
1796
|
* Returns the minimum between two `BigDecimal`s.
|
|
1506
1797
|
*
|
|
1798
|
+
* **When to use**
|
|
1799
|
+
*
|
|
1800
|
+
* Use to select the smaller of two `BigDecimal` values.
|
|
1801
|
+
*
|
|
1507
1802
|
* **Example** (Selecting the smaller decimal)
|
|
1508
1803
|
*
|
|
1509
1804
|
* ```ts
|
|
@@ -1516,6 +1811,8 @@ export const min: {
|
|
|
1516
1811
|
* )
|
|
1517
1812
|
* ```
|
|
1518
1813
|
*
|
|
1814
|
+
* @see {@link max} for selecting the larger value
|
|
1815
|
+
*
|
|
1519
1816
|
* @category math
|
|
1520
1817
|
* @since 2.0.0
|
|
1521
1818
|
*/
|
|
@@ -1525,6 +1822,10 @@ export const min: {
|
|
|
1525
1822
|
/**
|
|
1526
1823
|
* Returns the maximum between two `BigDecimal`s.
|
|
1527
1824
|
*
|
|
1825
|
+
* **When to use**
|
|
1826
|
+
*
|
|
1827
|
+
* Use to select the larger of two `BigDecimal` values.
|
|
1828
|
+
*
|
|
1528
1829
|
* **Example** (Selecting the larger decimal)
|
|
1529
1830
|
*
|
|
1530
1831
|
* ```ts
|
|
@@ -1537,6 +1838,8 @@ export const min: {
|
|
|
1537
1838
|
* )
|
|
1538
1839
|
* ```
|
|
1539
1840
|
*
|
|
1841
|
+
* @see {@link min} for selecting the smaller value
|
|
1842
|
+
*
|
|
1540
1843
|
* @category math
|
|
1541
1844
|
* @since 2.0.0
|
|
1542
1845
|
*/
|
|
@@ -1544,6 +1847,10 @@ export const max: {
|
|
|
1544
1847
|
/**
|
|
1545
1848
|
* Returns the maximum between two `BigDecimal`s.
|
|
1546
1849
|
*
|
|
1850
|
+
* **When to use**
|
|
1851
|
+
*
|
|
1852
|
+
* Use to select the larger of two `BigDecimal` values.
|
|
1853
|
+
*
|
|
1547
1854
|
* **Example** (Selecting the larger decimal)
|
|
1548
1855
|
*
|
|
1549
1856
|
* ```ts
|
|
@@ -1556,6 +1863,8 @@ export const max: {
|
|
|
1556
1863
|
* )
|
|
1557
1864
|
* ```
|
|
1558
1865
|
*
|
|
1866
|
+
* @see {@link min} for selecting the smaller value
|
|
1867
|
+
*
|
|
1559
1868
|
* @category math
|
|
1560
1869
|
* @since 2.0.0
|
|
1561
1870
|
*/
|
|
@@ -1563,6 +1872,10 @@ export const max: {
|
|
|
1563
1872
|
/**
|
|
1564
1873
|
* Returns the maximum between two `BigDecimal`s.
|
|
1565
1874
|
*
|
|
1875
|
+
* **When to use**
|
|
1876
|
+
*
|
|
1877
|
+
* Use to select the larger of two `BigDecimal` values.
|
|
1878
|
+
*
|
|
1566
1879
|
* **Example** (Selecting the larger decimal)
|
|
1567
1880
|
*
|
|
1568
1881
|
* ```ts
|
|
@@ -1575,6 +1888,8 @@ export const max: {
|
|
|
1575
1888
|
* )
|
|
1576
1889
|
* ```
|
|
1577
1890
|
*
|
|
1891
|
+
* @see {@link min} for selecting the smaller value
|
|
1892
|
+
*
|
|
1578
1893
|
* @category math
|
|
1579
1894
|
* @since 2.0.0
|
|
1580
1895
|
*/
|
|
@@ -1584,6 +1899,10 @@ export const max: {
|
|
|
1584
1899
|
/**
|
|
1585
1900
|
* Determines the sign of a given `BigDecimal`.
|
|
1586
1901
|
*
|
|
1902
|
+
* **When to use**
|
|
1903
|
+
*
|
|
1904
|
+
* Use to classify a `BigDecimal` as negative, zero, or positive.
|
|
1905
|
+
*
|
|
1587
1906
|
* **Example** (Reading decimal signs)
|
|
1588
1907
|
*
|
|
1589
1908
|
* ```ts
|
|
@@ -1603,6 +1922,10 @@ export const sign = (n: BigDecimal): Ordering => n.value === bigint0 ? 0 : n.val
|
|
|
1603
1922
|
/**
|
|
1604
1923
|
* Determines the absolute value of a given `BigDecimal`.
|
|
1605
1924
|
*
|
|
1925
|
+
* **When to use**
|
|
1926
|
+
*
|
|
1927
|
+
* Use to remove the sign from a `BigDecimal` while preserving its magnitude.
|
|
1928
|
+
*
|
|
1606
1929
|
* **Example** (Calculating absolute values)
|
|
1607
1930
|
*
|
|
1608
1931
|
* ```ts
|
|
@@ -1622,6 +1945,10 @@ export const abs = (n: BigDecimal): BigDecimal => n.value < bigint0 ? make(-n.va
|
|
|
1622
1945
|
/**
|
|
1623
1946
|
* Provides a negate operation on `BigDecimal`s.
|
|
1624
1947
|
*
|
|
1948
|
+
* **When to use**
|
|
1949
|
+
*
|
|
1950
|
+
* Use to flip the sign of a `BigDecimal`.
|
|
1951
|
+
*
|
|
1625
1952
|
* **Example** (Negating decimals)
|
|
1626
1953
|
*
|
|
1627
1954
|
* ```ts
|
|
@@ -1638,7 +1965,13 @@ export const abs = (n: BigDecimal): BigDecimal => n.value < bigint0 ? make(-n.va
|
|
|
1638
1965
|
export const negate = (n: BigDecimal): BigDecimal => make(-n.value, n.scale)
|
|
1639
1966
|
|
|
1640
1967
|
/**
|
|
1641
|
-
*
|
|
1968
|
+
* Computes the decimal remainder safely when one operand is divided by a second
|
|
1969
|
+
* operand.
|
|
1970
|
+
*
|
|
1971
|
+
* **When to use**
|
|
1972
|
+
*
|
|
1973
|
+
* Use to compute a decimal remainder while representing division by zero as
|
|
1974
|
+
* `Option.none`.
|
|
1642
1975
|
*
|
|
1643
1976
|
* **Details**
|
|
1644
1977
|
*
|
|
@@ -1673,12 +2006,21 @@ export const negate = (n: BigDecimal): BigDecimal => make(-n.value, n.scale)
|
|
|
1673
2006
|
* )
|
|
1674
2007
|
* ```
|
|
1675
2008
|
*
|
|
2009
|
+
* @see {@link remainderUnsafe} for remainder calculation that throws when the divisor is zero
|
|
2010
|
+
* @see {@link divide} for decimal quotient calculation
|
|
2011
|
+
*
|
|
1676
2012
|
* @category math
|
|
1677
2013
|
* @since 2.0.0
|
|
1678
2014
|
*/
|
|
1679
2015
|
export const remainder: {
|
|
1680
2016
|
/**
|
|
1681
|
-
*
|
|
2017
|
+
* Computes the decimal remainder safely when one operand is divided by a second
|
|
2018
|
+
* operand.
|
|
2019
|
+
*
|
|
2020
|
+
* **When to use**
|
|
2021
|
+
*
|
|
2022
|
+
* Use to compute a decimal remainder while representing division by zero as
|
|
2023
|
+
* `Option.none`.
|
|
1682
2024
|
*
|
|
1683
2025
|
* **Details**
|
|
1684
2026
|
*
|
|
@@ -1713,12 +2055,21 @@ export const remainder: {
|
|
|
1713
2055
|
* )
|
|
1714
2056
|
* ```
|
|
1715
2057
|
*
|
|
2058
|
+
* @see {@link remainderUnsafe} for remainder calculation that throws when the divisor is zero
|
|
2059
|
+
* @see {@link divide} for decimal quotient calculation
|
|
2060
|
+
*
|
|
1716
2061
|
* @category math
|
|
1717
2062
|
* @since 2.0.0
|
|
1718
2063
|
*/
|
|
1719
2064
|
(divisor: BigDecimal): (self: BigDecimal) => Option.Option<BigDecimal>
|
|
1720
2065
|
/**
|
|
1721
|
-
*
|
|
2066
|
+
* Computes the decimal remainder safely when one operand is divided by a second
|
|
2067
|
+
* operand.
|
|
2068
|
+
*
|
|
2069
|
+
* **When to use**
|
|
2070
|
+
*
|
|
2071
|
+
* Use to compute a decimal remainder while representing division by zero as
|
|
2072
|
+
* `Option.none`.
|
|
1722
2073
|
*
|
|
1723
2074
|
* **Details**
|
|
1724
2075
|
*
|
|
@@ -1753,6 +2104,9 @@ export const remainder: {
|
|
|
1753
2104
|
* )
|
|
1754
2105
|
* ```
|
|
1755
2106
|
*
|
|
2107
|
+
* @see {@link remainderUnsafe} for remainder calculation that throws when the divisor is zero
|
|
2108
|
+
* @see {@link divide} for decimal quotient calculation
|
|
2109
|
+
*
|
|
1756
2110
|
* @category math
|
|
1757
2111
|
* @since 2.0.0
|
|
1758
2112
|
*/
|
|
@@ -1767,7 +2121,13 @@ export const remainder: {
|
|
|
1767
2121
|
})
|
|
1768
2122
|
|
|
1769
2123
|
/**
|
|
1770
|
-
* Returns the remainder left over when one operand is divided by a
|
|
2124
|
+
* Returns the decimal remainder left over when one operand is divided by a
|
|
2125
|
+
* non-zero second operand, throwing for division by zero.
|
|
2126
|
+
*
|
|
2127
|
+
* **When to use**
|
|
2128
|
+
*
|
|
2129
|
+
* Use when you need the decimal remainder and the divisor is known to be
|
|
2130
|
+
* non-zero, so division by zero should be a thrown exception.
|
|
1771
2131
|
*
|
|
1772
2132
|
* **Gotchas**
|
|
1773
2133
|
*
|
|
@@ -1793,12 +2153,20 @@ export const remainder: {
|
|
|
1793
2153
|
* )
|
|
1794
2154
|
* ```
|
|
1795
2155
|
*
|
|
2156
|
+
* @see {@link remainder} for returning `Option.none` when the divisor is zero
|
|
2157
|
+
*
|
|
1796
2158
|
* @category math
|
|
1797
2159
|
* @since 4.0.0
|
|
1798
2160
|
*/
|
|
1799
2161
|
export const remainderUnsafe: {
|
|
1800
2162
|
/**
|
|
1801
|
-
* Returns the remainder left over when one operand is divided by a
|
|
2163
|
+
* Returns the decimal remainder left over when one operand is divided by a
|
|
2164
|
+
* non-zero second operand, throwing for division by zero.
|
|
2165
|
+
*
|
|
2166
|
+
* **When to use**
|
|
2167
|
+
*
|
|
2168
|
+
* Use when you need the decimal remainder and the divisor is known to be
|
|
2169
|
+
* non-zero, so division by zero should be a thrown exception.
|
|
1802
2170
|
*
|
|
1803
2171
|
* **Gotchas**
|
|
1804
2172
|
*
|
|
@@ -1824,12 +2192,20 @@ export const remainderUnsafe: {
|
|
|
1824
2192
|
* )
|
|
1825
2193
|
* ```
|
|
1826
2194
|
*
|
|
2195
|
+
* @see {@link remainder} for returning `Option.none` when the divisor is zero
|
|
2196
|
+
*
|
|
1827
2197
|
* @category math
|
|
1828
2198
|
* @since 4.0.0
|
|
1829
2199
|
*/
|
|
1830
2200
|
(divisor: BigDecimal): (self: BigDecimal) => BigDecimal
|
|
1831
2201
|
/**
|
|
1832
|
-
* Returns the remainder left over when one operand is divided by a
|
|
2202
|
+
* Returns the decimal remainder left over when one operand is divided by a
|
|
2203
|
+
* non-zero second operand, throwing for division by zero.
|
|
2204
|
+
*
|
|
2205
|
+
* **When to use**
|
|
2206
|
+
*
|
|
2207
|
+
* Use when you need the decimal remainder and the divisor is known to be
|
|
2208
|
+
* non-zero, so division by zero should be a thrown exception.
|
|
1833
2209
|
*
|
|
1834
2210
|
* **Gotchas**
|
|
1835
2211
|
*
|
|
@@ -1855,6 +2231,8 @@ export const remainderUnsafe: {
|
|
|
1855
2231
|
* )
|
|
1856
2232
|
* ```
|
|
1857
2233
|
*
|
|
2234
|
+
* @see {@link remainder} for returning `Option.none` when the divisor is zero
|
|
2235
|
+
*
|
|
1858
2236
|
* @category math
|
|
1859
2237
|
* @since 4.0.0
|
|
1860
2238
|
*/
|
|
@@ -1871,6 +2249,11 @@ export const remainderUnsafe: {
|
|
|
1871
2249
|
/**
|
|
1872
2250
|
* Provides an `Equivalence` instance for `BigDecimal` that determines equality between BigDecimal values.
|
|
1873
2251
|
*
|
|
2252
|
+
* **When to use**
|
|
2253
|
+
*
|
|
2254
|
+
* Use when comparing decimal values through APIs that accept an equivalence
|
|
2255
|
+
* relation.
|
|
2256
|
+
*
|
|
1874
2257
|
* **Example** (Checking decimal equivalence)
|
|
1875
2258
|
*
|
|
1876
2259
|
* ```ts
|
|
@@ -1900,7 +2283,11 @@ export const Equivalence: Equ.Equivalence<BigDecimal> = Equ.make((self, that) =>
|
|
|
1900
2283
|
})
|
|
1901
2284
|
|
|
1902
2285
|
/**
|
|
1903
|
-
* Checks
|
|
2286
|
+
* Checks whether two `BigDecimal`s are equal.
|
|
2287
|
+
*
|
|
2288
|
+
* **When to use**
|
|
2289
|
+
*
|
|
2290
|
+
* Use to compare two `BigDecimal` values for numeric equality.
|
|
1904
2291
|
*
|
|
1905
2292
|
* **Example** (Checking decimal equality)
|
|
1906
2293
|
*
|
|
@@ -1915,12 +2302,18 @@ export const Equivalence: Equ.Equivalence<BigDecimal> = Equ.make((self, that) =>
|
|
|
1915
2302
|
* console.log(BigDecimal.equals(a, c)) // false
|
|
1916
2303
|
* ```
|
|
1917
2304
|
*
|
|
2305
|
+
* @see {@link Equivalence} for passing decimal equality to APIs that require an `Equivalence`
|
|
2306
|
+
*
|
|
1918
2307
|
* @category predicates
|
|
1919
2308
|
* @since 2.0.0
|
|
1920
2309
|
*/
|
|
1921
2310
|
export const equals: {
|
|
1922
2311
|
/**
|
|
1923
|
-
* Checks
|
|
2312
|
+
* Checks whether two `BigDecimal`s are equal.
|
|
2313
|
+
*
|
|
2314
|
+
* **When to use**
|
|
2315
|
+
*
|
|
2316
|
+
* Use to compare two `BigDecimal` values for numeric equality.
|
|
1924
2317
|
*
|
|
1925
2318
|
* **Example** (Checking decimal equality)
|
|
1926
2319
|
*
|
|
@@ -1935,12 +2328,18 @@ export const equals: {
|
|
|
1935
2328
|
* console.log(BigDecimal.equals(a, c)) // false
|
|
1936
2329
|
* ```
|
|
1937
2330
|
*
|
|
2331
|
+
* @see {@link Equivalence} for passing decimal equality to APIs that require an `Equivalence`
|
|
2332
|
+
*
|
|
1938
2333
|
* @category predicates
|
|
1939
2334
|
* @since 2.0.0
|
|
1940
2335
|
*/
|
|
1941
2336
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
1942
2337
|
/**
|
|
1943
|
-
* Checks
|
|
2338
|
+
* Checks whether two `BigDecimal`s are equal.
|
|
2339
|
+
*
|
|
2340
|
+
* **When to use**
|
|
2341
|
+
*
|
|
2342
|
+
* Use to compare two `BigDecimal` values for numeric equality.
|
|
1944
2343
|
*
|
|
1945
2344
|
* **Example** (Checking decimal equality)
|
|
1946
2345
|
*
|
|
@@ -1955,6 +2354,8 @@ export const equals: {
|
|
|
1955
2354
|
* console.log(BigDecimal.equals(a, c)) // false
|
|
1956
2355
|
* ```
|
|
1957
2356
|
*
|
|
2357
|
+
* @see {@link Equivalence} for passing decimal equality to APIs that require an `Equivalence`
|
|
2358
|
+
*
|
|
1958
2359
|
* @category predicates
|
|
1959
2360
|
* @since 2.0.0
|
|
1960
2361
|
*/
|
|
@@ -1964,6 +2365,10 @@ export const equals: {
|
|
|
1964
2365
|
/**
|
|
1965
2366
|
* Creates a `BigDecimal` from a `bigint` value.
|
|
1966
2367
|
*
|
|
2368
|
+
* **When to use**
|
|
2369
|
+
*
|
|
2370
|
+
* Use to construct an integer `BigDecimal` from a `bigint`.
|
|
2371
|
+
*
|
|
1967
2372
|
* **Example** (Creating decimals from bigint)
|
|
1968
2373
|
*
|
|
1969
2374
|
* ```ts
|
|
@@ -1976,13 +2381,20 @@ export const equals: {
|
|
|
1976
2381
|
* console.log(BigDecimal.format(largeBigInt)) // "9007199254740991"
|
|
1977
2382
|
* ```
|
|
1978
2383
|
*
|
|
2384
|
+
* @see {@link make} for constructing a decimal with an explicit scale
|
|
2385
|
+
*
|
|
1979
2386
|
* @category constructors
|
|
1980
2387
|
* @since 2.0.0
|
|
1981
2388
|
*/
|
|
1982
2389
|
export const fromBigInt = (n: bigint): BigDecimal => make(n, 0)
|
|
1983
2390
|
|
|
1984
2391
|
/**
|
|
1985
|
-
* Creates a `BigDecimal` from a `number
|
|
2392
|
+
* Creates a `BigDecimal` from a finite `number`, throwing for non-finite input.
|
|
2393
|
+
*
|
|
2394
|
+
* **When to use**
|
|
2395
|
+
*
|
|
2396
|
+
* Use when a finite JavaScript number must become a `BigDecimal` and invalid
|
|
2397
|
+
* input should throw.
|
|
1986
2398
|
*
|
|
1987
2399
|
* **Gotchas**
|
|
1988
2400
|
*
|
|
@@ -2000,6 +2412,8 @@ export const fromBigInt = (n: bigint): BigDecimal => make(n, 0)
|
|
|
2000
2412
|
* assert.deepStrictEqual(BigDecimal.fromNumberUnsafe(123.456), BigDecimal.make(123456n, 3))
|
|
2001
2413
|
* ```
|
|
2002
2414
|
*
|
|
2415
|
+
* @see {@link fromNumber} for returning `Option.none` when the number is not finite
|
|
2416
|
+
*
|
|
2003
2417
|
* @category constructors
|
|
2004
2418
|
* @since 4.0.0
|
|
2005
2419
|
*/
|
|
@@ -2008,7 +2422,12 @@ export const fromNumberUnsafe = (n: number): BigDecimal => {
|
|
|
2008
2422
|
}
|
|
2009
2423
|
|
|
2010
2424
|
/**
|
|
2011
|
-
* Creates a `BigDecimal` from a `number
|
|
2425
|
+
* Creates a `BigDecimal` safely from a finite `number`.
|
|
2426
|
+
*
|
|
2427
|
+
* **When to use**
|
|
2428
|
+
*
|
|
2429
|
+
* Use to convert a finite JavaScript number to a `BigDecimal` without throwing
|
|
2430
|
+
* on invalid input.
|
|
2012
2431
|
*
|
|
2013
2432
|
* **Details**
|
|
2014
2433
|
*
|
|
@@ -2033,6 +2452,9 @@ export const fromNumberUnsafe = (n: number): BigDecimal => {
|
|
|
2033
2452
|
* assert.deepStrictEqual(BigDecimal.fromNumber(Infinity), Option.none())
|
|
2034
2453
|
* ```
|
|
2035
2454
|
*
|
|
2455
|
+
* @see {@link fromNumberUnsafe} for throwing when the number is not finite
|
|
2456
|
+
* @see {@link fromString} for parsing decimal strings directly
|
|
2457
|
+
*
|
|
2036
2458
|
* @category constructors
|
|
2037
2459
|
* @since 2.0.0
|
|
2038
2460
|
*/
|
|
@@ -2051,7 +2473,11 @@ export const fromNumber = (n: number): Option.Option<BigDecimal> => {
|
|
|
2051
2473
|
}
|
|
2052
2474
|
|
|
2053
2475
|
/**
|
|
2054
|
-
*
|
|
2476
|
+
* Parses a decimal string into a `BigDecimal` safely.
|
|
2477
|
+
*
|
|
2478
|
+
* **When to use**
|
|
2479
|
+
*
|
|
2480
|
+
* Use to parse external decimal text without throwing on invalid input.
|
|
2055
2481
|
*
|
|
2056
2482
|
* **Details**
|
|
2057
2483
|
*
|
|
@@ -2073,6 +2499,9 @@ export const fromNumber = (n: number): Option.Option<BigDecimal> => {
|
|
|
2073
2499
|
* assert.deepStrictEqual(BigDecimal.fromString("123.abc"), Option.none())
|
|
2074
2500
|
* ```
|
|
2075
2501
|
*
|
|
2502
|
+
* @see {@link fromStringUnsafe} for parsing that throws on invalid input
|
|
2503
|
+
* @see {@link fromNumber} for converting finite JavaScript numbers
|
|
2504
|
+
*
|
|
2076
2505
|
* @category constructors
|
|
2077
2506
|
* @since 2.0.0
|
|
2078
2507
|
*/
|
|
@@ -2125,6 +2554,10 @@ export const fromString = (s: string): Option.Option<BigDecimal> => {
|
|
|
2125
2554
|
* Parses a decimal string into a `BigDecimal`, throwing if the string is
|
|
2126
2555
|
* invalid.
|
|
2127
2556
|
*
|
|
2557
|
+
* **When to use**
|
|
2558
|
+
*
|
|
2559
|
+
* Use when decimal text is expected to be valid and parse errors should throw.
|
|
2560
|
+
*
|
|
2128
2561
|
* **Details**
|
|
2129
2562
|
*
|
|
2130
2563
|
* Accepts the same syntax as `fromString`. Use `fromString` when invalid input
|
|
@@ -2141,6 +2574,8 @@ export const fromString = (s: string): Option.Option<BigDecimal> => {
|
|
|
2141
2574
|
* assert.throws(() => BigDecimal.fromStringUnsafe("123.abc"))
|
|
2142
2575
|
* ```
|
|
2143
2576
|
*
|
|
2577
|
+
* @see {@link fromString} for returning `Option.none` on invalid input
|
|
2578
|
+
*
|
|
2144
2579
|
* @category constructors
|
|
2145
2580
|
* @since 4.0.0
|
|
2146
2581
|
*/
|
|
@@ -2151,6 +2586,10 @@ export const fromStringUnsafe = (s: string): BigDecimal => {
|
|
|
2151
2586
|
/**
|
|
2152
2587
|
* Formats a `BigDecimal` as a string.
|
|
2153
2588
|
*
|
|
2589
|
+
* **When to use**
|
|
2590
|
+
*
|
|
2591
|
+
* Use to render a `BigDecimal` as plain decimal text when possible.
|
|
2592
|
+
*
|
|
2154
2593
|
* **Details**
|
|
2155
2594
|
*
|
|
2156
2595
|
* The value is normalized before formatting. Scientific notation is used when
|
|
@@ -2168,6 +2607,8 @@ export const fromStringUnsafe = (s: string): BigDecimal => {
|
|
|
2168
2607
|
* assert.deepStrictEqual(BigDecimal.format(BigDecimal.fromStringUnsafe("-0.00000123")), "-0.00000123")
|
|
2169
2608
|
* ```
|
|
2170
2609
|
*
|
|
2610
|
+
* @see {@link toExponential} for always rendering scientific notation
|
|
2611
|
+
*
|
|
2171
2612
|
* @category converting
|
|
2172
2613
|
* @since 2.0.0
|
|
2173
2614
|
*/
|
|
@@ -2205,6 +2646,10 @@ export const format = (n: BigDecimal): string => {
|
|
|
2205
2646
|
/**
|
|
2206
2647
|
* Formats a given `BigDecimal` as a `string` in scientific notation.
|
|
2207
2648
|
*
|
|
2649
|
+
* **When to use**
|
|
2650
|
+
*
|
|
2651
|
+
* Use to render a `BigDecimal` in scientific notation.
|
|
2652
|
+
*
|
|
2208
2653
|
* **Example** (Formatting decimals exponentially)
|
|
2209
2654
|
*
|
|
2210
2655
|
* ```ts
|
|
@@ -2214,6 +2659,8 @@ export const format = (n: BigDecimal): string => {
|
|
|
2214
2659
|
* assert.deepStrictEqual(BigDecimal.toExponential(BigDecimal.make(123456n, -5)), "1.23456e+10")
|
|
2215
2660
|
* ```
|
|
2216
2661
|
*
|
|
2662
|
+
* @see {@link format} for plain decimal formatting when possible
|
|
2663
|
+
*
|
|
2217
2664
|
* @category converting
|
|
2218
2665
|
* @since 3.11.0
|
|
2219
2666
|
*/
|
|
@@ -2239,6 +2686,11 @@ export const toExponential = (n: BigDecimal): string => {
|
|
|
2239
2686
|
/**
|
|
2240
2687
|
* Converts a `BigDecimal` to a JavaScript `number`.
|
|
2241
2688
|
*
|
|
2689
|
+
* **When to use**
|
|
2690
|
+
*
|
|
2691
|
+
* Use when an interop boundary requires a JavaScript number and can tolerate
|
|
2692
|
+
* precision loss.
|
|
2693
|
+
*
|
|
2242
2694
|
* **Gotchas**
|
|
2243
2695
|
*
|
|
2244
2696
|
* This conversion is unsafe because the result can lose integer or fractional
|
|
@@ -2254,13 +2706,19 @@ export const toExponential = (n: BigDecimal): string => {
|
|
|
2254
2706
|
* assert.deepStrictEqual(BigDecimal.toNumberUnsafe(BigDecimal.fromStringUnsafe("123.456")), 123.456)
|
|
2255
2707
|
* ```
|
|
2256
2708
|
*
|
|
2709
|
+
* @see {@link format} for preserving decimal precision as text
|
|
2710
|
+
*
|
|
2257
2711
|
* @category converting
|
|
2258
2712
|
* @since 4.0.0
|
|
2259
2713
|
*/
|
|
2260
2714
|
export const toNumberUnsafe = (n: BigDecimal): number => Number(format(n))
|
|
2261
2715
|
|
|
2262
2716
|
/**
|
|
2263
|
-
* Checks
|
|
2717
|
+
* Checks whether a given `BigDecimal` is an integer.
|
|
2718
|
+
*
|
|
2719
|
+
* **When to use**
|
|
2720
|
+
*
|
|
2721
|
+
* Use to test whether a `BigDecimal` has no fractional decimal part.
|
|
2264
2722
|
*
|
|
2265
2723
|
* **Example** (Checking integer decimals)
|
|
2266
2724
|
*
|
|
@@ -2279,7 +2737,11 @@ export const toNumberUnsafe = (n: BigDecimal): number => Number(format(n))
|
|
|
2279
2737
|
export const isInteger = (n: BigDecimal): boolean => normalize(n).scale <= 0
|
|
2280
2738
|
|
|
2281
2739
|
/**
|
|
2282
|
-
* Checks
|
|
2740
|
+
* Checks whether a given `BigDecimal` is `0`.
|
|
2741
|
+
*
|
|
2742
|
+
* **When to use**
|
|
2743
|
+
*
|
|
2744
|
+
* Use to test whether a `BigDecimal` is exactly zero.
|
|
2283
2745
|
*
|
|
2284
2746
|
* **Example** (Checking zero decimals)
|
|
2285
2747
|
*
|
|
@@ -2297,7 +2759,11 @@ export const isInteger = (n: BigDecimal): boolean => normalize(n).scale <= 0
|
|
|
2297
2759
|
export const isZero = (n: BigDecimal): boolean => n.value === bigint0
|
|
2298
2760
|
|
|
2299
2761
|
/**
|
|
2300
|
-
* Checks
|
|
2762
|
+
* Checks whether a given `BigDecimal` is negative.
|
|
2763
|
+
*
|
|
2764
|
+
* **When to use**
|
|
2765
|
+
*
|
|
2766
|
+
* Use to test whether a `BigDecimal` is less than zero.
|
|
2301
2767
|
*
|
|
2302
2768
|
* **Example** (Checking negative decimals)
|
|
2303
2769
|
*
|
|
@@ -2316,7 +2782,11 @@ export const isZero = (n: BigDecimal): boolean => n.value === bigint0
|
|
|
2316
2782
|
export const isNegative = (n: BigDecimal): boolean => n.value < bigint0
|
|
2317
2783
|
|
|
2318
2784
|
/**
|
|
2319
|
-
* Checks
|
|
2785
|
+
* Checks whether a given `BigDecimal` is positive.
|
|
2786
|
+
*
|
|
2787
|
+
* **When to use**
|
|
2788
|
+
*
|
|
2789
|
+
* Use to test whether a `BigDecimal` is greater than zero.
|
|
2320
2790
|
*
|
|
2321
2791
|
* **Example** (Checking positive decimals)
|
|
2322
2792
|
*
|
|
@@ -2339,6 +2809,11 @@ const isBigDecimalArgs = (args: IArguments) => isBigDecimal(args[0])
|
|
|
2339
2809
|
/**
|
|
2340
2810
|
* Rounding modes for `BigDecimal`.
|
|
2341
2811
|
*
|
|
2812
|
+
* **When to use**
|
|
2813
|
+
*
|
|
2814
|
+
* Use with `round` to choose how discarded digits affect a `BigDecimal`
|
|
2815
|
+
* rounded to a target scale.
|
|
2816
|
+
*
|
|
2342
2817
|
* **Details**
|
|
2343
2818
|
*
|
|
2344
2819
|
* - `ceil`: round towards positive infinity
|
|
@@ -2352,6 +2827,11 @@ const isBigDecimalArgs = (args: IArguments) => isBigDecimal(args[0])
|
|
|
2352
2827
|
* - `half-even`: round to the nearest neighbor; if equidistant round to the neighbor with an even digit
|
|
2353
2828
|
* - `half-odd`: round to the nearest neighbor; if equidistant round to the neighbor with an odd digit
|
|
2354
2829
|
*
|
|
2830
|
+
* @see {@link round} for configurable rounding with a `RoundingMode`
|
|
2831
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2832
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2833
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2834
|
+
*
|
|
2355
2835
|
* @category math
|
|
2356
2836
|
* @since 3.16.0
|
|
2357
2837
|
*/
|
|
@@ -2368,7 +2848,11 @@ export type RoundingMode =
|
|
|
2368
2848
|
| "half-odd"
|
|
2369
2849
|
|
|
2370
2850
|
/**
|
|
2371
|
-
*
|
|
2851
|
+
* Computes a rounded `BigDecimal` at the given scale with the specified rounding mode.
|
|
2852
|
+
*
|
|
2853
|
+
* **When to use**
|
|
2854
|
+
*
|
|
2855
|
+
* Use to round a decimal at a requested scale with an explicit rounding mode.
|
|
2372
2856
|
*
|
|
2373
2857
|
* **Example** (Rounding decimals)
|
|
2374
2858
|
*
|
|
@@ -2386,12 +2870,20 @@ export type RoundingMode =
|
|
|
2386
2870
|
* )
|
|
2387
2871
|
* ```
|
|
2388
2872
|
*
|
|
2873
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2874
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2875
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2876
|
+
*
|
|
2389
2877
|
* @category math
|
|
2390
2878
|
* @since 3.16.0
|
|
2391
2879
|
*/
|
|
2392
2880
|
export const round: {
|
|
2393
2881
|
/**
|
|
2394
|
-
*
|
|
2882
|
+
* Computes a rounded `BigDecimal` at the given scale with the specified rounding mode.
|
|
2883
|
+
*
|
|
2884
|
+
* **When to use**
|
|
2885
|
+
*
|
|
2886
|
+
* Use to round a decimal at a requested scale with an explicit rounding mode.
|
|
2395
2887
|
*
|
|
2396
2888
|
* **Example** (Rounding decimals)
|
|
2397
2889
|
*
|
|
@@ -2409,12 +2901,20 @@ export const round: {
|
|
|
2409
2901
|
* )
|
|
2410
2902
|
* ```
|
|
2411
2903
|
*
|
|
2904
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2905
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2906
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2907
|
+
*
|
|
2412
2908
|
* @category math
|
|
2413
2909
|
* @since 3.16.0
|
|
2414
2910
|
*/
|
|
2415
2911
|
(options: { scale?: number; mode?: RoundingMode }): (self: BigDecimal) => BigDecimal
|
|
2416
2912
|
/**
|
|
2417
|
-
*
|
|
2913
|
+
* Computes a rounded `BigDecimal` at the given scale with the specified rounding mode.
|
|
2914
|
+
*
|
|
2915
|
+
* **When to use**
|
|
2916
|
+
*
|
|
2917
|
+
* Use to round a decimal at a requested scale with an explicit rounding mode.
|
|
2418
2918
|
*
|
|
2419
2919
|
* **Example** (Rounding decimals)
|
|
2420
2920
|
*
|
|
@@ -2432,6 +2932,10 @@ export const round: {
|
|
|
2432
2932
|
* )
|
|
2433
2933
|
* ```
|
|
2434
2934
|
*
|
|
2935
|
+
* @see {@link ceil} for fixed rounding toward positive infinity
|
|
2936
|
+
* @see {@link floor} for fixed rounding toward negative infinity
|
|
2937
|
+
* @see {@link truncate} for fixed rounding toward zero
|
|
2938
|
+
*
|
|
2435
2939
|
* @category math
|
|
2436
2940
|
* @since 3.16.0
|
|
2437
2941
|
*/
|
|
@@ -2484,9 +2988,13 @@ export const round: {
|
|
|
2484
2988
|
})
|
|
2485
2989
|
|
|
2486
2990
|
/**
|
|
2487
|
-
*
|
|
2991
|
+
* Computes a truncated `BigDecimal` at the given scale. This removes fractional digits beyond the scale,
|
|
2488
2992
|
* rounding toward zero.
|
|
2489
2993
|
*
|
|
2994
|
+
* **When to use**
|
|
2995
|
+
*
|
|
2996
|
+
* Use to remove digits beyond a requested scale by rounding toward zero.
|
|
2997
|
+
*
|
|
2490
2998
|
* **Example** (Truncating decimals)
|
|
2491
2999
|
*
|
|
2492
3000
|
* ```ts
|
|
@@ -2496,14 +3004,22 @@ export const round: {
|
|
|
2496
3004
|
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2497
3005
|
* ```
|
|
2498
3006
|
*
|
|
3007
|
+
* @see {@link round} for configurable rounding modes
|
|
3008
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3009
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3010
|
+
*
|
|
2499
3011
|
* @category math
|
|
2500
3012
|
* @since 3.16.0
|
|
2501
3013
|
*/
|
|
2502
3014
|
export const truncate: {
|
|
2503
3015
|
/**
|
|
2504
|
-
*
|
|
3016
|
+
* Computes a truncated `BigDecimal` at the given scale. This removes fractional digits beyond the scale,
|
|
2505
3017
|
* rounding toward zero.
|
|
2506
3018
|
*
|
|
3019
|
+
* **When to use**
|
|
3020
|
+
*
|
|
3021
|
+
* Use to remove digits beyond a requested scale by rounding toward zero.
|
|
3022
|
+
*
|
|
2507
3023
|
* **Example** (Truncating decimals)
|
|
2508
3024
|
*
|
|
2509
3025
|
* ```ts
|
|
@@ -2513,14 +3029,22 @@ export const truncate: {
|
|
|
2513
3029
|
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2514
3030
|
* ```
|
|
2515
3031
|
*
|
|
3032
|
+
* @see {@link round} for configurable rounding modes
|
|
3033
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3034
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3035
|
+
*
|
|
2516
3036
|
* @category math
|
|
2517
3037
|
* @since 3.16.0
|
|
2518
3038
|
*/
|
|
2519
3039
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
2520
3040
|
/**
|
|
2521
|
-
*
|
|
3041
|
+
* Computes a truncated `BigDecimal` at the given scale. This removes fractional digits beyond the scale,
|
|
2522
3042
|
* rounding toward zero.
|
|
2523
3043
|
*
|
|
3044
|
+
* **When to use**
|
|
3045
|
+
*
|
|
3046
|
+
* Use to remove digits beyond a requested scale by rounding toward zero.
|
|
3047
|
+
*
|
|
2524
3048
|
* **Example** (Truncating decimals)
|
|
2525
3049
|
*
|
|
2526
3050
|
* ```ts
|
|
@@ -2530,6 +3054,10 @@ export const truncate: {
|
|
|
2530
3054
|
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2531
3055
|
* ```
|
|
2532
3056
|
*
|
|
3057
|
+
* @see {@link round} for configurable rounding modes
|
|
3058
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3059
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3060
|
+
*
|
|
2533
3061
|
* @category math
|
|
2534
3062
|
* @since 3.16.0
|
|
2535
3063
|
*/
|
|
@@ -2544,7 +3072,21 @@ export const truncate: {
|
|
|
2544
3072
|
})
|
|
2545
3073
|
|
|
2546
3074
|
/**
|
|
2547
|
-
*
|
|
3075
|
+
* Computes the ceiling of a `BigDecimal` at the given scale.
|
|
3076
|
+
*
|
|
3077
|
+
* **When to use**
|
|
3078
|
+
*
|
|
3079
|
+
* Use to round a decimal toward positive infinity at a requested scale.
|
|
3080
|
+
*
|
|
3081
|
+
* **Details**
|
|
3082
|
+
*
|
|
3083
|
+
* The default scale is `0`. Positive scales keep digits to the right of the
|
|
3084
|
+
* decimal point, and negative scales round positions to the left of the decimal
|
|
3085
|
+
* point.
|
|
3086
|
+
*
|
|
3087
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3088
|
+
* @see {@link truncate} for rounding toward zero
|
|
3089
|
+
* @see {@link round} for configurable rounding modes
|
|
2548
3090
|
*
|
|
2549
3091
|
* **Example** (Rounding decimals up)
|
|
2550
3092
|
*
|
|
@@ -2564,7 +3106,21 @@ export const truncate: {
|
|
|
2564
3106
|
*/
|
|
2565
3107
|
export const ceil: {
|
|
2566
3108
|
/**
|
|
2567
|
-
*
|
|
3109
|
+
* Computes the ceiling of a `BigDecimal` at the given scale.
|
|
3110
|
+
*
|
|
3111
|
+
* **When to use**
|
|
3112
|
+
*
|
|
3113
|
+
* Use to round a decimal toward positive infinity at a requested scale.
|
|
3114
|
+
*
|
|
3115
|
+
* **Details**
|
|
3116
|
+
*
|
|
3117
|
+
* The default scale is `0`. Positive scales keep digits to the right of the
|
|
3118
|
+
* decimal point, and negative scales round positions to the left of the decimal
|
|
3119
|
+
* point.
|
|
3120
|
+
*
|
|
3121
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3122
|
+
* @see {@link truncate} for rounding toward zero
|
|
3123
|
+
* @see {@link round} for configurable rounding modes
|
|
2568
3124
|
*
|
|
2569
3125
|
* **Example** (Rounding decimals up)
|
|
2570
3126
|
*
|
|
@@ -2584,7 +3140,21 @@ export const ceil: {
|
|
|
2584
3140
|
*/
|
|
2585
3141
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
2586
3142
|
/**
|
|
2587
|
-
*
|
|
3143
|
+
* Computes the ceiling of a `BigDecimal` at the given scale.
|
|
3144
|
+
*
|
|
3145
|
+
* **When to use**
|
|
3146
|
+
*
|
|
3147
|
+
* Use to round a decimal toward positive infinity at a requested scale.
|
|
3148
|
+
*
|
|
3149
|
+
* **Details**
|
|
3150
|
+
*
|
|
3151
|
+
* The default scale is `0`. Positive scales keep digits to the right of the
|
|
3152
|
+
* decimal point, and negative scales round positions to the left of the decimal
|
|
3153
|
+
* point.
|
|
3154
|
+
*
|
|
3155
|
+
* @see {@link floor} for rounding toward negative infinity
|
|
3156
|
+
* @see {@link truncate} for rounding toward zero
|
|
3157
|
+
* @see {@link round} for configurable rounding modes
|
|
2588
3158
|
*
|
|
2589
3159
|
* **Example** (Rounding decimals up)
|
|
2590
3160
|
*
|
|
@@ -2647,7 +3217,11 @@ export const digitAt: {
|
|
|
2647
3217
|
})
|
|
2648
3218
|
|
|
2649
3219
|
/**
|
|
2650
|
-
*
|
|
3220
|
+
* Computes the floor of a `BigDecimal` at the given scale.
|
|
3221
|
+
*
|
|
3222
|
+
* **When to use**
|
|
3223
|
+
*
|
|
3224
|
+
* Use to round a decimal toward negative infinity at a requested scale.
|
|
2651
3225
|
*
|
|
2652
3226
|
* **Example** (Rounding decimals down)
|
|
2653
3227
|
*
|
|
@@ -2665,12 +3239,20 @@ export const digitAt: {
|
|
|
2665
3239
|
* )
|
|
2666
3240
|
* ```
|
|
2667
3241
|
*
|
|
3242
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3243
|
+
* @see {@link truncate} for rounding toward zero
|
|
3244
|
+
* @see {@link round} for configurable rounding modes
|
|
3245
|
+
*
|
|
2668
3246
|
* @category math
|
|
2669
3247
|
* @since 3.16.0
|
|
2670
3248
|
*/
|
|
2671
3249
|
export const floor: {
|
|
2672
3250
|
/**
|
|
2673
|
-
*
|
|
3251
|
+
* Computes the floor of a `BigDecimal` at the given scale.
|
|
3252
|
+
*
|
|
3253
|
+
* **When to use**
|
|
3254
|
+
*
|
|
3255
|
+
* Use to round a decimal toward negative infinity at a requested scale.
|
|
2674
3256
|
*
|
|
2675
3257
|
* **Example** (Rounding decimals down)
|
|
2676
3258
|
*
|
|
@@ -2688,12 +3270,20 @@ export const floor: {
|
|
|
2688
3270
|
* )
|
|
2689
3271
|
* ```
|
|
2690
3272
|
*
|
|
3273
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3274
|
+
* @see {@link truncate} for rounding toward zero
|
|
3275
|
+
* @see {@link round} for configurable rounding modes
|
|
3276
|
+
*
|
|
2691
3277
|
* @category math
|
|
2692
3278
|
* @since 3.16.0
|
|
2693
3279
|
*/
|
|
2694
3280
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
2695
3281
|
/**
|
|
2696
|
-
*
|
|
3282
|
+
* Computes the floor of a `BigDecimal` at the given scale.
|
|
3283
|
+
*
|
|
3284
|
+
* **When to use**
|
|
3285
|
+
*
|
|
3286
|
+
* Use to round a decimal toward negative infinity at a requested scale.
|
|
2697
3287
|
*
|
|
2698
3288
|
* **Example** (Rounding decimals down)
|
|
2699
3289
|
*
|
|
@@ -2711,6 +3301,10 @@ export const floor: {
|
|
|
2711
3301
|
* )
|
|
2712
3302
|
* ```
|
|
2713
3303
|
*
|
|
3304
|
+
* @see {@link ceil} for rounding toward positive infinity
|
|
3305
|
+
* @see {@link truncate} for rounding toward zero
|
|
3306
|
+
* @see {@link round} for configurable rounding modes
|
|
3307
|
+
*
|
|
2714
3308
|
* @category math
|
|
2715
3309
|
* @since 3.16.0
|
|
2716
3310
|
*/
|