effect 4.0.0-beta.67 → 4.0.0-beta.68
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 +41 -42
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +23 -23
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +265 -265
- package/dist/BigDecimal.js +128 -128
- package/dist/BigInt.d.ts +175 -177
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +81 -79
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +127 -125
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +55 -53
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +10 -4
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +3 -2
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +36 -36
- package/dist/Cache.js +17 -17
- package/dist/Cause.d.ts +17 -18
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +12 -12
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +234 -241
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +97 -101
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +33 -56
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +17 -26
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -1
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -0
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +78 -68
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +53 -49
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +33 -32
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -18
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +19 -19
- package/dist/Console.js +19 -19
- package/dist/Context.d.ts +70 -108
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +30 -44
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +3 -5
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +3 -5
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +208 -0
- package/dist/Crypto.d.ts.map +1 -0
- package/dist/Crypto.js +157 -0
- package/dist/Crypto.js.map +1 -0
- package/dist/Data.d.ts +6 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +29 -31
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +19 -19
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +8 -9
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +6 -6
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -2
- package/dist/Duration.d.ts +30 -27
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +15 -12
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +394 -652
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +157 -247
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +2 -2
- package/dist/Effectable.js +2 -2
- package/dist/Encoding.d.ts +9 -9
- package/dist/Encoding.js +9 -9
- package/dist/Equal.d.ts +4 -3
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +4 -3
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +4 -5
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +2 -2
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +14 -14
- package/dist/ErrorReporter.js +9 -9
- package/dist/ExecutionPlan.d.ts +18 -9
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +6 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +0 -1
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +1 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +5 -5
- package/dist/FiberHandle.js +3 -3
- package/dist/FiberMap.d.ts +10 -10
- package/dist/FiberMap.js +4 -4
- package/dist/FiberSet.d.ts +4 -4
- package/dist/FiberSet.js +2 -2
- package/dist/FileSystem.d.ts +10 -12
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +54 -54
- package/dist/Filter.js +28 -28
- package/dist/Formatter.d.ts +4 -2
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -69
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +64 -65
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +41 -41
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +157 -175
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +72 -80
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts +4 -6
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +2 -2
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +121 -157
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +47 -59
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +34 -34
- package/dist/HashRing.js +16 -16
- package/dist/HashSet.d.ts +51 -55
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -20
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +6 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -4
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +37 -83
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +21 -39
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +8 -6
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +5 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +13 -11
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +13 -11
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +10 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +4 -16
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +2 -14
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +94 -135
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +44 -61
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +15 -16
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +6 -6
- package/dist/LogLevel.d.ts +13 -13
- package/dist/LogLevel.js +4 -4
- package/dist/Logger.d.ts +10 -11
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +10 -11
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -4
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +4 -3
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +2 -4
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +1 -2
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +48 -50
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +22 -22
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +30 -30
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +15 -14
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +0 -2
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +23 -24
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +17 -19
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +0 -1
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +12 -2
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +8 -2
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +5 -12
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +3 -8
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +145 -141
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +65 -61
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +5 -5
- package/dist/Optic.js +5 -5
- package/dist/Option.d.ts +105 -109
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +50 -52
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -6
- package/dist/Order.js +6 -6
- package/dist/Ordering.d.ts +15 -19
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +6 -6
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +3 -3
- package/dist/PartitionedSemaphore.js +2 -2
- package/dist/Path.d.ts +4 -4
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -1
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +10 -7
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +6 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +3 -3
- package/dist/PlatformError.js +2 -2
- package/dist/Predicate.d.ts +2 -4
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +3 -3
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +2 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +2 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +25 -51
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +17 -35
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +45 -60
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +27 -33
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +27 -38
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +17 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +11 -11
- package/dist/RcMap.js +3 -3
- package/dist/RcRef.d.ts +0 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +9 -8
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +7 -5
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +7 -5
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +5 -3
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +2 -3
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +2 -2
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +3 -1
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +7 -17
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +5 -12
- package/dist/Ref.js.map +1 -1
- package/dist/RegExp.d.ts +1 -1
- package/dist/RegExp.js +1 -1
- package/dist/Request.d.ts +2 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +1 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +2 -3
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +1 -1
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Result.d.ts +124 -142
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +51 -63
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +2 -7
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +1 -3
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +69 -72
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +31 -33
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +2 -2
- package/dist/Scheduler.js +2 -2
- package/dist/Schema.d.ts +491 -321
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +220 -172
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +98 -77
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +89 -68
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +23 -23
- package/dist/SchemaGetter.js +20 -20
- package/dist/SchemaIssue.d.ts +18 -16
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -14
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +39 -40
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +48 -51
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +89 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +47 -37
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +36 -5
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +33 -5
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +1 -1
- package/dist/SchemaUtils.js +1 -1
- package/dist/Scope.d.ts +12 -29
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +6 -11
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +37 -37
- package/dist/ScopedCache.js +17 -17
- package/dist/Semaphore.d.ts +4 -16
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +2 -14
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +36 -39
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +18 -18
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +6 -6
- package/dist/Stdio.js +4 -4
- package/dist/Stream.d.ts +671 -808
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +289 -363
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +3 -2
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +3 -2
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +20 -18
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +10 -8
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -2
- package/dist/SubscriptionRef.js +2 -2
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/SynchronizedRef.d.ts +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/Take.d.ts +2 -2
- package/dist/Take.js +1 -1
- package/dist/Terminal.d.ts +5 -5
- package/dist/Terminal.js +2 -2
- package/dist/Tracer.d.ts +9 -9
- package/dist/Tracer.js +2 -2
- package/dist/Trie.d.ts +70 -106
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +29 -43
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +34 -32
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +16 -14
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +27 -18
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +15 -10
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +11 -11
- package/dist/TxDeferred.js +5 -5
- package/dist/TxHashMap.d.ts +60 -61
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +23 -23
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +28 -32
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +13 -16
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -30
- package/dist/TxPriorityQueue.js +18 -18
- package/dist/TxPubSub.d.ts +18 -18
- package/dist/TxPubSub.js +14 -14
- package/dist/TxQueue.d.ts +26 -29
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +17 -17
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +21 -21
- package/dist/TxReentrantLock.js +15 -15
- package/dist/TxRef.d.ts +24 -24
- package/dist/TxRef.js +11 -11
- package/dist/TxSemaphore.d.ts +13 -74
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +9 -52
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +24 -24
- package/dist/TxSubscriptionRef.js +11 -11
- package/dist/Types.d.ts +1 -4
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +14 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +8 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +8 -8
- package/dist/Unify.js +1 -1
- package/dist/Utils.d.ts +1 -2
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +1917 -411
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1917 -411
- package/dist/index.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +3 -3
- package/dist/testing/FastCheck.js +3 -3
- package/dist/testing/TestClock.d.ts +2 -3
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +1 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +8 -9
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +5 -5
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -0
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +2 -0
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +34 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +10 -19
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +0 -9
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +0 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +3 -0
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +2 -0
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +3 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +2 -6
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +2 -2
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +8 -10
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +4 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +20 -20
- package/dist/unstable/ai/ResponseIdTracker.d.ts +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +5 -5
- package/dist/unstable/ai/Telemetry.js +3 -3
- package/dist/unstable/ai/Tokenizer.d.ts +1 -1
- package/dist/unstable/ai/Tool.d.ts +14 -12
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +10 -9
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +79 -5
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +79 -5
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +5 -6
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +2 -3
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +3 -3
- package/dist/unstable/cli/Command.js +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts +31 -1
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +37 -38
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.d.ts +6 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +182 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +205 -6
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +0 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +2 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -2
- package/dist/unstable/cluster/Entity.d.ts +0 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +10 -14
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +8 -14
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +3 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.js +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/Envelope.js +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +11 -11
- package/dist/unstable/cluster/HttpRunner.js +11 -11
- package/dist/unstable/cluster/K8sHttpClient.d.ts +5 -5
- package/dist/unstable/cluster/K8sHttpClient.js +5 -5
- package/dist/unstable/cluster/MachineId.d.ts +1 -1
- package/dist/unstable/cluster/MachineId.js +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +1 -2
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +1 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerServer.d.ts +4 -4
- package/dist/unstable/cluster/RunnerServer.js +4 -4
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.js +3 -3
- package/dist/unstable/cluster/ShardId.d.ts +7 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +6 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.js +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
- package/dist/unstable/cluster/ShardingConfig.js +2 -2
- package/dist/unstable/cluster/SingleRunner.d.ts +1 -1
- package/dist/unstable/cluster/SingleRunner.js +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +10 -9
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +4 -3
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
- package/dist/unstable/cluster/SocketRunner.js +2 -2
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +3 -3
- package/dist/unstable/cluster/SqlMessageStorage.js +3 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +3 -3
- package/dist/unstable/cluster/SqlRunnerStorage.js +3 -3
- package/dist/unstable/cluster/TestRunner.d.ts +1 -1
- package/dist/unstable/cluster/TestRunner.js +1 -1
- package/dist/unstable/cluster/index.d.ts +790 -0
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +790 -0
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +58 -0
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +58 -0
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +16 -16
- package/dist/unstable/encoding/Sse.js +11 -11
- package/dist/unstable/encoding/index.d.ts +49 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +49 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +2 -2
- package/dist/unstable/eventlog/Event.js +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +2 -2
- package/dist/unstable/eventlog/EventGroup.js +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +6 -7
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +4 -4
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogRemote.js +2 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogServer.js +2 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -2
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/index.d.ts +240 -0
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +240 -0
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +6 -6
- package/dist/unstable/http/Cookies.js +4 -4
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.js +2 -2
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +1 -1
- package/dist/unstable/http/HttpClient.d.ts +5 -6
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +5 -4
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +4 -4
- package/dist/unstable/http/HttpClientRequest.js +4 -4
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -6
- package/dist/unstable/http/HttpClientResponse.js +6 -6
- package/dist/unstable/http/HttpEffect.d.ts +5 -5
- package/dist/unstable/http/HttpEffect.js +5 -5
- package/dist/unstable/http/HttpIncomingMessage.d.ts +7 -6
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +7 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -2
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +4 -1
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -0
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +23 -25
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +23 -22
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +4 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +4 -1
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +15 -15
- package/dist/unstable/http/HttpServerRequest.js +15 -15
- package/dist/unstable/http/HttpServerRespondable.d.ts +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +5 -4
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +5 -4
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +2 -4
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +2 -4
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +20 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +19 -17
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +0 -1
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +17 -17
- package/dist/unstable/http/Url.js +8 -8
- package/dist/unstable/http/UrlParams.d.ts +14 -12
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +12 -10
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +452 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +452 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -2
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +19 -8
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +11 -8
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +0 -2
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +0 -2
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +310 -25
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +310 -25
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +3 -3
- package/dist/unstable/observability/Otlp.js +3 -3
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +3 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +5 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +2 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +9 -9
- package/dist/unstable/observability/OtlpResource.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts +3 -3
- package/dist/unstable/observability/OtlpSerialization.js +3 -3
- package/dist/unstable/observability/OtlpTracer.d.ts +5 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +2 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +7 -7
- package/dist/unstable/observability/PrometheusMetrics.js +2 -2
- package/dist/unstable/observability/index.d.ts +158 -2
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +158 -2
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +4 -4
- package/dist/unstable/persistence/KeyValueStore.js +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +11 -11
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +2 -2
- package/dist/unstable/persistence/PersistedCache.js +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.js +3 -3
- package/dist/unstable/persistence/Persistence.d.ts +2 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -1
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +19 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +14 -10
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.js +3 -3
- package/dist/unstable/persistence/index.d.ts +147 -0
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +147 -0
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +41 -41
- package/dist/unstable/process/ChildProcess.js +11 -11
- package/dist/unstable/process/ChildProcessSpawner.d.ts +10 -10
- package/dist/unstable/process/ChildProcessSpawner.js +5 -5
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -6
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +3 -3
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +25 -20
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +12 -12
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/unstable/reactivity/AtomHttpApi.js +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRef.js +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +16 -16
- package/dist/unstable/reactivity/AtomRegistry.js +7 -7
- package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -3
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +2 -3
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +167 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +167 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +0 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +0 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +0 -1
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +2 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +272 -0
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +272 -0
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +63 -8
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +44 -5
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -4
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +37 -0
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +37 -0
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +5 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +4 -3
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +44 -0
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +44 -0
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +5 -5
- package/dist/unstable/sql/Migrator.js +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +4 -0
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +2 -0
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +3 -3
- package/dist/unstable/sql/SqlError.d.ts +18 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +17 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +0 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +5 -5
- package/dist/unstable/sql/SqlSchema.js +5 -5
- package/dist/unstable/sql/SqlStream.d.ts +1 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +1 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +27 -24
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +9 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +178 -0
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +178 -0
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +7 -7
- package/dist/unstable/workers/Transferable.js +4 -4
- package/dist/unstable/workers/Worker.d.ts +1 -0
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +1 -0
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +8 -8
- package/dist/unstable/workers/WorkerError.js +7 -7
- package/dist/unstable/workers/index.d.ts +80 -0
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +80 -0
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -7
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +22 -20
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +8 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +7 -5
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +5 -3
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +12 -10
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +3 -3
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +4 -4
- package/dist/unstable/workflow/WorkflowEngine.js +4 -4
- package/dist/unstable/workflow/WorkflowProxy.d.ts +10 -12
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +8 -12
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +3 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +2 -2
- package/dist/unstable/workflow/index.d.ts +160 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +160 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +41 -42
- package/src/BigDecimal.ts +265 -265
- package/src/BigInt.ts +175 -177
- package/src/Boolean.ts +127 -125
- package/src/Brand.ts +10 -4
- package/src/Cache.ts +42 -42
- package/src/Cause.ts +17 -18
- package/src/Channel.ts +250 -256
- package/src/Chunk.ts +33 -56
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -1
- package/src/Config.ts +78 -68
- package/src/ConfigProvider.ts +33 -32
- package/src/Console.ts +23 -23
- package/src/Context.ts +70 -108
- package/src/Cron.ts +3 -5
- package/src/Crypto.ts +327 -0
- package/src/Data.ts +6 -1
- package/src/DateTime.ts +29 -31
- package/src/Deferred.ts +8 -9
- package/src/Differ.ts +2 -2
- package/src/Duration.ts +30 -27
- package/src/Effect.ts +402 -660
- package/src/Effectable.ts +2 -2
- package/src/Encoding.ts +9 -9
- package/src/Equal.ts +4 -3
- package/src/Equivalence.ts +4 -5
- package/src/ErrorReporter.ts +14 -14
- package/src/ExecutionPlan.ts +18 -9
- package/src/Exit.ts +0 -1
- package/src/Fiber.ts +1 -2
- package/src/FiberHandle.ts +5 -5
- package/src/FiberMap.ts +10 -10
- package/src/FiberSet.ts +4 -4
- package/src/FileSystem.ts +10 -12
- package/src/Filter.ts +54 -54
- package/src/Formatter.ts +4 -70
- package/src/Function.ts +64 -65
- package/src/Graph.ts +157 -175
- package/src/Hash.ts +4 -6
- package/src/HashMap.ts +121 -157
- package/src/HashRing.ts +34 -34
- package/src/HashSet.ts +51 -55
- package/src/Inspectable.ts +8 -7
- package/src/Iterable.ts +37 -83
- package/src/JsonPatch.ts +9 -7
- package/src/JsonPointer.ts +13 -11
- package/src/JsonSchema.ts +16 -0
- package/src/Latch.ts +4 -16
- package/src/Layer.ts +94 -135
- package/src/LayerMap.ts +15 -16
- package/src/LogLevel.ts +13 -13
- package/src/Logger.ts +16 -17
- package/src/ManagedRuntime.ts +5 -4
- package/src/Match.ts +2 -4
- package/src/Metric.ts +56 -58
- package/src/MutableHashMap.ts +42 -44
- package/src/MutableHashSet.ts +0 -2
- package/src/MutableList.ts +23 -26
- package/src/MutableRef.ts +0 -1
- package/src/Newtype.ts +12 -2
- package/src/NonEmptyIterable.ts +5 -12
- package/src/Number.ts +145 -141
- package/src/Optic.ts +5 -5
- package/src/Option.ts +105 -109
- package/src/Order.ts +6 -6
- package/src/Ordering.ts +15 -19
- package/src/PartitionedSemaphore.ts +3 -3
- package/src/Path.ts +4 -4
- package/src/Pipeable.ts +10 -7
- package/src/PlatformError.ts +3 -3
- package/src/Predicate.ts +3 -5
- package/src/PrimaryKey.ts +2 -1
- package/src/PubSub.ts +25 -51
- package/src/Queue.ts +45 -60
- package/src/Random.ts +31 -74
- package/src/RcMap.ts +11 -11
- package/src/RcRef.ts +0 -1
- package/src/Record.ts +9 -8
- package/src/Redactable.ts +7 -5
- package/src/Redacted.ts +2 -3
- package/src/Reducer.ts +3 -1
- package/src/Ref.ts +15 -33
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +2 -1
- package/src/RequestResolver.ts +2 -3
- package/src/Resource.ts +1 -1
- package/src/Result.ts +124 -142
- package/src/Runtime.ts +2 -7
- package/src/Schedule.ts +74 -77
- package/src/Scheduler.ts +2 -2
- package/src/Schema.ts +491 -321
- package/src/SchemaAST.ts +98 -77
- package/src/SchemaGetter.ts +23 -23
- package/src/SchemaIssue.ts +18 -16
- package/src/SchemaParser.ts +46 -49
- package/src/SchemaRepresentation.ts +89 -77
- package/src/SchemaTransformation.ts +36 -5
- package/src/SchemaUtils.ts +1 -1
- package/src/Scope.ts +12 -29
- package/src/ScopedCache.ts +43 -43
- package/src/Semaphore.ts +4 -16
- package/src/Sink.ts +36 -39
- package/src/Stdio.ts +6 -6
- package/src/Stream.ts +789 -828
- package/src/String.ts +3 -2
- package/src/Struct.ts +20 -18
- package/src/SubscriptionRef.ts +2 -2
- package/src/Symbol.ts +3 -3
- package/src/SynchronizedRef.ts +1 -1
- package/src/Take.ts +2 -2
- package/src/Terminal.ts +5 -5
- package/src/Tracer.ts +9 -9
- package/src/Trie.ts +70 -106
- package/src/Tuple.ts +34 -32
- package/src/TxChunk.ts +27 -18
- package/src/TxDeferred.ts +11 -11
- package/src/TxHashMap.ts +62 -63
- package/src/TxHashSet.ts +38 -42
- package/src/TxPriorityQueue.ts +31 -31
- package/src/TxPubSub.ts +18 -18
- package/src/TxQueue.ts +26 -29
- package/src/TxReentrantLock.ts +21 -21
- package/src/TxRef.ts +24 -24
- package/src/TxSemaphore.ts +13 -74
- package/src/TxSubscriptionRef.ts +24 -24
- package/src/Types.ts +1 -4
- package/src/UndefinedOr.ts +14 -0
- package/src/Unify.ts +8 -8
- package/src/Utils.ts +1 -2
- package/src/index.ts +1915 -408
- package/src/testing/FastCheck.ts +3 -3
- package/src/testing/TestClock.ts +2 -3
- package/src/testing/TestConsole.ts +8 -9
- package/src/testing/TestSchema.ts +2 -0
- package/src/testing/index.ts +34 -0
- package/src/unstable/ai/AiError.ts +10 -19
- package/src/unstable/ai/Chat.ts +0 -1
- package/src/unstable/ai/McpSchema.ts +3 -0
- package/src/unstable/ai/McpServer.ts +3 -1
- package/src/unstable/ai/Model.ts +2 -6
- package/src/unstable/ai/Prompt.ts +8 -10
- package/src/unstable/ai/Response.ts +20 -20
- package/src/unstable/ai/ResponseIdTracker.ts +1 -1
- package/src/unstable/ai/Telemetry.ts +5 -5
- package/src/unstable/ai/Tokenizer.ts +1 -1
- package/src/unstable/ai/Tool.ts +14 -12
- package/src/unstable/ai/index.ts +79 -5
- package/src/unstable/cli/CliOutput.ts +5 -6
- package/src/unstable/cli/Command.ts +3 -3
- package/src/unstable/cli/HelpDoc.ts +4 -4
- package/src/unstable/cli/Param.ts +69 -72
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +6 -14
- package/src/unstable/cli/index.ts +205 -6
- package/src/unstable/cli/internal/parser.ts +0 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +2 -2
- package/src/unstable/cluster/Entity.ts +0 -1
- package/src/unstable/cluster/EntityProxy.ts +10 -14
- package/src/unstable/cluster/EntityProxyServer.ts +3 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/HttpRunner.ts +11 -11
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/MachineId.ts +1 -1
- package/src/unstable/cluster/MessageStorage.ts +1 -2
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +4 -4
- package/src/unstable/cluster/Runners.ts +3 -3
- package/src/unstable/cluster/ShardId.ts +7 -5
- package/src/unstable/cluster/Sharding.ts +1 -1
- package/src/unstable/cluster/ShardingConfig.ts +2 -2
- package/src/unstable/cluster/SingleRunner.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +10 -9
- package/src/unstable/cluster/SocketRunner.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +3 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +3 -3
- package/src/unstable/cluster/TestRunner.ts +1 -1
- package/src/unstable/cluster/index.ts +790 -0
- package/src/unstable/devtools/index.ts +58 -0
- package/src/unstable/encoding/Sse.ts +16 -16
- package/src/unstable/encoding/index.ts +49 -0
- package/src/unstable/eventlog/Event.ts +2 -2
- package/src/unstable/eventlog/EventGroup.ts +2 -2
- package/src/unstable/eventlog/EventLog.ts +6 -7
- package/src/unstable/eventlog/EventLogRemote.ts +2 -2
- package/src/unstable/eventlog/EventLogServer.ts +2 -2
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/eventlog/index.ts +240 -0
- package/src/unstable/http/Cookies.ts +6 -6
- package/src/unstable/http/Etag.ts +2 -2
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpClient.ts +5 -6
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +4 -4
- package/src/unstable/http/HttpClientResponse.ts +6 -6
- package/src/unstable/http/HttpEffect.ts +5 -5
- package/src/unstable/http/HttpIncomingMessage.ts +7 -6
- package/src/unstable/http/HttpMethod.ts +4 -2
- package/src/unstable/http/HttpMiddleware.ts +1 -0
- package/src/unstable/http/HttpRouter.ts +23 -25
- package/src/unstable/http/HttpServerError.ts +4 -1
- package/src/unstable/http/HttpServerRequest.ts +15 -15
- package/src/unstable/http/HttpServerRespondable.ts +1 -1
- package/src/unstable/http/HttpServerResponse.ts +5 -4
- package/src/unstable/http/HttpStaticServer.ts +2 -4
- package/src/unstable/http/Multipart.ts +20 -19
- package/src/unstable/http/Template.ts +0 -1
- package/src/unstable/http/Url.ts +17 -17
- package/src/unstable/http/UrlParams.ts +14 -12
- package/src/unstable/http/index.ts +452 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +0 -1
- package/src/unstable/httpapi/HttpApiClient.ts +0 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -2
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/httpapi/HttpApiSchema.ts +19 -8
- package/src/unstable/httpapi/HttpApiSecurity.ts +0 -1
- package/src/unstable/httpapi/HttpApiSwagger.ts +0 -2
- package/src/unstable/httpapi/index.ts +310 -25
- package/src/unstable/observability/Otlp.ts +3 -3
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/observability/OtlpLogger.ts +3 -2
- package/src/unstable/observability/OtlpMetrics.ts +5 -4
- package/src/unstable/observability/OtlpResource.ts +9 -9
- package/src/unstable/observability/OtlpSerialization.ts +3 -3
- package/src/unstable/observability/OtlpTracer.ts +5 -2
- package/src/unstable/observability/PrometheusMetrics.ts +7 -7
- package/src/unstable/observability/index.ts +158 -2
- package/src/unstable/persistence/KeyValueStore.ts +4 -4
- package/src/unstable/persistence/Persistable.ts +11 -11
- package/src/unstable/persistence/PersistedCache.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +2 -1
- package/src/unstable/persistence/RateLimiter.ts +19 -15
- package/src/unstable/persistence/Redis.ts +3 -3
- package/src/unstable/persistence/index.ts +147 -0
- package/src/unstable/process/ChildProcess.ts +42 -42
- package/src/unstable/process/ChildProcessSpawner.ts +10 -10
- package/src/unstable/reactivity/AsyncResult.ts +8 -6
- package/src/unstable/reactivity/Atom.ts +25 -20
- package/src/unstable/reactivity/AtomHttpApi.ts +2 -2
- package/src/unstable/reactivity/AtomRef.ts +2 -2
- package/src/unstable/reactivity/AtomRegistry.ts +17 -17
- package/src/unstable/reactivity/AtomRpc.ts +2 -2
- package/src/unstable/reactivity/Reactivity.ts +2 -3
- package/src/unstable/reactivity/index.ts +167 -0
- package/src/unstable/rpc/Rpc.ts +0 -1
- package/src/unstable/rpc/RpcClient.ts +0 -1
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcMiddleware.ts +2 -2
- package/src/unstable/rpc/RpcWorker.ts +0 -1
- package/src/unstable/rpc/Utils.ts +2 -0
- package/src/unstable/rpc/index.ts +272 -0
- package/src/unstable/schema/Model.ts +98 -10
- package/src/unstable/schema/VariantSchema.ts +1 -4
- package/src/unstable/schema/index.ts +37 -0
- package/src/unstable/socket/Socket.ts +5 -4
- package/src/unstable/socket/index.ts +44 -0
- package/src/unstable/sql/Migrator.ts +5 -5
- package/src/unstable/sql/SqlClient.ts +4 -0
- package/src/unstable/sql/SqlConnection.ts +3 -3
- package/src/unstable/sql/SqlError.ts +18 -0
- package/src/unstable/sql/SqlModel.ts +0 -1
- package/src/unstable/sql/SqlSchema.ts +5 -5
- package/src/unstable/sql/SqlStream.ts +1 -0
- package/src/unstable/sql/Statement.ts +27 -24
- package/src/unstable/sql/index.ts +178 -0
- package/src/unstable/workers/Transferable.ts +7 -7
- package/src/unstable/workers/Worker.ts +1 -0
- package/src/unstable/workers/WorkerError.ts +8 -8
- package/src/unstable/workers/index.ts +80 -0
- package/src/unstable/workflow/Activity.ts +7 -7
- package/src/unstable/workflow/DurableClock.ts +2 -2
- package/src/unstable/workflow/DurableDeferred.ts +22 -20
- package/src/unstable/workflow/DurableQueue.ts +7 -5
- package/src/unstable/workflow/Workflow.ts +12 -10
- package/src/unstable/workflow/WorkflowEngine.ts +4 -4
- package/src/unstable/workflow/WorkflowProxy.ts +10 -12
- package/src/unstable/workflow/WorkflowProxyServer.ts +3 -2
- package/src/unstable/workflow/index.ts +160 -0
package/src/BigDecimal.ts
CHANGED
|
@@ -159,16 +159,16 @@ const one = makeNormalizedUnsafe(bigint1, 0)
|
|
|
159
159
|
* **Example** (Normalizing trailing zeros)
|
|
160
160
|
*
|
|
161
161
|
* ```ts
|
|
162
|
-
* import {
|
|
162
|
+
* import { BigDecimal } from "effect"
|
|
163
163
|
* import * as assert from "node:assert"
|
|
164
164
|
*
|
|
165
165
|
* assert.deepStrictEqual(
|
|
166
|
-
* normalize(fromStringUnsafe("123.00000")),
|
|
167
|
-
* normalize(make(123n, 0))
|
|
166
|
+
* BigDecimal.normalize(BigDecimal.fromStringUnsafe("123.00000")),
|
|
167
|
+
* BigDecimal.normalize(BigDecimal.make(123n, 0))
|
|
168
168
|
* )
|
|
169
169
|
* assert.deepStrictEqual(
|
|
170
|
-
* normalize(fromStringUnsafe("12300000")),
|
|
171
|
-
* normalize(make(123n, -5))
|
|
170
|
+
* BigDecimal.normalize(BigDecimal.fromStringUnsafe("12300000")),
|
|
171
|
+
* BigDecimal.normalize(BigDecimal.make(123n, -5))
|
|
172
172
|
* )
|
|
173
173
|
* ```
|
|
174
174
|
*
|
|
@@ -303,12 +303,12 @@ export const scale: {
|
|
|
303
303
|
* **Example** (Adding decimals)
|
|
304
304
|
*
|
|
305
305
|
* ```ts
|
|
306
|
-
* import {
|
|
306
|
+
* import { BigDecimal } from "effect"
|
|
307
307
|
* import * as assert from "node:assert"
|
|
308
308
|
*
|
|
309
309
|
* assert.deepStrictEqual(
|
|
310
|
-
* sum(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
311
|
-
* fromStringUnsafe("5")
|
|
310
|
+
* BigDecimal.sum(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
311
|
+
* BigDecimal.fromStringUnsafe("5")
|
|
312
312
|
* )
|
|
313
313
|
* ```
|
|
314
314
|
*
|
|
@@ -322,12 +322,12 @@ export const sum: {
|
|
|
322
322
|
* **Example** (Adding decimals)
|
|
323
323
|
*
|
|
324
324
|
* ```ts
|
|
325
|
-
* import {
|
|
325
|
+
* import { BigDecimal } from "effect"
|
|
326
326
|
* import * as assert from "node:assert"
|
|
327
327
|
*
|
|
328
328
|
* assert.deepStrictEqual(
|
|
329
|
-
* sum(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
330
|
-
* fromStringUnsafe("5")
|
|
329
|
+
* BigDecimal.sum(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
330
|
+
* BigDecimal.fromStringUnsafe("5")
|
|
331
331
|
* )
|
|
332
332
|
* ```
|
|
333
333
|
*
|
|
@@ -341,12 +341,12 @@ export const sum: {
|
|
|
341
341
|
* **Example** (Adding decimals)
|
|
342
342
|
*
|
|
343
343
|
* ```ts
|
|
344
|
-
* import {
|
|
344
|
+
* import { BigDecimal } from "effect"
|
|
345
345
|
* import * as assert from "node:assert"
|
|
346
346
|
*
|
|
347
347
|
* assert.deepStrictEqual(
|
|
348
|
-
* sum(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
349
|
-
* fromStringUnsafe("5")
|
|
348
|
+
* BigDecimal.sum(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
349
|
+
* BigDecimal.fromStringUnsafe("5")
|
|
350
350
|
* )
|
|
351
351
|
* ```
|
|
352
352
|
*
|
|
@@ -380,17 +380,17 @@ export const sum: {
|
|
|
380
380
|
* **Example** (Adding multiple decimals)
|
|
381
381
|
*
|
|
382
382
|
* ```ts
|
|
383
|
-
* import {
|
|
383
|
+
* import { BigDecimal } from "effect"
|
|
384
384
|
* import * as assert from "node:assert"
|
|
385
385
|
*
|
|
386
386
|
* assert.deepStrictEqual(
|
|
387
|
-
* sumAll([fromStringUnsafe("2"), fromStringUnsafe("3"), fromStringUnsafe("4")]),
|
|
388
|
-
* fromStringUnsafe("9")
|
|
387
|
+
* BigDecimal.sumAll([BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("4")]),
|
|
388
|
+
* BigDecimal.fromStringUnsafe("9")
|
|
389
389
|
* )
|
|
390
390
|
* ```
|
|
391
391
|
*
|
|
392
392
|
* @category math
|
|
393
|
-
* @since
|
|
393
|
+
* @since 3.16.0
|
|
394
394
|
*/
|
|
395
395
|
export const sumAll = (collection: Iterable<BigDecimal>): BigDecimal => {
|
|
396
396
|
let out: BigDecimal = zero
|
|
@@ -406,12 +406,12 @@ export const sumAll = (collection: Iterable<BigDecimal>): BigDecimal => {
|
|
|
406
406
|
* **Example** (Multiplying decimals)
|
|
407
407
|
*
|
|
408
408
|
* ```ts
|
|
409
|
-
* import {
|
|
409
|
+
* import { BigDecimal } from "effect"
|
|
410
410
|
* import * as assert from "node:assert"
|
|
411
411
|
*
|
|
412
412
|
* assert.deepStrictEqual(
|
|
413
|
-
* multiply(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
414
|
-
* fromStringUnsafe("6")
|
|
413
|
+
* BigDecimal.multiply(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
414
|
+
* BigDecimal.fromStringUnsafe("6")
|
|
415
415
|
* )
|
|
416
416
|
* ```
|
|
417
417
|
*
|
|
@@ -425,12 +425,12 @@ export const multiply: {
|
|
|
425
425
|
* **Example** (Multiplying decimals)
|
|
426
426
|
*
|
|
427
427
|
* ```ts
|
|
428
|
-
* import {
|
|
428
|
+
* import { BigDecimal } from "effect"
|
|
429
429
|
* import * as assert from "node:assert"
|
|
430
430
|
*
|
|
431
431
|
* assert.deepStrictEqual(
|
|
432
|
-
* multiply(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
433
|
-
* fromStringUnsafe("6")
|
|
432
|
+
* BigDecimal.multiply(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
433
|
+
* BigDecimal.fromStringUnsafe("6")
|
|
434
434
|
* )
|
|
435
435
|
* ```
|
|
436
436
|
*
|
|
@@ -444,12 +444,12 @@ export const multiply: {
|
|
|
444
444
|
* **Example** (Multiplying decimals)
|
|
445
445
|
*
|
|
446
446
|
* ```ts
|
|
447
|
-
* import {
|
|
447
|
+
* import { BigDecimal } from "effect"
|
|
448
448
|
* import * as assert from "node:assert"
|
|
449
449
|
*
|
|
450
450
|
* assert.deepStrictEqual(
|
|
451
|
-
* multiply(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
452
|
-
* fromStringUnsafe("6")
|
|
451
|
+
* BigDecimal.multiply(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
452
|
+
* BigDecimal.fromStringUnsafe("6")
|
|
453
453
|
* )
|
|
454
454
|
* ```
|
|
455
455
|
*
|
|
@@ -471,12 +471,12 @@ export const multiply: {
|
|
|
471
471
|
* **Example** (Multiplying multiple decimals)
|
|
472
472
|
*
|
|
473
473
|
* ```ts
|
|
474
|
-
* import {
|
|
474
|
+
* import { BigDecimal } from "effect"
|
|
475
475
|
* import * as assert from "node:assert"
|
|
476
476
|
*
|
|
477
477
|
* assert.deepStrictEqual(
|
|
478
|
-
* multiplyAll([fromStringUnsafe("2"), fromStringUnsafe("3"), fromStringUnsafe("4")]),
|
|
479
|
-
* fromStringUnsafe("24")
|
|
478
|
+
* BigDecimal.multiplyAll([BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("4")]),
|
|
479
|
+
* BigDecimal.fromStringUnsafe("24")
|
|
480
480
|
* )
|
|
481
481
|
* ```
|
|
482
482
|
*
|
|
@@ -500,12 +500,12 @@ export const multiplyAll = (collection: Iterable<BigDecimal>): BigDecimal => {
|
|
|
500
500
|
* **Example** (Subtracting decimals)
|
|
501
501
|
*
|
|
502
502
|
* ```ts
|
|
503
|
-
* import {
|
|
503
|
+
* import { BigDecimal } from "effect"
|
|
504
504
|
* import * as assert from "node:assert"
|
|
505
505
|
*
|
|
506
506
|
* assert.deepStrictEqual(
|
|
507
|
-
* subtract(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
508
|
-
* fromStringUnsafe("-1")
|
|
507
|
+
* BigDecimal.subtract(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
508
|
+
* BigDecimal.fromStringUnsafe("-1")
|
|
509
509
|
* )
|
|
510
510
|
* ```
|
|
511
511
|
*
|
|
@@ -519,12 +519,12 @@ export const subtract: {
|
|
|
519
519
|
* **Example** (Subtracting decimals)
|
|
520
520
|
*
|
|
521
521
|
* ```ts
|
|
522
|
-
* import {
|
|
522
|
+
* import { BigDecimal } from "effect"
|
|
523
523
|
* import * as assert from "node:assert"
|
|
524
524
|
*
|
|
525
525
|
* assert.deepStrictEqual(
|
|
526
|
-
* subtract(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
527
|
-
* fromStringUnsafe("-1")
|
|
526
|
+
* BigDecimal.subtract(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
527
|
+
* BigDecimal.fromStringUnsafe("-1")
|
|
528
528
|
* )
|
|
529
529
|
* ```
|
|
530
530
|
*
|
|
@@ -538,12 +538,12 @@ export const subtract: {
|
|
|
538
538
|
* **Example** (Subtracting decimals)
|
|
539
539
|
*
|
|
540
540
|
* ```ts
|
|
541
|
-
* import {
|
|
541
|
+
* import { BigDecimal } from "effect"
|
|
542
542
|
* import * as assert from "node:assert"
|
|
543
543
|
*
|
|
544
544
|
* assert.deepStrictEqual(
|
|
545
|
-
* subtract(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
546
|
-
* fromStringUnsafe("-1")
|
|
545
|
+
* BigDecimal.subtract(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
546
|
+
* BigDecimal.fromStringUnsafe("-1")
|
|
547
547
|
* )
|
|
548
548
|
* ```
|
|
549
549
|
*
|
|
@@ -796,14 +796,14 @@ export const divide: {
|
|
|
796
796
|
* **Example** (Dividing decimals unsafely)
|
|
797
797
|
*
|
|
798
798
|
* ```ts
|
|
799
|
-
* import {
|
|
799
|
+
* import { BigDecimal } from "effect"
|
|
800
800
|
*
|
|
801
|
-
* console.log(divideUnsafe(fromStringUnsafe("6"), fromStringUnsafe("3"))) // BigDecimal(2)
|
|
802
|
-
* console.log(divideUnsafe(fromStringUnsafe("6"), fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
801
|
+
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("3"))) // BigDecimal(2)
|
|
802
|
+
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
803
803
|
* ```
|
|
804
804
|
*
|
|
805
805
|
* @category math
|
|
806
|
-
* @since
|
|
806
|
+
* @since 4.0.0
|
|
807
807
|
*/
|
|
808
808
|
export const divideUnsafe: {
|
|
809
809
|
/**
|
|
@@ -817,14 +817,14 @@ export const divideUnsafe: {
|
|
|
817
817
|
* **Example** (Dividing decimals unsafely)
|
|
818
818
|
*
|
|
819
819
|
* ```ts
|
|
820
|
-
* import {
|
|
820
|
+
* import { BigDecimal } from "effect"
|
|
821
821
|
*
|
|
822
|
-
* console.log(divideUnsafe(fromStringUnsafe("6"), fromStringUnsafe("3"))) // BigDecimal(2)
|
|
823
|
-
* console.log(divideUnsafe(fromStringUnsafe("6"), fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
822
|
+
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("3"))) // BigDecimal(2)
|
|
823
|
+
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
824
824
|
* ```
|
|
825
825
|
*
|
|
826
826
|
* @category math
|
|
827
|
-
* @since
|
|
827
|
+
* @since 4.0.0
|
|
828
828
|
*/
|
|
829
829
|
(that: BigDecimal): (self: BigDecimal) => BigDecimal
|
|
830
830
|
/**
|
|
@@ -838,14 +838,14 @@ export const divideUnsafe: {
|
|
|
838
838
|
* **Example** (Dividing decimals unsafely)
|
|
839
839
|
*
|
|
840
840
|
* ```ts
|
|
841
|
-
* import {
|
|
841
|
+
* import { BigDecimal } from "effect"
|
|
842
842
|
*
|
|
843
|
-
* console.log(divideUnsafe(fromStringUnsafe("6"), fromStringUnsafe("3"))) // BigDecimal(2)
|
|
844
|
-
* console.log(divideUnsafe(fromStringUnsafe("6"), fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
843
|
+
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("3"))) // BigDecimal(2)
|
|
844
|
+
* console.log(BigDecimal.divideUnsafe(BigDecimal.fromStringUnsafe("6"), BigDecimal.fromStringUnsafe("4"))) // BigDecimal(1.5)
|
|
845
845
|
* ```
|
|
846
846
|
*
|
|
847
847
|
* @category math
|
|
848
|
-
* @since
|
|
848
|
+
* @since 4.0.0
|
|
849
849
|
*/
|
|
850
850
|
(self: BigDecimal, that: BigDecimal): BigDecimal
|
|
851
851
|
} = dual(2, (self: BigDecimal, that: BigDecimal): BigDecimal => {
|
|
@@ -907,25 +907,25 @@ export const Order: order.Order<BigDecimal> = order.make((self, that) => {
|
|
|
907
907
|
* **Example** (Checking less-than comparisons)
|
|
908
908
|
*
|
|
909
909
|
* ```ts
|
|
910
|
-
* import {
|
|
910
|
+
* import { BigDecimal } from "effect"
|
|
911
911
|
* import * as assert from "node:assert"
|
|
912
912
|
*
|
|
913
913
|
* assert.deepStrictEqual(
|
|
914
|
-
* isLessThan(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
914
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
915
915
|
* true
|
|
916
916
|
* )
|
|
917
917
|
* assert.deepStrictEqual(
|
|
918
|
-
* isLessThan(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
918
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
919
919
|
* false
|
|
920
920
|
* )
|
|
921
921
|
* assert.deepStrictEqual(
|
|
922
|
-
* isLessThan(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
922
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
923
923
|
* false
|
|
924
924
|
* )
|
|
925
925
|
* ```
|
|
926
926
|
*
|
|
927
927
|
* @category predicates
|
|
928
|
-
* @since
|
|
928
|
+
* @since 4.0.0
|
|
929
929
|
*/
|
|
930
930
|
export const isLessThan: {
|
|
931
931
|
/**
|
|
@@ -934,25 +934,25 @@ export const isLessThan: {
|
|
|
934
934
|
* **Example** (Checking less-than comparisons)
|
|
935
935
|
*
|
|
936
936
|
* ```ts
|
|
937
|
-
* import {
|
|
937
|
+
* import { BigDecimal } from "effect"
|
|
938
938
|
* import * as assert from "node:assert"
|
|
939
939
|
*
|
|
940
940
|
* assert.deepStrictEqual(
|
|
941
|
-
* isLessThan(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
941
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
942
942
|
* true
|
|
943
943
|
* )
|
|
944
944
|
* assert.deepStrictEqual(
|
|
945
|
-
* isLessThan(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
945
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
946
946
|
* false
|
|
947
947
|
* )
|
|
948
948
|
* assert.deepStrictEqual(
|
|
949
|
-
* isLessThan(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
949
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
950
950
|
* false
|
|
951
951
|
* )
|
|
952
952
|
* ```
|
|
953
953
|
*
|
|
954
954
|
* @category predicates
|
|
955
|
-
* @since
|
|
955
|
+
* @since 4.0.0
|
|
956
956
|
*/
|
|
957
957
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
958
958
|
/**
|
|
@@ -961,25 +961,25 @@ export const isLessThan: {
|
|
|
961
961
|
* **Example** (Checking less-than comparisons)
|
|
962
962
|
*
|
|
963
963
|
* ```ts
|
|
964
|
-
* import {
|
|
964
|
+
* import { BigDecimal } from "effect"
|
|
965
965
|
* import * as assert from "node:assert"
|
|
966
966
|
*
|
|
967
967
|
* assert.deepStrictEqual(
|
|
968
|
-
* isLessThan(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
968
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
969
969
|
* true
|
|
970
970
|
* )
|
|
971
971
|
* assert.deepStrictEqual(
|
|
972
|
-
* isLessThan(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
972
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
973
973
|
* false
|
|
974
974
|
* )
|
|
975
975
|
* assert.deepStrictEqual(
|
|
976
|
-
* isLessThan(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
976
|
+
* BigDecimal.isLessThan(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
977
977
|
* false
|
|
978
978
|
* )
|
|
979
979
|
* ```
|
|
980
980
|
*
|
|
981
981
|
* @category predicates
|
|
982
|
-
* @since
|
|
982
|
+
* @since 4.0.0
|
|
983
983
|
*/
|
|
984
984
|
(self: BigDecimal, that: BigDecimal): boolean
|
|
985
985
|
} = order.isLessThan(Order)
|
|
@@ -990,25 +990,25 @@ export const isLessThan: {
|
|
|
990
990
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
991
991
|
*
|
|
992
992
|
* ```ts
|
|
993
|
-
* import {
|
|
993
|
+
* import { BigDecimal } from "effect"
|
|
994
994
|
* import * as assert from "node:assert"
|
|
995
995
|
*
|
|
996
996
|
* assert.deepStrictEqual(
|
|
997
|
-
* isLessThanOrEqualTo(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
997
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
998
998
|
* true
|
|
999
999
|
* )
|
|
1000
1000
|
* assert.deepStrictEqual(
|
|
1001
|
-
* isLessThanOrEqualTo(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1001
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1002
1002
|
* true
|
|
1003
1003
|
* )
|
|
1004
1004
|
* assert.deepStrictEqual(
|
|
1005
|
-
* isLessThanOrEqualTo(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1005
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1006
1006
|
* false
|
|
1007
1007
|
* )
|
|
1008
1008
|
* ```
|
|
1009
1009
|
*
|
|
1010
1010
|
* @category predicates
|
|
1011
|
-
* @since
|
|
1011
|
+
* @since 4.0.0
|
|
1012
1012
|
*/
|
|
1013
1013
|
export const isLessThanOrEqualTo: {
|
|
1014
1014
|
/**
|
|
@@ -1017,25 +1017,25 @@ export const isLessThanOrEqualTo: {
|
|
|
1017
1017
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1018
1018
|
*
|
|
1019
1019
|
* ```ts
|
|
1020
|
-
* import {
|
|
1020
|
+
* import { BigDecimal } from "effect"
|
|
1021
1021
|
* import * as assert from "node:assert"
|
|
1022
1022
|
*
|
|
1023
1023
|
* assert.deepStrictEqual(
|
|
1024
|
-
* isLessThanOrEqualTo(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1024
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1025
1025
|
* true
|
|
1026
1026
|
* )
|
|
1027
1027
|
* assert.deepStrictEqual(
|
|
1028
|
-
* isLessThanOrEqualTo(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1028
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1029
1029
|
* true
|
|
1030
1030
|
* )
|
|
1031
1031
|
* assert.deepStrictEqual(
|
|
1032
|
-
* isLessThanOrEqualTo(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1032
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1033
1033
|
* false
|
|
1034
1034
|
* )
|
|
1035
1035
|
* ```
|
|
1036
1036
|
*
|
|
1037
1037
|
* @category predicates
|
|
1038
|
-
* @since
|
|
1038
|
+
* @since 4.0.0
|
|
1039
1039
|
*/
|
|
1040
1040
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
1041
1041
|
/**
|
|
@@ -1044,25 +1044,25 @@ export const isLessThanOrEqualTo: {
|
|
|
1044
1044
|
* **Example** (Checking less-than-or-equal comparisons)
|
|
1045
1045
|
*
|
|
1046
1046
|
* ```ts
|
|
1047
|
-
* import {
|
|
1047
|
+
* import { BigDecimal } from "effect"
|
|
1048
1048
|
* import * as assert from "node:assert"
|
|
1049
1049
|
*
|
|
1050
1050
|
* assert.deepStrictEqual(
|
|
1051
|
-
* isLessThanOrEqualTo(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1051
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1052
1052
|
* true
|
|
1053
1053
|
* )
|
|
1054
1054
|
* assert.deepStrictEqual(
|
|
1055
|
-
* isLessThanOrEqualTo(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1055
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1056
1056
|
* true
|
|
1057
1057
|
* )
|
|
1058
1058
|
* assert.deepStrictEqual(
|
|
1059
|
-
* isLessThanOrEqualTo(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1059
|
+
* BigDecimal.isLessThanOrEqualTo(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1060
1060
|
* false
|
|
1061
1061
|
* )
|
|
1062
1062
|
* ```
|
|
1063
1063
|
*
|
|
1064
1064
|
* @category predicates
|
|
1065
|
-
* @since
|
|
1065
|
+
* @since 4.0.0
|
|
1066
1066
|
*/
|
|
1067
1067
|
(self: BigDecimal, that: BigDecimal): boolean
|
|
1068
1068
|
} = order.isLessThanOrEqualTo(Order)
|
|
@@ -1073,25 +1073,25 @@ export const isLessThanOrEqualTo: {
|
|
|
1073
1073
|
* **Example** (Checking greater-than comparisons)
|
|
1074
1074
|
*
|
|
1075
1075
|
* ```ts
|
|
1076
|
-
* import {
|
|
1076
|
+
* import { BigDecimal } from "effect"
|
|
1077
1077
|
* import * as assert from "node:assert"
|
|
1078
1078
|
*
|
|
1079
1079
|
* assert.deepStrictEqual(
|
|
1080
|
-
* isGreaterThan(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1080
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1081
1081
|
* false
|
|
1082
1082
|
* )
|
|
1083
1083
|
* assert.deepStrictEqual(
|
|
1084
|
-
* isGreaterThan(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1084
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1085
1085
|
* false
|
|
1086
1086
|
* )
|
|
1087
1087
|
* assert.deepStrictEqual(
|
|
1088
|
-
* isGreaterThan(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1088
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1089
1089
|
* true
|
|
1090
1090
|
* )
|
|
1091
1091
|
* ```
|
|
1092
1092
|
*
|
|
1093
1093
|
* @category predicates
|
|
1094
|
-
* @since
|
|
1094
|
+
* @since 4.0.0
|
|
1095
1095
|
*/
|
|
1096
1096
|
export const isGreaterThan: {
|
|
1097
1097
|
/**
|
|
@@ -1100,25 +1100,25 @@ export const isGreaterThan: {
|
|
|
1100
1100
|
* **Example** (Checking greater-than comparisons)
|
|
1101
1101
|
*
|
|
1102
1102
|
* ```ts
|
|
1103
|
-
* import {
|
|
1103
|
+
* import { BigDecimal } from "effect"
|
|
1104
1104
|
* import * as assert from "node:assert"
|
|
1105
1105
|
*
|
|
1106
1106
|
* assert.deepStrictEqual(
|
|
1107
|
-
* isGreaterThan(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1107
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1108
1108
|
* false
|
|
1109
1109
|
* )
|
|
1110
1110
|
* assert.deepStrictEqual(
|
|
1111
|
-
* isGreaterThan(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1111
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1112
1112
|
* false
|
|
1113
1113
|
* )
|
|
1114
1114
|
* assert.deepStrictEqual(
|
|
1115
|
-
* isGreaterThan(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1115
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1116
1116
|
* true
|
|
1117
1117
|
* )
|
|
1118
1118
|
* ```
|
|
1119
1119
|
*
|
|
1120
1120
|
* @category predicates
|
|
1121
|
-
* @since
|
|
1121
|
+
* @since 4.0.0
|
|
1122
1122
|
*/
|
|
1123
1123
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
1124
1124
|
/**
|
|
@@ -1127,25 +1127,25 @@ export const isGreaterThan: {
|
|
|
1127
1127
|
* **Example** (Checking greater-than comparisons)
|
|
1128
1128
|
*
|
|
1129
1129
|
* ```ts
|
|
1130
|
-
* import {
|
|
1130
|
+
* import { BigDecimal } from "effect"
|
|
1131
1131
|
* import * as assert from "node:assert"
|
|
1132
1132
|
*
|
|
1133
1133
|
* assert.deepStrictEqual(
|
|
1134
|
-
* isGreaterThan(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1134
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1135
1135
|
* false
|
|
1136
1136
|
* )
|
|
1137
1137
|
* assert.deepStrictEqual(
|
|
1138
|
-
* isGreaterThan(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1138
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1139
1139
|
* false
|
|
1140
1140
|
* )
|
|
1141
1141
|
* assert.deepStrictEqual(
|
|
1142
|
-
* isGreaterThan(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1142
|
+
* BigDecimal.isGreaterThan(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1143
1143
|
* true
|
|
1144
1144
|
* )
|
|
1145
1145
|
* ```
|
|
1146
1146
|
*
|
|
1147
1147
|
* @category predicates
|
|
1148
|
-
* @since
|
|
1148
|
+
* @since 4.0.0
|
|
1149
1149
|
*/
|
|
1150
1150
|
(self: BigDecimal, that: BigDecimal): boolean
|
|
1151
1151
|
} = order.isGreaterThan(Order)
|
|
@@ -1156,25 +1156,25 @@ export const isGreaterThan: {
|
|
|
1156
1156
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1157
1157
|
*
|
|
1158
1158
|
* ```ts
|
|
1159
|
-
* import {
|
|
1159
|
+
* import { BigDecimal } from "effect"
|
|
1160
1160
|
* import * as assert from "node:assert"
|
|
1161
1161
|
*
|
|
1162
1162
|
* assert.deepStrictEqual(
|
|
1163
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1163
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1164
1164
|
* false
|
|
1165
1165
|
* )
|
|
1166
1166
|
* assert.deepStrictEqual(
|
|
1167
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1167
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1168
1168
|
* true
|
|
1169
1169
|
* )
|
|
1170
1170
|
* assert.deepStrictEqual(
|
|
1171
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1171
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1172
1172
|
* true
|
|
1173
1173
|
* )
|
|
1174
1174
|
* ```
|
|
1175
1175
|
*
|
|
1176
1176
|
* @category predicates
|
|
1177
|
-
* @since
|
|
1177
|
+
* @since 4.0.0
|
|
1178
1178
|
*/
|
|
1179
1179
|
export const isGreaterThanOrEqualTo: {
|
|
1180
1180
|
/**
|
|
@@ -1183,25 +1183,25 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1183
1183
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1184
1184
|
*
|
|
1185
1185
|
* ```ts
|
|
1186
|
-
* import {
|
|
1186
|
+
* import { BigDecimal } from "effect"
|
|
1187
1187
|
* import * as assert from "node:assert"
|
|
1188
1188
|
*
|
|
1189
1189
|
* assert.deepStrictEqual(
|
|
1190
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1190
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1191
1191
|
* false
|
|
1192
1192
|
* )
|
|
1193
1193
|
* assert.deepStrictEqual(
|
|
1194
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1194
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1195
1195
|
* true
|
|
1196
1196
|
* )
|
|
1197
1197
|
* assert.deepStrictEqual(
|
|
1198
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1198
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1199
1199
|
* true
|
|
1200
1200
|
* )
|
|
1201
1201
|
* ```
|
|
1202
1202
|
*
|
|
1203
1203
|
* @category predicates
|
|
1204
|
-
* @since
|
|
1204
|
+
* @since 4.0.0
|
|
1205
1205
|
*/
|
|
1206
1206
|
(that: BigDecimal): (self: BigDecimal) => boolean
|
|
1207
1207
|
/**
|
|
@@ -1210,25 +1210,25 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1210
1210
|
* **Example** (Checking greater-than-or-equal comparisons)
|
|
1211
1211
|
*
|
|
1212
1212
|
* ```ts
|
|
1213
|
-
* import {
|
|
1213
|
+
* import { BigDecimal } from "effect"
|
|
1214
1214
|
* import * as assert from "node:assert"
|
|
1215
1215
|
*
|
|
1216
1216
|
* assert.deepStrictEqual(
|
|
1217
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1217
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1218
1218
|
* false
|
|
1219
1219
|
* )
|
|
1220
1220
|
* assert.deepStrictEqual(
|
|
1221
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("3"), fromStringUnsafe("3")),
|
|
1221
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("3")),
|
|
1222
1222
|
* true
|
|
1223
1223
|
* )
|
|
1224
1224
|
* assert.deepStrictEqual(
|
|
1225
|
-
* isGreaterThanOrEqualTo(fromStringUnsafe("4"), fromStringUnsafe("3")),
|
|
1225
|
+
* BigDecimal.isGreaterThanOrEqualTo(BigDecimal.fromStringUnsafe("4"), BigDecimal.fromStringUnsafe("3")),
|
|
1226
1226
|
* true
|
|
1227
1227
|
* )
|
|
1228
1228
|
* ```
|
|
1229
1229
|
*
|
|
1230
1230
|
* @category predicates
|
|
1231
|
-
* @since
|
|
1231
|
+
* @since 4.0.0
|
|
1232
1232
|
*/
|
|
1233
1233
|
(self: BigDecimal, that: BigDecimal): boolean
|
|
1234
1234
|
} = order.isGreaterThanOrEqualTo(Order)
|
|
@@ -1442,12 +1442,12 @@ export const clamp: {
|
|
|
1442
1442
|
* **Example** (Selecting the smaller decimal)
|
|
1443
1443
|
*
|
|
1444
1444
|
* ```ts
|
|
1445
|
-
* import {
|
|
1445
|
+
* import { BigDecimal } from "effect"
|
|
1446
1446
|
* import * as assert from "node:assert"
|
|
1447
1447
|
*
|
|
1448
1448
|
* assert.deepStrictEqual(
|
|
1449
|
-
* min(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1450
|
-
* fromStringUnsafe("2")
|
|
1449
|
+
* BigDecimal.min(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1450
|
+
* BigDecimal.fromStringUnsafe("2")
|
|
1451
1451
|
* )
|
|
1452
1452
|
* ```
|
|
1453
1453
|
*
|
|
@@ -1461,12 +1461,12 @@ export const min: {
|
|
|
1461
1461
|
* **Example** (Selecting the smaller decimal)
|
|
1462
1462
|
*
|
|
1463
1463
|
* ```ts
|
|
1464
|
-
* import {
|
|
1464
|
+
* import { BigDecimal } from "effect"
|
|
1465
1465
|
* import * as assert from "node:assert"
|
|
1466
1466
|
*
|
|
1467
1467
|
* assert.deepStrictEqual(
|
|
1468
|
-
* min(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1469
|
-
* fromStringUnsafe("2")
|
|
1468
|
+
* BigDecimal.min(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1469
|
+
* BigDecimal.fromStringUnsafe("2")
|
|
1470
1470
|
* )
|
|
1471
1471
|
* ```
|
|
1472
1472
|
*
|
|
@@ -1480,12 +1480,12 @@ export const min: {
|
|
|
1480
1480
|
* **Example** (Selecting the smaller decimal)
|
|
1481
1481
|
*
|
|
1482
1482
|
* ```ts
|
|
1483
|
-
* import {
|
|
1483
|
+
* import { BigDecimal } from "effect"
|
|
1484
1484
|
* import * as assert from "node:assert"
|
|
1485
1485
|
*
|
|
1486
1486
|
* assert.deepStrictEqual(
|
|
1487
|
-
* min(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1488
|
-
* fromStringUnsafe("2")
|
|
1487
|
+
* BigDecimal.min(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1488
|
+
* BigDecimal.fromStringUnsafe("2")
|
|
1489
1489
|
* )
|
|
1490
1490
|
* ```
|
|
1491
1491
|
*
|
|
@@ -1501,12 +1501,12 @@ export const min: {
|
|
|
1501
1501
|
* **Example** (Selecting the larger decimal)
|
|
1502
1502
|
*
|
|
1503
1503
|
* ```ts
|
|
1504
|
-
* import {
|
|
1504
|
+
* import { BigDecimal } from "effect"
|
|
1505
1505
|
* import * as assert from "node:assert"
|
|
1506
1506
|
*
|
|
1507
1507
|
* assert.deepStrictEqual(
|
|
1508
|
-
* max(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1509
|
-
* fromStringUnsafe("3")
|
|
1508
|
+
* BigDecimal.max(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1509
|
+
* BigDecimal.fromStringUnsafe("3")
|
|
1510
1510
|
* )
|
|
1511
1511
|
* ```
|
|
1512
1512
|
*
|
|
@@ -1520,12 +1520,12 @@ export const max: {
|
|
|
1520
1520
|
* **Example** (Selecting the larger decimal)
|
|
1521
1521
|
*
|
|
1522
1522
|
* ```ts
|
|
1523
|
-
* import {
|
|
1523
|
+
* import { BigDecimal } from "effect"
|
|
1524
1524
|
* import * as assert from "node:assert"
|
|
1525
1525
|
*
|
|
1526
1526
|
* assert.deepStrictEqual(
|
|
1527
|
-
* max(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1528
|
-
* fromStringUnsafe("3")
|
|
1527
|
+
* BigDecimal.max(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1528
|
+
* BigDecimal.fromStringUnsafe("3")
|
|
1529
1529
|
* )
|
|
1530
1530
|
* ```
|
|
1531
1531
|
*
|
|
@@ -1539,12 +1539,12 @@ export const max: {
|
|
|
1539
1539
|
* **Example** (Selecting the larger decimal)
|
|
1540
1540
|
*
|
|
1541
1541
|
* ```ts
|
|
1542
|
-
* import {
|
|
1542
|
+
* import { BigDecimal } from "effect"
|
|
1543
1543
|
* import * as assert from "node:assert"
|
|
1544
1544
|
*
|
|
1545
1545
|
* assert.deepStrictEqual(
|
|
1546
|
-
* max(fromStringUnsafe("2"), fromStringUnsafe("3")),
|
|
1547
|
-
* fromStringUnsafe("3")
|
|
1546
|
+
* BigDecimal.max(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
|
|
1547
|
+
* BigDecimal.fromStringUnsafe("3")
|
|
1548
1548
|
* )
|
|
1549
1549
|
* ```
|
|
1550
1550
|
*
|
|
@@ -1560,12 +1560,12 @@ export const max: {
|
|
|
1560
1560
|
* **Example** (Reading decimal signs)
|
|
1561
1561
|
*
|
|
1562
1562
|
* ```ts
|
|
1563
|
-
* import {
|
|
1563
|
+
* import { BigDecimal } from "effect"
|
|
1564
1564
|
* import * as assert from "node:assert"
|
|
1565
1565
|
*
|
|
1566
|
-
* assert.deepStrictEqual(sign(fromStringUnsafe("-5")), -1)
|
|
1567
|
-
* assert.deepStrictEqual(sign(fromStringUnsafe("0")), 0)
|
|
1568
|
-
* assert.deepStrictEqual(sign(fromStringUnsafe("5")), 1)
|
|
1566
|
+
* assert.deepStrictEqual(BigDecimal.sign(BigDecimal.fromStringUnsafe("-5")), -1)
|
|
1567
|
+
* assert.deepStrictEqual(BigDecimal.sign(BigDecimal.fromStringUnsafe("0")), 0)
|
|
1568
|
+
* assert.deepStrictEqual(BigDecimal.sign(BigDecimal.fromStringUnsafe("5")), 1)
|
|
1569
1569
|
* ```
|
|
1570
1570
|
*
|
|
1571
1571
|
* @category math
|
|
@@ -1579,12 +1579,12 @@ export const sign = (n: BigDecimal): Ordering => n.value === bigint0 ? 0 : n.val
|
|
|
1579
1579
|
* **Example** (Calculating absolute values)
|
|
1580
1580
|
*
|
|
1581
1581
|
* ```ts
|
|
1582
|
-
* import {
|
|
1582
|
+
* import { BigDecimal } from "effect"
|
|
1583
1583
|
* import * as assert from "node:assert"
|
|
1584
1584
|
*
|
|
1585
|
-
* assert.deepStrictEqual(abs(fromStringUnsafe("-5")), fromStringUnsafe("5"))
|
|
1586
|
-
* assert.deepStrictEqual(abs(fromStringUnsafe("0")), fromStringUnsafe("0"))
|
|
1587
|
-
* assert.deepStrictEqual(abs(fromStringUnsafe("5")), fromStringUnsafe("5"))
|
|
1585
|
+
* assert.deepStrictEqual(BigDecimal.abs(BigDecimal.fromStringUnsafe("-5")), BigDecimal.fromStringUnsafe("5"))
|
|
1586
|
+
* assert.deepStrictEqual(BigDecimal.abs(BigDecimal.fromStringUnsafe("0")), BigDecimal.fromStringUnsafe("0"))
|
|
1587
|
+
* assert.deepStrictEqual(BigDecimal.abs(BigDecimal.fromStringUnsafe("5")), BigDecimal.fromStringUnsafe("5"))
|
|
1588
1588
|
* ```
|
|
1589
1589
|
*
|
|
1590
1590
|
* @category math
|
|
@@ -1598,11 +1598,11 @@ export const abs = (n: BigDecimal): BigDecimal => n.value < bigint0 ? make(-n.va
|
|
|
1598
1598
|
* **Example** (Negating decimals)
|
|
1599
1599
|
*
|
|
1600
1600
|
* ```ts
|
|
1601
|
-
* import {
|
|
1601
|
+
* import { BigDecimal } from "effect"
|
|
1602
1602
|
* import * as assert from "node:assert"
|
|
1603
1603
|
*
|
|
1604
|
-
* assert.deepStrictEqual(negate(fromStringUnsafe("3")), fromStringUnsafe("-3"))
|
|
1605
|
-
* assert.deepStrictEqual(negate(fromStringUnsafe("-6")), fromStringUnsafe("6"))
|
|
1604
|
+
* assert.deepStrictEqual(BigDecimal.negate(BigDecimal.fromStringUnsafe("3")), BigDecimal.fromStringUnsafe("-3"))
|
|
1605
|
+
* assert.deepStrictEqual(BigDecimal.negate(BigDecimal.fromStringUnsafe("-6")), BigDecimal.fromStringUnsafe("6"))
|
|
1606
1606
|
* ```
|
|
1607
1607
|
*
|
|
1608
1608
|
* @category math
|
|
@@ -1741,25 +1741,25 @@ export const remainder: {
|
|
|
1741
1741
|
* **Example** (Computing remainders unsafely)
|
|
1742
1742
|
*
|
|
1743
1743
|
* ```ts
|
|
1744
|
-
* import {
|
|
1744
|
+
* import { BigDecimal } from "effect"
|
|
1745
1745
|
* import * as assert from "node:assert"
|
|
1746
1746
|
*
|
|
1747
1747
|
* assert.deepStrictEqual(
|
|
1748
|
-
* remainderUnsafe(fromStringUnsafe("2"), fromStringUnsafe("2")),
|
|
1749
|
-
* fromStringUnsafe("0")
|
|
1748
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("2")),
|
|
1749
|
+
* BigDecimal.fromStringUnsafe("0")
|
|
1750
1750
|
* )
|
|
1751
1751
|
* assert.deepStrictEqual(
|
|
1752
|
-
* remainderUnsafe(fromStringUnsafe("3"), fromStringUnsafe("2")),
|
|
1753
|
-
* fromStringUnsafe("1")
|
|
1752
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("2")),
|
|
1753
|
+
* BigDecimal.fromStringUnsafe("1")
|
|
1754
1754
|
* )
|
|
1755
1755
|
* assert.deepStrictEqual(
|
|
1756
|
-
* remainderUnsafe(fromStringUnsafe("-4"), fromStringUnsafe("2")),
|
|
1757
|
-
* fromStringUnsafe("0")
|
|
1756
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("-4"), BigDecimal.fromStringUnsafe("2")),
|
|
1757
|
+
* BigDecimal.fromStringUnsafe("0")
|
|
1758
1758
|
* )
|
|
1759
1759
|
* ```
|
|
1760
1760
|
*
|
|
1761
1761
|
* @category math
|
|
1762
|
-
* @since
|
|
1762
|
+
* @since 4.0.0
|
|
1763
1763
|
*/
|
|
1764
1764
|
export const remainderUnsafe: {
|
|
1765
1765
|
/**
|
|
@@ -1770,25 +1770,25 @@ export const remainderUnsafe: {
|
|
|
1770
1770
|
* **Example** (Computing remainders unsafely)
|
|
1771
1771
|
*
|
|
1772
1772
|
* ```ts
|
|
1773
|
-
* import {
|
|
1773
|
+
* import { BigDecimal } from "effect"
|
|
1774
1774
|
* import * as assert from "node:assert"
|
|
1775
1775
|
*
|
|
1776
1776
|
* assert.deepStrictEqual(
|
|
1777
|
-
* remainderUnsafe(fromStringUnsafe("2"), fromStringUnsafe("2")),
|
|
1778
|
-
* fromStringUnsafe("0")
|
|
1777
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("2")),
|
|
1778
|
+
* BigDecimal.fromStringUnsafe("0")
|
|
1779
1779
|
* )
|
|
1780
1780
|
* assert.deepStrictEqual(
|
|
1781
|
-
* remainderUnsafe(fromStringUnsafe("3"), fromStringUnsafe("2")),
|
|
1782
|
-
* fromStringUnsafe("1")
|
|
1781
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("2")),
|
|
1782
|
+
* BigDecimal.fromStringUnsafe("1")
|
|
1783
1783
|
* )
|
|
1784
1784
|
* assert.deepStrictEqual(
|
|
1785
|
-
* remainderUnsafe(fromStringUnsafe("-4"), fromStringUnsafe("2")),
|
|
1786
|
-
* fromStringUnsafe("0")
|
|
1785
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("-4"), BigDecimal.fromStringUnsafe("2")),
|
|
1786
|
+
* BigDecimal.fromStringUnsafe("0")
|
|
1787
1787
|
* )
|
|
1788
1788
|
* ```
|
|
1789
1789
|
*
|
|
1790
1790
|
* @category math
|
|
1791
|
-
* @since
|
|
1791
|
+
* @since 4.0.0
|
|
1792
1792
|
*/
|
|
1793
1793
|
(divisor: BigDecimal): (self: BigDecimal) => BigDecimal
|
|
1794
1794
|
/**
|
|
@@ -1799,25 +1799,25 @@ export const remainderUnsafe: {
|
|
|
1799
1799
|
* **Example** (Computing remainders unsafely)
|
|
1800
1800
|
*
|
|
1801
1801
|
* ```ts
|
|
1802
|
-
* import {
|
|
1802
|
+
* import { BigDecimal } from "effect"
|
|
1803
1803
|
* import * as assert from "node:assert"
|
|
1804
1804
|
*
|
|
1805
1805
|
* assert.deepStrictEqual(
|
|
1806
|
-
* remainderUnsafe(fromStringUnsafe("2"), fromStringUnsafe("2")),
|
|
1807
|
-
* fromStringUnsafe("0")
|
|
1806
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("2")),
|
|
1807
|
+
* BigDecimal.fromStringUnsafe("0")
|
|
1808
1808
|
* )
|
|
1809
1809
|
* assert.deepStrictEqual(
|
|
1810
|
-
* remainderUnsafe(fromStringUnsafe("3"), fromStringUnsafe("2")),
|
|
1811
|
-
* fromStringUnsafe("1")
|
|
1810
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("3"), BigDecimal.fromStringUnsafe("2")),
|
|
1811
|
+
* BigDecimal.fromStringUnsafe("1")
|
|
1812
1812
|
* )
|
|
1813
1813
|
* assert.deepStrictEqual(
|
|
1814
|
-
* remainderUnsafe(fromStringUnsafe("-4"), fromStringUnsafe("2")),
|
|
1815
|
-
* fromStringUnsafe("0")
|
|
1814
|
+
* BigDecimal.remainderUnsafe(BigDecimal.fromStringUnsafe("-4"), BigDecimal.fromStringUnsafe("2")),
|
|
1815
|
+
* BigDecimal.fromStringUnsafe("0")
|
|
1816
1816
|
* )
|
|
1817
1817
|
* ```
|
|
1818
1818
|
*
|
|
1819
1819
|
* @category math
|
|
1820
|
-
* @since
|
|
1820
|
+
* @since 4.0.0
|
|
1821
1821
|
*/
|
|
1822
1822
|
(self: BigDecimal, divisor: BigDecimal): BigDecimal
|
|
1823
1823
|
} = dual(2, (self: BigDecimal, divisor: BigDecimal): BigDecimal => {
|
|
@@ -1953,11 +1953,11 @@ export const fromBigInt = (n: bigint): BigDecimal => make(n, 0)
|
|
|
1953
1953
|
* **Example** (Creating decimals from finite numbers)
|
|
1954
1954
|
*
|
|
1955
1955
|
* ```ts
|
|
1956
|
-
* import {
|
|
1956
|
+
* import { BigDecimal } from "effect"
|
|
1957
1957
|
* import * as assert from "node:assert"
|
|
1958
1958
|
*
|
|
1959
|
-
* assert.deepStrictEqual(fromNumberUnsafe(123), make(123n, 0))
|
|
1960
|
-
* assert.deepStrictEqual(fromNumberUnsafe(123.456), make(123456n, 3))
|
|
1959
|
+
* assert.deepStrictEqual(BigDecimal.fromNumberUnsafe(123), BigDecimal.make(123n, 0))
|
|
1960
|
+
* assert.deepStrictEqual(BigDecimal.fromNumberUnsafe(123.456), BigDecimal.make(123456n, 3))
|
|
1961
1961
|
* ```
|
|
1962
1962
|
*
|
|
1963
1963
|
* @category constructors
|
|
@@ -1990,7 +1990,7 @@ export const fromNumberUnsafe = (n: number): BigDecimal => {
|
|
|
1990
1990
|
* ```
|
|
1991
1991
|
*
|
|
1992
1992
|
* @category constructors
|
|
1993
|
-
* @since
|
|
1993
|
+
* @since 2.0.0
|
|
1994
1994
|
*/
|
|
1995
1995
|
export const fromNumber = (n: number): Option.Option<BigDecimal> => {
|
|
1996
1996
|
if (!Number.isFinite(n)) {
|
|
@@ -2085,16 +2085,16 @@ export const fromString = (s: string): Option.Option<BigDecimal> => {
|
|
|
2085
2085
|
* **Example** (Parsing decimal strings unsafely)
|
|
2086
2086
|
*
|
|
2087
2087
|
* ```ts
|
|
2088
|
-
* import {
|
|
2088
|
+
* import { BigDecimal } from "effect"
|
|
2089
2089
|
* import * as assert from "node:assert"
|
|
2090
2090
|
*
|
|
2091
|
-
* assert.deepStrictEqual(fromStringUnsafe("123"), make(123n, 0))
|
|
2092
|
-
* assert.deepStrictEqual(fromStringUnsafe("123.456"), make(123456n, 3))
|
|
2093
|
-
* assert.throws(() => fromStringUnsafe("123.abc"))
|
|
2091
|
+
* assert.deepStrictEqual(BigDecimal.fromStringUnsafe("123"), BigDecimal.make(123n, 0))
|
|
2092
|
+
* assert.deepStrictEqual(BigDecimal.fromStringUnsafe("123.456"), BigDecimal.make(123456n, 3))
|
|
2093
|
+
* assert.throws(() => BigDecimal.fromStringUnsafe("123.abc"))
|
|
2094
2094
|
* ```
|
|
2095
2095
|
*
|
|
2096
2096
|
* @category constructors
|
|
2097
|
-
* @since
|
|
2097
|
+
* @since 4.0.0
|
|
2098
2098
|
*/
|
|
2099
2099
|
export const fromStringUnsafe = (s: string): BigDecimal => {
|
|
2100
2100
|
return Option.getOrThrowWith(fromString(s), () => new Error(`Invalid numerical string: ${s}`))
|
|
@@ -2110,15 +2110,15 @@ export const fromStringUnsafe = (s: string): BigDecimal => {
|
|
|
2110
2110
|
* **Example** (Formatting decimals)
|
|
2111
2111
|
*
|
|
2112
2112
|
* ```ts
|
|
2113
|
-
* import {
|
|
2113
|
+
* import { BigDecimal } from "effect"
|
|
2114
2114
|
* import * as assert from "node:assert"
|
|
2115
2115
|
*
|
|
2116
|
-
* assert.deepStrictEqual(format(fromStringUnsafe("-5")), "-5")
|
|
2117
|
-
* assert.deepStrictEqual(format(fromStringUnsafe("123.456")), "123.456")
|
|
2118
|
-
* assert.deepStrictEqual(format(fromStringUnsafe("-0.00000123")), "-0.00000123")
|
|
2116
|
+
* assert.deepStrictEqual(BigDecimal.format(BigDecimal.fromStringUnsafe("-5")), "-5")
|
|
2117
|
+
* assert.deepStrictEqual(BigDecimal.format(BigDecimal.fromStringUnsafe("123.456")), "123.456")
|
|
2118
|
+
* assert.deepStrictEqual(BigDecimal.format(BigDecimal.fromStringUnsafe("-0.00000123")), "-0.00000123")
|
|
2119
2119
|
* ```
|
|
2120
2120
|
*
|
|
2121
|
-
* @category
|
|
2121
|
+
* @category converting
|
|
2122
2122
|
* @since 2.0.0
|
|
2123
2123
|
*/
|
|
2124
2124
|
export const format = (n: BigDecimal): string => {
|
|
@@ -2158,14 +2158,14 @@ export const format = (n: BigDecimal): string => {
|
|
|
2158
2158
|
* **Example** (Formatting decimals exponentially)
|
|
2159
2159
|
*
|
|
2160
2160
|
* ```ts
|
|
2161
|
-
* import {
|
|
2161
|
+
* import { BigDecimal } from "effect"
|
|
2162
2162
|
* import * as assert from "node:assert"
|
|
2163
2163
|
*
|
|
2164
|
-
* assert.deepStrictEqual(toExponential(make(123456n, -5)), "1.23456e+10")
|
|
2164
|
+
* assert.deepStrictEqual(BigDecimal.toExponential(BigDecimal.make(123456n, -5)), "1.23456e+10")
|
|
2165
2165
|
* ```
|
|
2166
2166
|
*
|
|
2167
|
-
* @category
|
|
2168
|
-
* @since
|
|
2167
|
+
* @category converting
|
|
2168
|
+
* @since 3.11.0
|
|
2169
2169
|
*/
|
|
2170
2170
|
export const toExponential = (n: BigDecimal): string => {
|
|
2171
2171
|
if (isZero(n)) {
|
|
@@ -2196,14 +2196,14 @@ export const toExponential = (n: BigDecimal): string => {
|
|
|
2196
2196
|
* **Example** (Converting decimals to numbers)
|
|
2197
2197
|
*
|
|
2198
2198
|
* ```ts
|
|
2199
|
-
* import {
|
|
2199
|
+
* import { BigDecimal } from "effect"
|
|
2200
2200
|
* import * as assert from "node:assert"
|
|
2201
2201
|
*
|
|
2202
|
-
* assert.deepStrictEqual(toNumberUnsafe(fromStringUnsafe("123.456")), 123.456)
|
|
2202
|
+
* assert.deepStrictEqual(BigDecimal.toNumberUnsafe(BigDecimal.fromStringUnsafe("123.456")), 123.456)
|
|
2203
2203
|
* ```
|
|
2204
2204
|
*
|
|
2205
|
-
* @category
|
|
2206
|
-
* @since
|
|
2205
|
+
* @category converting
|
|
2206
|
+
* @since 4.0.0
|
|
2207
2207
|
*/
|
|
2208
2208
|
export const toNumberUnsafe = (n: BigDecimal): number => Number(format(n))
|
|
2209
2209
|
|
|
@@ -2213,12 +2213,12 @@ export const toNumberUnsafe = (n: BigDecimal): number => Number(format(n))
|
|
|
2213
2213
|
* **Example** (Checking integer decimals)
|
|
2214
2214
|
*
|
|
2215
2215
|
* ```ts
|
|
2216
|
-
* import {
|
|
2216
|
+
* import { BigDecimal } from "effect"
|
|
2217
2217
|
* import * as assert from "node:assert"
|
|
2218
2218
|
*
|
|
2219
|
-
* assert.deepStrictEqual(isInteger(fromStringUnsafe("0")), true)
|
|
2220
|
-
* assert.deepStrictEqual(isInteger(fromStringUnsafe("1")), true)
|
|
2221
|
-
* assert.deepStrictEqual(isInteger(fromStringUnsafe("1.1")), false)
|
|
2219
|
+
* assert.deepStrictEqual(BigDecimal.isInteger(BigDecimal.fromStringUnsafe("0")), true)
|
|
2220
|
+
* assert.deepStrictEqual(BigDecimal.isInteger(BigDecimal.fromStringUnsafe("1")), true)
|
|
2221
|
+
* assert.deepStrictEqual(BigDecimal.isInteger(BigDecimal.fromStringUnsafe("1.1")), false)
|
|
2222
2222
|
* ```
|
|
2223
2223
|
*
|
|
2224
2224
|
* @category predicates
|
|
@@ -2232,11 +2232,11 @@ export const isInteger = (n: BigDecimal): boolean => normalize(n).scale <= 0
|
|
|
2232
2232
|
* **Example** (Checking zero decimals)
|
|
2233
2233
|
*
|
|
2234
2234
|
* ```ts
|
|
2235
|
-
* import {
|
|
2235
|
+
* import { BigDecimal } from "effect"
|
|
2236
2236
|
* import * as assert from "node:assert"
|
|
2237
2237
|
*
|
|
2238
|
-
* assert.deepStrictEqual(isZero(fromStringUnsafe("0")), true)
|
|
2239
|
-
* assert.deepStrictEqual(isZero(fromStringUnsafe("1")), false)
|
|
2238
|
+
* assert.deepStrictEqual(BigDecimal.isZero(BigDecimal.fromStringUnsafe("0")), true)
|
|
2239
|
+
* assert.deepStrictEqual(BigDecimal.isZero(BigDecimal.fromStringUnsafe("1")), false)
|
|
2240
2240
|
* ```
|
|
2241
2241
|
*
|
|
2242
2242
|
* @category predicates
|
|
@@ -2250,12 +2250,12 @@ export const isZero = (n: BigDecimal): boolean => n.value === bigint0
|
|
|
2250
2250
|
* **Example** (Checking negative decimals)
|
|
2251
2251
|
*
|
|
2252
2252
|
* ```ts
|
|
2253
|
-
* import {
|
|
2253
|
+
* import { BigDecimal } from "effect"
|
|
2254
2254
|
* import * as assert from "node:assert"
|
|
2255
2255
|
*
|
|
2256
|
-
* assert.deepStrictEqual(isNegative(fromStringUnsafe("-1")), true)
|
|
2257
|
-
* assert.deepStrictEqual(isNegative(fromStringUnsafe("0")), false)
|
|
2258
|
-
* assert.deepStrictEqual(isNegative(fromStringUnsafe("1")), false)
|
|
2256
|
+
* assert.deepStrictEqual(BigDecimal.isNegative(BigDecimal.fromStringUnsafe("-1")), true)
|
|
2257
|
+
* assert.deepStrictEqual(BigDecimal.isNegative(BigDecimal.fromStringUnsafe("0")), false)
|
|
2258
|
+
* assert.deepStrictEqual(BigDecimal.isNegative(BigDecimal.fromStringUnsafe("1")), false)
|
|
2259
2259
|
* ```
|
|
2260
2260
|
*
|
|
2261
2261
|
* @category predicates
|
|
@@ -2269,12 +2269,12 @@ export const isNegative = (n: BigDecimal): boolean => n.value < bigint0
|
|
|
2269
2269
|
* **Example** (Checking positive decimals)
|
|
2270
2270
|
*
|
|
2271
2271
|
* ```ts
|
|
2272
|
-
* import {
|
|
2272
|
+
* import { BigDecimal } from "effect"
|
|
2273
2273
|
* import * as assert from "node:assert"
|
|
2274
2274
|
*
|
|
2275
|
-
* assert.deepStrictEqual(isPositive(fromStringUnsafe("-1")), false)
|
|
2276
|
-
* assert.deepStrictEqual(isPositive(fromStringUnsafe("0")), false)
|
|
2277
|
-
* assert.deepStrictEqual(isPositive(fromStringUnsafe("1")), true)
|
|
2275
|
+
* assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("-1")), false)
|
|
2276
|
+
* assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("0")), false)
|
|
2277
|
+
* assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("1")), true)
|
|
2278
2278
|
* ```
|
|
2279
2279
|
*
|
|
2280
2280
|
* @category predicates
|
|
@@ -2299,7 +2299,7 @@ const isBigDecimalArgs = (args: IArguments) => isBigDecimal(args[0])
|
|
|
2299
2299
|
* `half-odd`: round to the nearest neighbor; if equidistant round to the neighbor with an odd digit
|
|
2300
2300
|
*
|
|
2301
2301
|
* @category math
|
|
2302
|
-
* @since
|
|
2302
|
+
* @since 3.16.0
|
|
2303
2303
|
*/
|
|
2304
2304
|
export type RoundingMode =
|
|
2305
2305
|
| "ceil"
|
|
@@ -2319,21 +2319,21 @@ export type RoundingMode =
|
|
|
2319
2319
|
* **Example** (Rounding decimals)
|
|
2320
2320
|
*
|
|
2321
2321
|
* ```ts
|
|
2322
|
-
* import {
|
|
2322
|
+
* import { BigDecimal } from "effect"
|
|
2323
2323
|
* import * as assert from "node:assert"
|
|
2324
2324
|
*
|
|
2325
2325
|
* assert.deepStrictEqual(
|
|
2326
|
-
* round(fromStringUnsafe("145"), { mode: "from-zero", scale: -1 }),
|
|
2327
|
-
* fromStringUnsafe("150")
|
|
2326
|
+
* BigDecimal.round(BigDecimal.fromStringUnsafe("145"), { mode: "from-zero", scale: -1 }),
|
|
2327
|
+
* BigDecimal.fromStringUnsafe("150")
|
|
2328
2328
|
* )
|
|
2329
2329
|
* assert.deepStrictEqual(
|
|
2330
|
-
* round(fromStringUnsafe("-14.5")),
|
|
2331
|
-
* fromStringUnsafe("-15")
|
|
2330
|
+
* BigDecimal.round(BigDecimal.fromStringUnsafe("-14.5")),
|
|
2331
|
+
* BigDecimal.fromStringUnsafe("-15")
|
|
2332
2332
|
* )
|
|
2333
2333
|
* ```
|
|
2334
2334
|
*
|
|
2335
2335
|
* @category math
|
|
2336
|
-
* @since
|
|
2336
|
+
* @since 3.16.0
|
|
2337
2337
|
*/
|
|
2338
2338
|
export const round: {
|
|
2339
2339
|
/**
|
|
@@ -2342,21 +2342,21 @@ export const round: {
|
|
|
2342
2342
|
* **Example** (Rounding decimals)
|
|
2343
2343
|
*
|
|
2344
2344
|
* ```ts
|
|
2345
|
-
* import {
|
|
2345
|
+
* import { BigDecimal } from "effect"
|
|
2346
2346
|
* import * as assert from "node:assert"
|
|
2347
2347
|
*
|
|
2348
2348
|
* assert.deepStrictEqual(
|
|
2349
|
-
* round(fromStringUnsafe("145"), { mode: "from-zero", scale: -1 }),
|
|
2350
|
-
* fromStringUnsafe("150")
|
|
2349
|
+
* BigDecimal.round(BigDecimal.fromStringUnsafe("145"), { mode: "from-zero", scale: -1 }),
|
|
2350
|
+
* BigDecimal.fromStringUnsafe("150")
|
|
2351
2351
|
* )
|
|
2352
2352
|
* assert.deepStrictEqual(
|
|
2353
|
-
* round(fromStringUnsafe("-14.5")),
|
|
2354
|
-
* fromStringUnsafe("-15")
|
|
2353
|
+
* BigDecimal.round(BigDecimal.fromStringUnsafe("-14.5")),
|
|
2354
|
+
* BigDecimal.fromStringUnsafe("-15")
|
|
2355
2355
|
* )
|
|
2356
2356
|
* ```
|
|
2357
2357
|
*
|
|
2358
2358
|
* @category math
|
|
2359
|
-
* @since
|
|
2359
|
+
* @since 3.16.0
|
|
2360
2360
|
*/
|
|
2361
2361
|
(options: { scale?: number; mode?: RoundingMode }): (self: BigDecimal) => BigDecimal
|
|
2362
2362
|
/**
|
|
@@ -2365,21 +2365,21 @@ export const round: {
|
|
|
2365
2365
|
* **Example** (Rounding decimals)
|
|
2366
2366
|
*
|
|
2367
2367
|
* ```ts
|
|
2368
|
-
* import {
|
|
2368
|
+
* import { BigDecimal } from "effect"
|
|
2369
2369
|
* import * as assert from "node:assert"
|
|
2370
2370
|
*
|
|
2371
2371
|
* assert.deepStrictEqual(
|
|
2372
|
-
* round(fromStringUnsafe("145"), { mode: "from-zero", scale: -1 }),
|
|
2373
|
-
* fromStringUnsafe("150")
|
|
2372
|
+
* BigDecimal.round(BigDecimal.fromStringUnsafe("145"), { mode: "from-zero", scale: -1 }),
|
|
2373
|
+
* BigDecimal.fromStringUnsafe("150")
|
|
2374
2374
|
* )
|
|
2375
2375
|
* assert.deepStrictEqual(
|
|
2376
|
-
* round(fromStringUnsafe("-14.5")),
|
|
2377
|
-
* fromStringUnsafe("-15")
|
|
2376
|
+
* BigDecimal.round(BigDecimal.fromStringUnsafe("-14.5")),
|
|
2377
|
+
* BigDecimal.fromStringUnsafe("-15")
|
|
2378
2378
|
* )
|
|
2379
2379
|
* ```
|
|
2380
2380
|
*
|
|
2381
2381
|
* @category math
|
|
2382
|
-
* @since
|
|
2382
|
+
* @since 3.16.0
|
|
2383
2383
|
*/
|
|
2384
2384
|
(n: BigDecimal, options?: { scale?: number; mode?: RoundingMode }): BigDecimal
|
|
2385
2385
|
} = dual(isBigDecimalArgs, (self: BigDecimal, options?: { scale?: number; mode?: RoundingMode }): BigDecimal => {
|
|
@@ -2436,14 +2436,14 @@ export const round: {
|
|
|
2436
2436
|
* **Example** (Truncating decimals)
|
|
2437
2437
|
*
|
|
2438
2438
|
* ```ts
|
|
2439
|
-
* import {
|
|
2439
|
+
* import { BigDecimal } from "effect"
|
|
2440
2440
|
*
|
|
2441
|
-
* console.log(truncate(fromStringUnsafe("145"), -1)) // BigDecimal(140)
|
|
2442
|
-
* console.log(truncate(fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2441
|
+
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("145"), -1)) // BigDecimal(140)
|
|
2442
|
+
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2443
2443
|
* ```
|
|
2444
2444
|
*
|
|
2445
2445
|
* @category math
|
|
2446
|
-
* @since
|
|
2446
|
+
* @since 3.16.0
|
|
2447
2447
|
*/
|
|
2448
2448
|
export const truncate: {
|
|
2449
2449
|
/**
|
|
@@ -2453,14 +2453,14 @@ export const truncate: {
|
|
|
2453
2453
|
* **Example** (Truncating decimals)
|
|
2454
2454
|
*
|
|
2455
2455
|
* ```ts
|
|
2456
|
-
* import {
|
|
2456
|
+
* import { BigDecimal } from "effect"
|
|
2457
2457
|
*
|
|
2458
|
-
* console.log(truncate(fromStringUnsafe("145"), -1)) // BigDecimal(140)
|
|
2459
|
-
* console.log(truncate(fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2458
|
+
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("145"), -1)) // BigDecimal(140)
|
|
2459
|
+
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2460
2460
|
* ```
|
|
2461
2461
|
*
|
|
2462
2462
|
* @category math
|
|
2463
|
-
* @since
|
|
2463
|
+
* @since 3.16.0
|
|
2464
2464
|
*/
|
|
2465
2465
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
2466
2466
|
/**
|
|
@@ -2470,14 +2470,14 @@ export const truncate: {
|
|
|
2470
2470
|
* **Example** (Truncating decimals)
|
|
2471
2471
|
*
|
|
2472
2472
|
* ```ts
|
|
2473
|
-
* import {
|
|
2473
|
+
* import { BigDecimal } from "effect"
|
|
2474
2474
|
*
|
|
2475
|
-
* console.log(truncate(fromStringUnsafe("145"), -1)) // BigDecimal(140)
|
|
2476
|
-
* console.log(truncate(fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2475
|
+
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("145"), -1)) // BigDecimal(140)
|
|
2476
|
+
* console.log(BigDecimal.truncate(BigDecimal.fromStringUnsafe("-14.5"))) // BigDecimal(-14)
|
|
2477
2477
|
* ```
|
|
2478
2478
|
*
|
|
2479
2479
|
* @category math
|
|
2480
|
-
* @since
|
|
2480
|
+
* @since 3.16.0
|
|
2481
2481
|
*/
|
|
2482
2482
|
(self: BigDecimal, scale?: number): BigDecimal
|
|
2483
2483
|
} = dual(isBigDecimalArgs, (self: BigDecimal, scale: number = 0): BigDecimal => {
|
|
@@ -2495,18 +2495,18 @@ export const truncate: {
|
|
|
2495
2495
|
* **Example** (Rounding decimals up)
|
|
2496
2496
|
*
|
|
2497
2497
|
* ```ts
|
|
2498
|
-
* import {
|
|
2498
|
+
* import { BigDecimal } from "effect"
|
|
2499
2499
|
* import * as assert from "node:assert"
|
|
2500
2500
|
*
|
|
2501
2501
|
* assert.deepStrictEqual(
|
|
2502
|
-
* ceil(fromStringUnsafe("145"), -1),
|
|
2503
|
-
* fromStringUnsafe("150")
|
|
2502
|
+
* BigDecimal.ceil(BigDecimal.fromStringUnsafe("145"), -1),
|
|
2503
|
+
* BigDecimal.fromStringUnsafe("150")
|
|
2504
2504
|
* )
|
|
2505
|
-
* assert.deepStrictEqual(ceil(fromStringUnsafe("-14.5")), fromStringUnsafe("-14"))
|
|
2505
|
+
* assert.deepStrictEqual(BigDecimal.ceil(BigDecimal.fromStringUnsafe("-14.5")), BigDecimal.fromStringUnsafe("-14"))
|
|
2506
2506
|
* ```
|
|
2507
2507
|
*
|
|
2508
2508
|
* @category math
|
|
2509
|
-
* @since
|
|
2509
|
+
* @since 3.16.0
|
|
2510
2510
|
*/
|
|
2511
2511
|
export const ceil: {
|
|
2512
2512
|
/**
|
|
@@ -2515,18 +2515,18 @@ export const ceil: {
|
|
|
2515
2515
|
* **Example** (Rounding decimals up)
|
|
2516
2516
|
*
|
|
2517
2517
|
* ```ts
|
|
2518
|
-
* import {
|
|
2518
|
+
* import { BigDecimal } from "effect"
|
|
2519
2519
|
* import * as assert from "node:assert"
|
|
2520
2520
|
*
|
|
2521
2521
|
* assert.deepStrictEqual(
|
|
2522
|
-
* ceil(fromStringUnsafe("145"), -1),
|
|
2523
|
-
* fromStringUnsafe("150")
|
|
2522
|
+
* BigDecimal.ceil(BigDecimal.fromStringUnsafe("145"), -1),
|
|
2523
|
+
* BigDecimal.fromStringUnsafe("150")
|
|
2524
2524
|
* )
|
|
2525
|
-
* assert.deepStrictEqual(ceil(fromStringUnsafe("-14.5")), fromStringUnsafe("-14"))
|
|
2525
|
+
* assert.deepStrictEqual(BigDecimal.ceil(BigDecimal.fromStringUnsafe("-14.5")), BigDecimal.fromStringUnsafe("-14"))
|
|
2526
2526
|
* ```
|
|
2527
2527
|
*
|
|
2528
2528
|
* @category math
|
|
2529
|
-
* @since
|
|
2529
|
+
* @since 3.16.0
|
|
2530
2530
|
*/
|
|
2531
2531
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
2532
2532
|
/**
|
|
@@ -2535,18 +2535,18 @@ export const ceil: {
|
|
|
2535
2535
|
* **Example** (Rounding decimals up)
|
|
2536
2536
|
*
|
|
2537
2537
|
* ```ts
|
|
2538
|
-
* import {
|
|
2538
|
+
* import { BigDecimal } from "effect"
|
|
2539
2539
|
* import * as assert from "node:assert"
|
|
2540
2540
|
*
|
|
2541
2541
|
* assert.deepStrictEqual(
|
|
2542
|
-
* ceil(fromStringUnsafe("145"), -1),
|
|
2543
|
-
* fromStringUnsafe("150")
|
|
2542
|
+
* BigDecimal.ceil(BigDecimal.fromStringUnsafe("145"), -1),
|
|
2543
|
+
* BigDecimal.fromStringUnsafe("150")
|
|
2544
2544
|
* )
|
|
2545
|
-
* assert.deepStrictEqual(ceil(fromStringUnsafe("-14.5")), fromStringUnsafe("-14"))
|
|
2545
|
+
* assert.deepStrictEqual(BigDecimal.ceil(BigDecimal.fromStringUnsafe("-14.5")), BigDecimal.fromStringUnsafe("-14"))
|
|
2546
2546
|
* ```
|
|
2547
2547
|
*
|
|
2548
2548
|
* @category math
|
|
2549
|
-
* @since
|
|
2549
|
+
* @since 3.16.0
|
|
2550
2550
|
*/
|
|
2551
2551
|
(self: BigDecimal, scale?: number): BigDecimal
|
|
2552
2552
|
} = dual(isBigDecimalArgs, (self: BigDecimal, scale: number = 0): BigDecimal => {
|
|
@@ -2598,21 +2598,21 @@ export const digitAt: {
|
|
|
2598
2598
|
* **Example** (Rounding decimals down)
|
|
2599
2599
|
*
|
|
2600
2600
|
* ```ts
|
|
2601
|
-
* import {
|
|
2601
|
+
* import { BigDecimal } from "effect"
|
|
2602
2602
|
* import * as assert from "node:assert"
|
|
2603
2603
|
*
|
|
2604
2604
|
* assert.deepStrictEqual(
|
|
2605
|
-
* floor(fromStringUnsafe("145"), -1),
|
|
2606
|
-
* fromStringUnsafe("140")
|
|
2605
|
+
* BigDecimal.floor(BigDecimal.fromStringUnsafe("145"), -1),
|
|
2606
|
+
* BigDecimal.fromStringUnsafe("140")
|
|
2607
2607
|
* )
|
|
2608
2608
|
* assert.deepStrictEqual(
|
|
2609
|
-
* floor(fromStringUnsafe("-14.5")),
|
|
2610
|
-
* fromStringUnsafe("-15")
|
|
2609
|
+
* BigDecimal.floor(BigDecimal.fromStringUnsafe("-14.5")),
|
|
2610
|
+
* BigDecimal.fromStringUnsafe("-15")
|
|
2611
2611
|
* )
|
|
2612
2612
|
* ```
|
|
2613
2613
|
*
|
|
2614
2614
|
* @category math
|
|
2615
|
-
* @since
|
|
2615
|
+
* @since 3.16.0
|
|
2616
2616
|
*/
|
|
2617
2617
|
export const floor: {
|
|
2618
2618
|
/**
|
|
@@ -2621,21 +2621,21 @@ export const floor: {
|
|
|
2621
2621
|
* **Example** (Rounding decimals down)
|
|
2622
2622
|
*
|
|
2623
2623
|
* ```ts
|
|
2624
|
-
* import {
|
|
2624
|
+
* import { BigDecimal } from "effect"
|
|
2625
2625
|
* import * as assert from "node:assert"
|
|
2626
2626
|
*
|
|
2627
2627
|
* assert.deepStrictEqual(
|
|
2628
|
-
* floor(fromStringUnsafe("145"), -1),
|
|
2629
|
-
* fromStringUnsafe("140")
|
|
2628
|
+
* BigDecimal.floor(BigDecimal.fromStringUnsafe("145"), -1),
|
|
2629
|
+
* BigDecimal.fromStringUnsafe("140")
|
|
2630
2630
|
* )
|
|
2631
2631
|
* assert.deepStrictEqual(
|
|
2632
|
-
* floor(fromStringUnsafe("-14.5")),
|
|
2633
|
-
* fromStringUnsafe("-15")
|
|
2632
|
+
* BigDecimal.floor(BigDecimal.fromStringUnsafe("-14.5")),
|
|
2633
|
+
* BigDecimal.fromStringUnsafe("-15")
|
|
2634
2634
|
* )
|
|
2635
2635
|
* ```
|
|
2636
2636
|
*
|
|
2637
2637
|
* @category math
|
|
2638
|
-
* @since
|
|
2638
|
+
* @since 3.16.0
|
|
2639
2639
|
*/
|
|
2640
2640
|
(scale: number): (self: BigDecimal) => BigDecimal
|
|
2641
2641
|
/**
|
|
@@ -2644,21 +2644,21 @@ export const floor: {
|
|
|
2644
2644
|
* **Example** (Rounding decimals down)
|
|
2645
2645
|
*
|
|
2646
2646
|
* ```ts
|
|
2647
|
-
* import {
|
|
2647
|
+
* import { BigDecimal } from "effect"
|
|
2648
2648
|
* import * as assert from "node:assert"
|
|
2649
2649
|
*
|
|
2650
2650
|
* assert.deepStrictEqual(
|
|
2651
|
-
* floor(fromStringUnsafe("145"), -1),
|
|
2652
|
-
* fromStringUnsafe("140")
|
|
2651
|
+
* BigDecimal.floor(BigDecimal.fromStringUnsafe("145"), -1),
|
|
2652
|
+
* BigDecimal.fromStringUnsafe("140")
|
|
2653
2653
|
* )
|
|
2654
2654
|
* assert.deepStrictEqual(
|
|
2655
|
-
* floor(fromStringUnsafe("-14.5")),
|
|
2656
|
-
* fromStringUnsafe("-15")
|
|
2655
|
+
* BigDecimal.floor(BigDecimal.fromStringUnsafe("-14.5")),
|
|
2656
|
+
* BigDecimal.fromStringUnsafe("-15")
|
|
2657
2657
|
* )
|
|
2658
2658
|
* ```
|
|
2659
2659
|
*
|
|
2660
2660
|
* @category math
|
|
2661
|
-
* @since
|
|
2661
|
+
* @since 3.16.0
|
|
2662
2662
|
*/
|
|
2663
2663
|
(self: BigDecimal, scale?: number): BigDecimal
|
|
2664
2664
|
} = dual(isBigDecimalArgs, (self: BigDecimal, scale: number = 0): BigDecimal => {
|