effect 3.13.8 → 3.13.9
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/cjs/Array.js +460 -431
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/BigDecimal.js +31 -89
- package/dist/cjs/BigDecimal.js.map +1 -1
- package/dist/cjs/BigInt.js +27 -71
- package/dist/cjs/BigInt.js.map +1 -1
- package/dist/cjs/Boolean.js +12 -10
- package/dist/cjs/Boolean.js.map +1 -1
- package/dist/cjs/Brand.js +2 -0
- package/dist/cjs/Brand.js.map +1 -1
- package/dist/cjs/Channel.js +0 -2
- package/dist/cjs/Channel.js.map +1 -1
- package/dist/cjs/Chunk.js +4 -0
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Config.js +0 -5
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Context.js +14 -24
- package/dist/cjs/Context.js.map +1 -1
- package/dist/cjs/Cron.js +11 -25
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/Data.js +6 -0
- package/dist/cjs/Data.js.map +1 -1
- package/dist/cjs/DateTime.js +2 -0
- package/dist/cjs/DateTime.js.map +1 -1
- package/dist/cjs/Duration.js +2 -2
- package/dist/cjs/Effect.js +122 -53
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +21 -25
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/Encoding.js +1 -1
- package/dist/cjs/Equivalence.js +1 -1
- package/dist/cjs/Function.js +21 -24
- package/dist/cjs/Function.js.map +1 -1
- package/dist/cjs/HashMap.js +0 -3
- package/dist/cjs/HashMap.js.map +1 -1
- package/dist/cjs/Iterable.js +9 -2
- package/dist/cjs/Iterable.js.map +1 -1
- package/dist/cjs/List.js +2 -0
- package/dist/cjs/List.js.map +1 -1
- package/dist/cjs/Logger.js +0 -2
- package/dist/cjs/Logger.js.map +1 -1
- package/dist/cjs/Mailbox.js +1 -0
- package/dist/cjs/Mailbox.js.map +1 -1
- package/dist/cjs/ManagedRuntime.js +0 -2
- package/dist/cjs/ManagedRuntime.js.map +1 -1
- package/dist/cjs/Metric.js +6 -12
- package/dist/cjs/Metric.js.map +1 -1
- package/dist/cjs/Number.js +22 -61
- package/dist/cjs/Number.js.map +1 -1
- package/dist/cjs/Option.js +5 -0
- package/dist/cjs/Option.js.map +1 -1
- package/dist/cjs/Order.js +1 -0
- package/dist/cjs/Order.js.map +1 -1
- package/dist/cjs/Ordering.js +2 -7
- package/dist/cjs/Ordering.js.map +1 -1
- package/dist/cjs/Pool.js +1 -1
- package/dist/cjs/Predicate.js +36 -77
- package/dist/cjs/Predicate.js.map +1 -1
- package/dist/cjs/Random.js +1 -2
- package/dist/cjs/Random.js.map +1 -1
- package/dist/cjs/RcMap.js +5 -2
- package/dist/cjs/RcMap.js.map +1 -1
- package/dist/cjs/Record.js +28 -107
- package/dist/cjs/Record.js.map +1 -1
- package/dist/cjs/Redacted.js +3 -0
- package/dist/cjs/Redacted.js.map +1 -1
- package/dist/cjs/RegExp.js +2 -2
- package/dist/cjs/RegExp.js.map +1 -1
- package/dist/cjs/STM.js +3 -5
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schedule.js +2 -2
- package/dist/cjs/Schema.js +14 -13
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/SchemaAST.js +0 -2
- package/dist/cjs/SchemaAST.js.map +1 -1
- package/dist/cjs/Sink.js +14 -10
- package/dist/cjs/Sink.js.map +1 -1
- package/dist/cjs/Stream.js +24 -25
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/String.js +31 -2
- package/dist/cjs/String.js.map +1 -1
- package/dist/cjs/Struct.js +6 -0
- package/dist/cjs/Struct.js.map +1 -1
- package/dist/cjs/Symbol.js +1 -2
- package/dist/cjs/Symbol.js.map +1 -1
- package/dist/cjs/TestClock.js.map +1 -1
- package/dist/cjs/Trie.js +28 -0
- package/dist/cjs/Trie.js.map +1 -1
- package/dist/cjs/Tuple.js +9 -24
- package/dist/cjs/Tuple.js.map +1 -1
- package/dist/cjs/internal/matcher.js +1 -1
- package/dist/cjs/internal/matcher.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Array.d.ts +1235 -1188
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/BigDecimal.d.ts +61 -189
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/BigInt.d.ts +57 -165
- package/dist/dts/BigInt.d.ts.map +1 -1
- package/dist/dts/Boolean.d.ts +28 -18
- package/dist/dts/Boolean.d.ts.map +1 -1
- package/dist/dts/Brand.d.ts +3 -3
- package/dist/dts/Brand.d.ts.map +1 -1
- package/dist/dts/Channel.d.ts +0 -6
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +15 -0
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Config.d.ts +0 -5
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Context.d.ts +26 -54
- package/dist/dts/Context.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts +9 -23
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/Data.d.ts +8 -0
- package/dist/dts/Data.d.ts.map +1 -1
- package/dist/dts/DateTime.d.ts +6 -0
- package/dist/dts/DateTime.d.ts.map +1 -1
- package/dist/dts/Duration.d.ts +2 -2
- package/dist/dts/Effect.d.ts +153 -71
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +44 -57
- package/dist/dts/Either.d.ts.map +1 -1
- package/dist/dts/Encoding.d.ts +1 -1
- package/dist/dts/Equivalence.d.ts +1 -1
- package/dist/dts/Function.d.ts +55 -59
- package/dist/dts/Function.d.ts.map +1 -1
- package/dist/dts/HashMap.d.ts +0 -9
- package/dist/dts/HashMap.d.ts.map +1 -1
- package/dist/dts/Iterable.d.ts +13 -2
- package/dist/dts/Iterable.d.ts.map +1 -1
- package/dist/dts/List.d.ts +10 -0
- package/dist/dts/List.d.ts.map +1 -1
- package/dist/dts/Logger.d.ts +0 -6
- package/dist/dts/Logger.d.ts.map +1 -1
- package/dist/dts/Mailbox.d.ts +1 -0
- package/dist/dts/Mailbox.d.ts.map +1 -1
- package/dist/dts/ManagedRuntime.d.ts +0 -2
- package/dist/dts/ManagedRuntime.d.ts.map +1 -1
- package/dist/dts/Metric.d.ts +14 -20
- package/dist/dts/Metric.d.ts.map +1 -1
- package/dist/dts/Micro.d.ts +1 -1
- package/dist/dts/Number.d.ts +52 -155
- package/dist/dts/Number.d.ts.map +1 -1
- package/dist/dts/Option.d.ts +12 -0
- package/dist/dts/Option.d.ts.map +1 -1
- package/dist/dts/Order.d.ts +1 -0
- package/dist/dts/Order.d.ts.map +1 -1
- package/dist/dts/Ordering.d.ts +4 -17
- package/dist/dts/Ordering.d.ts.map +1 -1
- package/dist/dts/Pool.d.ts +1 -1
- package/dist/dts/Predicate.d.ts +56 -133
- package/dist/dts/Predicate.d.ts.map +1 -1
- package/dist/dts/Random.d.ts +1 -2
- package/dist/dts/Random.d.ts.map +1 -1
- package/dist/dts/RcMap.d.ts +15 -6
- package/dist/dts/RcMap.d.ts.map +1 -1
- package/dist/dts/Record.d.ts +68 -279
- package/dist/dts/Record.d.ts.map +1 -1
- package/dist/dts/Redacted.d.ts +3 -0
- package/dist/dts/Redacted.d.ts.map +1 -1
- package/dist/dts/RegExp.d.ts +2 -2
- package/dist/dts/RegExp.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +5 -7
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schedule.d.ts +7 -7
- package/dist/dts/Schema.d.ts +31 -25
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/SchemaAST.d.ts +0 -2
- package/dist/dts/SchemaAST.d.ts.map +1 -1
- package/dist/dts/Sink.d.ts +14 -10
- package/dist/dts/Sink.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +58 -62
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/String.d.ts +47 -2
- package/dist/dts/String.d.ts.map +1 -1
- package/dist/dts/Struct.d.ts +12 -0
- package/dist/dts/Struct.d.ts.map +1 -1
- package/dist/dts/Symbol.d.ts +1 -2
- package/dist/dts/Symbol.d.ts.map +1 -1
- package/dist/dts/TestClock.d.ts +2 -1
- package/dist/dts/TestClock.d.ts.map +1 -1
- package/dist/dts/Trie.d.ts +66 -0
- package/dist/dts/Trie.d.ts.map +1 -1
- package/dist/dts/Tuple.d.ts +21 -62
- package/dist/dts/Tuple.d.ts.map +1 -1
- package/dist/dts/Utils.d.ts +8 -8
- package/dist/esm/Array.js +474 -442
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/BigDecimal.js +31 -89
- package/dist/esm/BigDecimal.js.map +1 -1
- package/dist/esm/BigInt.js +27 -71
- package/dist/esm/BigInt.js.map +1 -1
- package/dist/esm/Boolean.js +12 -10
- package/dist/esm/Boolean.js.map +1 -1
- package/dist/esm/Brand.js +2 -0
- package/dist/esm/Brand.js.map +1 -1
- package/dist/esm/Channel.js +0 -2
- package/dist/esm/Channel.js.map +1 -1
- package/dist/esm/Chunk.js +4 -0
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Config.js +0 -5
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Context.js +14 -24
- package/dist/esm/Context.js.map +1 -1
- package/dist/esm/Cron.js +11 -25
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/Data.js +7 -0
- package/dist/esm/Data.js.map +1 -1
- package/dist/esm/DateTime.js +2 -0
- package/dist/esm/DateTime.js.map +1 -1
- package/dist/esm/Duration.js +2 -2
- package/dist/esm/Effect.js +123 -53
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +22 -25
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/Encoding.js +1 -1
- package/dist/esm/Equivalence.js +1 -1
- package/dist/esm/Function.js +21 -24
- package/dist/esm/Function.js.map +1 -1
- package/dist/esm/HashMap.js +0 -3
- package/dist/esm/HashMap.js.map +1 -1
- package/dist/esm/Iterable.js +9 -2
- package/dist/esm/Iterable.js.map +1 -1
- package/dist/esm/List.js +2 -0
- package/dist/esm/List.js.map +1 -1
- package/dist/esm/Logger.js +0 -2
- package/dist/esm/Logger.js.map +1 -1
- package/dist/esm/Mailbox.js +1 -0
- package/dist/esm/Mailbox.js.map +1 -1
- package/dist/esm/ManagedRuntime.js +0 -2
- package/dist/esm/ManagedRuntime.js.map +1 -1
- package/dist/esm/Metric.js +6 -12
- package/dist/esm/Metric.js.map +1 -1
- package/dist/esm/Micro.js +1 -1
- package/dist/esm/Number.js +22 -61
- package/dist/esm/Number.js.map +1 -1
- package/dist/esm/Option.js +6 -0
- package/dist/esm/Option.js.map +1 -1
- package/dist/esm/Order.js +1 -0
- package/dist/esm/Order.js.map +1 -1
- package/dist/esm/Ordering.js +2 -7
- package/dist/esm/Ordering.js.map +1 -1
- package/dist/esm/Pool.js +1 -1
- package/dist/esm/Predicate.js +36 -77
- package/dist/esm/Predicate.js.map +1 -1
- package/dist/esm/Random.js +1 -2
- package/dist/esm/Random.js.map +1 -1
- package/dist/esm/RcMap.js +5 -2
- package/dist/esm/RcMap.js.map +1 -1
- package/dist/esm/Record.js +28 -107
- package/dist/esm/Record.js.map +1 -1
- package/dist/esm/Redacted.js +3 -0
- package/dist/esm/Redacted.js.map +1 -1
- package/dist/esm/RegExp.js +2 -2
- package/dist/esm/RegExp.js.map +1 -1
- package/dist/esm/STM.js +3 -5
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schedule.js +2 -2
- package/dist/esm/Schema.js +14 -13
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/SchemaAST.js +0 -2
- package/dist/esm/SchemaAST.js.map +1 -1
- package/dist/esm/Sink.js +14 -10
- package/dist/esm/Sink.js.map +1 -1
- package/dist/esm/Stream.js +25 -25
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/String.js +31 -2
- package/dist/esm/String.js.map +1 -1
- package/dist/esm/Struct.js +6 -0
- package/dist/esm/Struct.js.map +1 -1
- package/dist/esm/Symbol.js +1 -2
- package/dist/esm/Symbol.js.map +1 -1
- package/dist/esm/TestClock.js.map +1 -1
- package/dist/esm/Trie.js +28 -0
- package/dist/esm/Trie.js.map +1 -1
- package/dist/esm/Tuple.js +11 -30
- package/dist/esm/Tuple.js.map +1 -1
- package/dist/esm/internal/matcher.js +1 -1
- package/dist/esm/internal/matcher.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1235 -1188
- package/src/BigDecimal.ts +61 -189
- package/src/BigInt.ts +57 -165
- package/src/Boolean.ts +28 -18
- package/src/Brand.ts +3 -3
- package/src/Channel.ts +0 -6
- package/src/Chunk.ts +16 -0
- package/src/Config.ts +0 -5
- package/src/Context.ts +26 -54
- package/src/Cron.ts +11 -25
- package/src/Data.ts +8 -0
- package/src/DateTime.ts +6 -0
- package/src/Duration.ts +2 -2
- package/src/Effect.ts +153 -71
- package/src/Either.ts +45 -58
- package/src/Encoding.ts +1 -1
- package/src/Equivalence.ts +1 -1
- package/src/Function.ts +55 -59
- package/src/HashMap.ts +0 -9
- package/src/Iterable.ts +13 -2
- package/src/List.ts +12 -0
- package/src/Logger.ts +0 -6
- package/src/Mailbox.ts +1 -0
- package/src/ManagedRuntime.ts +0 -2
- package/src/Metric.ts +14 -20
- package/src/Micro.ts +1 -1
- package/src/Number.ts +52 -155
- package/src/Option.ts +12 -0
- package/src/Order.ts +1 -0
- package/src/Ordering.ts +4 -17
- package/src/Pool.ts +1 -1
- package/src/Predicate.ts +56 -133
- package/src/Random.ts +1 -2
- package/src/RcMap.ts +15 -6
- package/src/Record.ts +68 -279
- package/src/Redacted.ts +3 -0
- package/src/RegExp.ts +2 -2
- package/src/STM.ts +5 -7
- package/src/Schedule.ts +7 -7
- package/src/Schema.ts +31 -25
- package/src/SchemaAST.ts +0 -2
- package/src/Sink.ts +14 -10
- package/src/Stream.ts +56 -61
- package/src/String.ts +47 -2
- package/src/Struct.ts +12 -0
- package/src/Symbol.ts +1 -2
- package/src/TestClock.ts +2 -1
- package/src/Trie.ts +66 -0
- package/src/Tuple.ts +21 -62
- package/src/Utils.ts +8 -8
- package/src/internal/matcher.ts +1 -1
- package/src/internal/version.ts +1 -1
package/src/Number.ts
CHANGED
|
@@ -16,10 +16,9 @@ import * as predicate from "./Predicate.js"
|
|
|
16
16
|
/**
|
|
17
17
|
* Tests if a value is a `number`.
|
|
18
18
|
*
|
|
19
|
-
* @param input - The value to test.
|
|
20
|
-
*
|
|
21
19
|
* @example
|
|
22
20
|
* ```ts
|
|
21
|
+
* import * as assert from "node:assert"
|
|
23
22
|
* import { isNumber } from "effect/Number"
|
|
24
23
|
*
|
|
25
24
|
* assert.deepStrictEqual(isNumber(2), true)
|
|
@@ -34,11 +33,9 @@ export const isNumber: (input: unknown) => input is number = predicate.isNumber
|
|
|
34
33
|
/**
|
|
35
34
|
* Provides an addition operation on `number`s.
|
|
36
35
|
*
|
|
37
|
-
* @param self - The first operand.
|
|
38
|
-
* @param that - The second operand.
|
|
39
|
-
*
|
|
40
36
|
* @example
|
|
41
37
|
* ```ts
|
|
38
|
+
* import * as assert from "node:assert"
|
|
42
39
|
* import { sum } from "effect/Number"
|
|
43
40
|
*
|
|
44
41
|
* assert.deepStrictEqual(sum(2, 3), 5)
|
|
@@ -51,11 +48,9 @@ export const sum: {
|
|
|
51
48
|
/**
|
|
52
49
|
* Provides an addition operation on `number`s.
|
|
53
50
|
*
|
|
54
|
-
* @param self - The first operand.
|
|
55
|
-
* @param that - The second operand.
|
|
56
|
-
*
|
|
57
51
|
* @example
|
|
58
52
|
* ```ts
|
|
53
|
+
* import * as assert from "node:assert"
|
|
59
54
|
* import { sum } from "effect/Number"
|
|
60
55
|
*
|
|
61
56
|
* assert.deepStrictEqual(sum(2, 3), 5)
|
|
@@ -68,11 +63,9 @@ export const sum: {
|
|
|
68
63
|
/**
|
|
69
64
|
* Provides an addition operation on `number`s.
|
|
70
65
|
*
|
|
71
|
-
* @param self - The first operand.
|
|
72
|
-
* @param that - The second operand.
|
|
73
|
-
*
|
|
74
66
|
* @example
|
|
75
67
|
* ```ts
|
|
68
|
+
* import * as assert from "node:assert"
|
|
76
69
|
* import { sum } from "effect/Number"
|
|
77
70
|
*
|
|
78
71
|
* assert.deepStrictEqual(sum(2, 3), 5)
|
|
@@ -87,11 +80,9 @@ export const sum: {
|
|
|
87
80
|
/**
|
|
88
81
|
* Provides a multiplication operation on `number`s.
|
|
89
82
|
*
|
|
90
|
-
* @param self - The first operand.
|
|
91
|
-
* @param that - The second operand.
|
|
92
|
-
*
|
|
93
83
|
* @example
|
|
94
84
|
* ```ts
|
|
85
|
+
* import * as assert from "node:assert"
|
|
95
86
|
* import { multiply } from "effect/Number"
|
|
96
87
|
*
|
|
97
88
|
* assert.deepStrictEqual(multiply(2, 3), 6)
|
|
@@ -104,11 +95,9 @@ export const multiply: {
|
|
|
104
95
|
/**
|
|
105
96
|
* Provides a multiplication operation on `number`s.
|
|
106
97
|
*
|
|
107
|
-
* @param self - The first operand.
|
|
108
|
-
* @param that - The second operand.
|
|
109
|
-
*
|
|
110
98
|
* @example
|
|
111
99
|
* ```ts
|
|
100
|
+
* import * as assert from "node:assert"
|
|
112
101
|
* import { multiply } from "effect/Number"
|
|
113
102
|
*
|
|
114
103
|
* assert.deepStrictEqual(multiply(2, 3), 6)
|
|
@@ -121,11 +110,9 @@ export const multiply: {
|
|
|
121
110
|
/**
|
|
122
111
|
* Provides a multiplication operation on `number`s.
|
|
123
112
|
*
|
|
124
|
-
* @param self - The first operand.
|
|
125
|
-
* @param that - The second operand.
|
|
126
|
-
*
|
|
127
113
|
* @example
|
|
128
114
|
* ```ts
|
|
115
|
+
* import * as assert from "node:assert"
|
|
129
116
|
* import { multiply } from "effect/Number"
|
|
130
117
|
*
|
|
131
118
|
* assert.deepStrictEqual(multiply(2, 3), 6)
|
|
@@ -140,11 +127,9 @@ export const multiply: {
|
|
|
140
127
|
/**
|
|
141
128
|
* Provides a subtraction operation on `number`s.
|
|
142
129
|
*
|
|
143
|
-
* @param self - The first operand.
|
|
144
|
-
* @param that - The second operand.
|
|
145
|
-
*
|
|
146
130
|
* @example
|
|
147
131
|
* ```ts
|
|
132
|
+
* import * as assert from "node:assert"
|
|
148
133
|
* import { subtract } from "effect/Number"
|
|
149
134
|
*
|
|
150
135
|
* assert.deepStrictEqual(subtract(2, 3), -1)
|
|
@@ -157,11 +142,9 @@ export const subtract: {
|
|
|
157
142
|
/**
|
|
158
143
|
* Provides a subtraction operation on `number`s.
|
|
159
144
|
*
|
|
160
|
-
* @param self - The first operand.
|
|
161
|
-
* @param that - The second operand.
|
|
162
|
-
*
|
|
163
145
|
* @example
|
|
164
146
|
* ```ts
|
|
147
|
+
* import * as assert from "node:assert"
|
|
165
148
|
* import { subtract } from "effect/Number"
|
|
166
149
|
*
|
|
167
150
|
* assert.deepStrictEqual(subtract(2, 3), -1)
|
|
@@ -174,11 +157,9 @@ export const subtract: {
|
|
|
174
157
|
/**
|
|
175
158
|
* Provides a subtraction operation on `number`s.
|
|
176
159
|
*
|
|
177
|
-
* @param self - The first operand.
|
|
178
|
-
* @param that - The second operand.
|
|
179
|
-
*
|
|
180
160
|
* @example
|
|
181
161
|
* ```ts
|
|
162
|
+
* import * as assert from "node:assert"
|
|
182
163
|
* import { subtract } from "effect/Number"
|
|
183
164
|
*
|
|
184
165
|
* assert.deepStrictEqual(subtract(2, 3), -1)
|
|
@@ -193,11 +174,9 @@ export const subtract: {
|
|
|
193
174
|
/**
|
|
194
175
|
* Provides a division operation on `number`s.
|
|
195
176
|
*
|
|
196
|
-
* @param self - The dividend operand.
|
|
197
|
-
* @param that - The divisor operand.
|
|
198
|
-
*
|
|
199
177
|
* @example
|
|
200
178
|
* ```ts
|
|
179
|
+
* import * as assert from "node:assert"
|
|
201
180
|
* import { Number, Option } from "effect"
|
|
202
181
|
*
|
|
203
182
|
* assert.deepStrictEqual(Number.divide(6, 3), Option.some(2))
|
|
@@ -211,11 +190,9 @@ export const divide: {
|
|
|
211
190
|
/**
|
|
212
191
|
* Provides a division operation on `number`s.
|
|
213
192
|
*
|
|
214
|
-
* @param self - The dividend operand.
|
|
215
|
-
* @param that - The divisor operand.
|
|
216
|
-
*
|
|
217
193
|
* @example
|
|
218
194
|
* ```ts
|
|
195
|
+
* import * as assert from "node:assert"
|
|
219
196
|
* import { Number, Option } from "effect"
|
|
220
197
|
*
|
|
221
198
|
* assert.deepStrictEqual(Number.divide(6, 3), Option.some(2))
|
|
@@ -229,11 +206,9 @@ export const divide: {
|
|
|
229
206
|
/**
|
|
230
207
|
* Provides a division operation on `number`s.
|
|
231
208
|
*
|
|
232
|
-
* @param self - The dividend operand.
|
|
233
|
-
* @param that - The divisor operand.
|
|
234
|
-
*
|
|
235
209
|
* @example
|
|
236
210
|
* ```ts
|
|
211
|
+
* import * as assert from "node:assert"
|
|
237
212
|
* import { Number, Option } from "effect"
|
|
238
213
|
*
|
|
239
214
|
* assert.deepStrictEqual(Number.divide(6, 3), Option.some(2))
|
|
@@ -254,11 +229,9 @@ export const divide: {
|
|
|
254
229
|
*
|
|
255
230
|
* Throws a `RangeError` if the divisor is `0`.
|
|
256
231
|
*
|
|
257
|
-
* @param self - The dividend operand.
|
|
258
|
-
* @param that - The divisor operand.
|
|
259
|
-
*
|
|
260
232
|
* @example
|
|
261
233
|
* ```ts
|
|
234
|
+
* import * as assert from "node:assert"
|
|
262
235
|
* import { unsafeDivide } from "effect/Number"
|
|
263
236
|
*
|
|
264
237
|
* assert.deepStrictEqual(unsafeDivide(6, 3), 2)
|
|
@@ -273,11 +246,9 @@ export const unsafeDivide: {
|
|
|
273
246
|
*
|
|
274
247
|
* Throws a `RangeError` if the divisor is `0`.
|
|
275
248
|
*
|
|
276
|
-
* @param self - The dividend operand.
|
|
277
|
-
* @param that - The divisor operand.
|
|
278
|
-
*
|
|
279
249
|
* @example
|
|
280
250
|
* ```ts
|
|
251
|
+
* import * as assert from "node:assert"
|
|
281
252
|
* import { unsafeDivide } from "effect/Number"
|
|
282
253
|
*
|
|
283
254
|
* assert.deepStrictEqual(unsafeDivide(6, 3), 2)
|
|
@@ -292,11 +263,9 @@ export const unsafeDivide: {
|
|
|
292
263
|
*
|
|
293
264
|
* Throws a `RangeError` if the divisor is `0`.
|
|
294
265
|
*
|
|
295
|
-
* @param self - The dividend operand.
|
|
296
|
-
* @param that - The divisor operand.
|
|
297
|
-
*
|
|
298
266
|
* @example
|
|
299
267
|
* ```ts
|
|
268
|
+
* import * as assert from "node:assert"
|
|
300
269
|
* import { unsafeDivide } from "effect/Number"
|
|
301
270
|
*
|
|
302
271
|
* assert.deepStrictEqual(unsafeDivide(6, 3), 2)
|
|
@@ -311,10 +280,9 @@ export const unsafeDivide: {
|
|
|
311
280
|
/**
|
|
312
281
|
* Returns the result of adding `1` to a given number.
|
|
313
282
|
*
|
|
314
|
-
* @param n - A `number` to be incremented.
|
|
315
|
-
*
|
|
316
283
|
* @example
|
|
317
284
|
* ```ts
|
|
285
|
+
* import * as assert from "node:assert"
|
|
318
286
|
* import { increment } from "effect/Number"
|
|
319
287
|
*
|
|
320
288
|
* assert.deepStrictEqual(increment(2), 3)
|
|
@@ -328,10 +296,9 @@ export const increment = (n: number): number => n + 1
|
|
|
328
296
|
/**
|
|
329
297
|
* Decrements a number by `1`.
|
|
330
298
|
*
|
|
331
|
-
* @param n - A `number` to be decremented.
|
|
332
|
-
*
|
|
333
299
|
* @example
|
|
334
300
|
* ```ts
|
|
301
|
+
* import * as assert from "node:assert"
|
|
335
302
|
* import { decrement } from "effect/Number"
|
|
336
303
|
*
|
|
337
304
|
* assert.deepStrictEqual(decrement(3), 2)
|
|
@@ -357,11 +324,9 @@ export const Order: order.Order<number> = order.number
|
|
|
357
324
|
/**
|
|
358
325
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
359
326
|
*
|
|
360
|
-
* @param self - The first argument.
|
|
361
|
-
* @param that - The second argument.
|
|
362
|
-
*
|
|
363
327
|
* @example
|
|
364
328
|
* ```ts
|
|
329
|
+
* import * as assert from "node:assert"
|
|
365
330
|
* import { lessThan } from "effect/Number"
|
|
366
331
|
*
|
|
367
332
|
* assert.deepStrictEqual(lessThan(2, 3), true)
|
|
@@ -376,11 +341,9 @@ export const lessThan: {
|
|
|
376
341
|
/**
|
|
377
342
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
378
343
|
*
|
|
379
|
-
* @param self - The first argument.
|
|
380
|
-
* @param that - The second argument.
|
|
381
|
-
*
|
|
382
344
|
* @example
|
|
383
345
|
* ```ts
|
|
346
|
+
* import * as assert from "node:assert"
|
|
384
347
|
* import { lessThan } from "effect/Number"
|
|
385
348
|
*
|
|
386
349
|
* assert.deepStrictEqual(lessThan(2, 3), true)
|
|
@@ -395,11 +358,9 @@ export const lessThan: {
|
|
|
395
358
|
/**
|
|
396
359
|
* Returns `true` if the first argument is less than the second, otherwise `false`.
|
|
397
360
|
*
|
|
398
|
-
* @param self - The first argument.
|
|
399
|
-
* @param that - The second argument.
|
|
400
|
-
*
|
|
401
361
|
* @example
|
|
402
362
|
* ```ts
|
|
363
|
+
* import * as assert from "node:assert"
|
|
403
364
|
* import { lessThan } from "effect/Number"
|
|
404
365
|
*
|
|
405
366
|
* assert.deepStrictEqual(lessThan(2, 3), true)
|
|
@@ -416,11 +377,9 @@ export const lessThan: {
|
|
|
416
377
|
/**
|
|
417
378
|
* Returns a function that checks if a given `number` is less than or equal to the provided one.
|
|
418
379
|
*
|
|
419
|
-
* @param self - The first `number` to compare with.
|
|
420
|
-
* @param that - The second `number` to compare with.
|
|
421
|
-
*
|
|
422
380
|
* @example
|
|
423
381
|
* ```ts
|
|
382
|
+
* import * as assert from "node:assert"
|
|
424
383
|
* import { lessThanOrEqualTo } from "effect/Number"
|
|
425
384
|
*
|
|
426
385
|
* assert.deepStrictEqual(lessThanOrEqualTo(2, 3), true)
|
|
@@ -435,11 +394,9 @@ export const lessThanOrEqualTo: {
|
|
|
435
394
|
/**
|
|
436
395
|
* Returns a function that checks if a given `number` is less than or equal to the provided one.
|
|
437
396
|
*
|
|
438
|
-
* @param self - The first `number` to compare with.
|
|
439
|
-
* @param that - The second `number` to compare with.
|
|
440
|
-
*
|
|
441
397
|
* @example
|
|
442
398
|
* ```ts
|
|
399
|
+
* import * as assert from "node:assert"
|
|
443
400
|
* import { lessThanOrEqualTo } from "effect/Number"
|
|
444
401
|
*
|
|
445
402
|
* assert.deepStrictEqual(lessThanOrEqualTo(2, 3), true)
|
|
@@ -454,11 +411,9 @@ export const lessThanOrEqualTo: {
|
|
|
454
411
|
/**
|
|
455
412
|
* Returns a function that checks if a given `number` is less than or equal to the provided one.
|
|
456
413
|
*
|
|
457
|
-
* @param self - The first `number` to compare with.
|
|
458
|
-
* @param that - The second `number` to compare with.
|
|
459
|
-
*
|
|
460
414
|
* @example
|
|
461
415
|
* ```ts
|
|
416
|
+
* import * as assert from "node:assert"
|
|
462
417
|
* import { lessThanOrEqualTo } from "effect/Number"
|
|
463
418
|
*
|
|
464
419
|
* assert.deepStrictEqual(lessThanOrEqualTo(2, 3), true)
|
|
@@ -475,11 +430,9 @@ export const lessThanOrEqualTo: {
|
|
|
475
430
|
/**
|
|
476
431
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
477
432
|
*
|
|
478
|
-
* @param self - The first argument.
|
|
479
|
-
* @param that - The second argument.
|
|
480
|
-
*
|
|
481
433
|
* @example
|
|
482
434
|
* ```ts
|
|
435
|
+
* import * as assert from "node:assert"
|
|
483
436
|
* import { greaterThan } from "effect/Number"
|
|
484
437
|
*
|
|
485
438
|
* assert.deepStrictEqual(greaterThan(2, 3), false)
|
|
@@ -494,11 +447,9 @@ export const greaterThan: {
|
|
|
494
447
|
/**
|
|
495
448
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
496
449
|
*
|
|
497
|
-
* @param self - The first argument.
|
|
498
|
-
* @param that - The second argument.
|
|
499
|
-
*
|
|
500
450
|
* @example
|
|
501
451
|
* ```ts
|
|
452
|
+
* import * as assert from "node:assert"
|
|
502
453
|
* import { greaterThan } from "effect/Number"
|
|
503
454
|
*
|
|
504
455
|
* assert.deepStrictEqual(greaterThan(2, 3), false)
|
|
@@ -513,11 +464,9 @@ export const greaterThan: {
|
|
|
513
464
|
/**
|
|
514
465
|
* Returns `true` if the first argument is greater than the second, otherwise `false`.
|
|
515
466
|
*
|
|
516
|
-
* @param self - The first argument.
|
|
517
|
-
* @param that - The second argument.
|
|
518
|
-
*
|
|
519
467
|
* @example
|
|
520
468
|
* ```ts
|
|
469
|
+
* import * as assert from "node:assert"
|
|
521
470
|
* import { greaterThan } from "effect/Number"
|
|
522
471
|
*
|
|
523
472
|
* assert.deepStrictEqual(greaterThan(2, 3), false)
|
|
@@ -534,11 +483,9 @@ export const greaterThan: {
|
|
|
534
483
|
/**
|
|
535
484
|
* Returns a function that checks if a given `number` is greater than or equal to the provided one.
|
|
536
485
|
*
|
|
537
|
-
* @param self - The first `number` to compare with.
|
|
538
|
-
* @param that - The second `number` to compare with.
|
|
539
|
-
*
|
|
540
486
|
* @example
|
|
541
487
|
* ```ts
|
|
488
|
+
* import * as assert from "node:assert"
|
|
542
489
|
* import { greaterThanOrEqualTo } from "effect/Number"
|
|
543
490
|
*
|
|
544
491
|
* assert.deepStrictEqual(greaterThanOrEqualTo(2, 3), false)
|
|
@@ -553,11 +500,9 @@ export const greaterThanOrEqualTo: {
|
|
|
553
500
|
/**
|
|
554
501
|
* Returns a function that checks if a given `number` is greater than or equal to the provided one.
|
|
555
502
|
*
|
|
556
|
-
* @param self - The first `number` to compare with.
|
|
557
|
-
* @param that - The second `number` to compare with.
|
|
558
|
-
*
|
|
559
503
|
* @example
|
|
560
504
|
* ```ts
|
|
505
|
+
* import * as assert from "node:assert"
|
|
561
506
|
* import { greaterThanOrEqualTo } from "effect/Number"
|
|
562
507
|
*
|
|
563
508
|
* assert.deepStrictEqual(greaterThanOrEqualTo(2, 3), false)
|
|
@@ -572,11 +517,9 @@ export const greaterThanOrEqualTo: {
|
|
|
572
517
|
/**
|
|
573
518
|
* Returns a function that checks if a given `number` is greater than or equal to the provided one.
|
|
574
519
|
*
|
|
575
|
-
* @param self - The first `number` to compare with.
|
|
576
|
-
* @param that - The second `number` to compare with.
|
|
577
|
-
*
|
|
578
520
|
* @example
|
|
579
521
|
* ```ts
|
|
522
|
+
* import * as assert from "node:assert"
|
|
580
523
|
* import { greaterThanOrEqualTo } from "effect/Number"
|
|
581
524
|
*
|
|
582
525
|
* assert.deepStrictEqual(greaterThanOrEqualTo(2, 3), false)
|
|
@@ -593,12 +536,9 @@ export const greaterThanOrEqualTo: {
|
|
|
593
536
|
/**
|
|
594
537
|
* Checks if a `number` is between a `minimum` and `maximum` value (inclusive).
|
|
595
538
|
*
|
|
596
|
-
* @param self - The `number` to check.
|
|
597
|
-
* @param minimum - The `minimum` value to check.
|
|
598
|
-
* @param maximum - The `maximum` value to check.
|
|
599
|
-
*
|
|
600
539
|
* @example
|
|
601
540
|
* ```ts
|
|
541
|
+
* import * as assert from "node:assert"
|
|
602
542
|
* import { Number } from "effect"
|
|
603
543
|
*
|
|
604
544
|
* const between = Number.between({ minimum: 0, maximum: 5 })
|
|
@@ -615,12 +555,9 @@ export const between: {
|
|
|
615
555
|
/**
|
|
616
556
|
* Checks if a `number` is between a `minimum` and `maximum` value (inclusive).
|
|
617
557
|
*
|
|
618
|
-
* @param self - The `number` to check.
|
|
619
|
-
* @param minimum - The `minimum` value to check.
|
|
620
|
-
* @param maximum - The `maximum` value to check.
|
|
621
|
-
*
|
|
622
558
|
* @example
|
|
623
559
|
* ```ts
|
|
560
|
+
* import * as assert from "node:assert"
|
|
624
561
|
* import { Number } from "effect"
|
|
625
562
|
*
|
|
626
563
|
* const between = Number.between({ minimum: 0, maximum: 5 })
|
|
@@ -642,12 +579,9 @@ export const between: {
|
|
|
642
579
|
/**
|
|
643
580
|
* Checks if a `number` is between a `minimum` and `maximum` value (inclusive).
|
|
644
581
|
*
|
|
645
|
-
* @param self - The `number` to check.
|
|
646
|
-
* @param minimum - The `minimum` value to check.
|
|
647
|
-
* @param maximum - The `maximum` value to check.
|
|
648
|
-
*
|
|
649
582
|
* @example
|
|
650
583
|
* ```ts
|
|
584
|
+
* import * as assert from "node:assert"
|
|
651
585
|
* import { Number } from "effect"
|
|
652
586
|
*
|
|
653
587
|
* const between = Number.between({ minimum: 0, maximum: 5 })
|
|
@@ -676,12 +610,9 @@ export const between: {
|
|
|
676
610
|
* - If the `number` is greater than the `maximum` value, the function returns the `maximum` value.
|
|
677
611
|
* - Otherwise, it returns the original `number`.
|
|
678
612
|
*
|
|
679
|
-
* @param self - The `number` to be clamped.
|
|
680
|
-
* @param minimum - The lower end of the range.
|
|
681
|
-
* @param maximum - The upper end of the range.
|
|
682
|
-
*
|
|
683
613
|
* @example
|
|
684
614
|
* ```ts
|
|
615
|
+
* import * as assert from "node:assert"
|
|
685
616
|
* import { Number } from "effect"
|
|
686
617
|
*
|
|
687
618
|
* const clamp = Number.clamp({ minimum: 1, maximum: 5 })
|
|
@@ -701,12 +632,9 @@ export const clamp: {
|
|
|
701
632
|
* - If the `number` is greater than the `maximum` value, the function returns the `maximum` value.
|
|
702
633
|
* - Otherwise, it returns the original `number`.
|
|
703
634
|
*
|
|
704
|
-
* @param self - The `number` to be clamped.
|
|
705
|
-
* @param minimum - The lower end of the range.
|
|
706
|
-
* @param maximum - The upper end of the range.
|
|
707
|
-
*
|
|
708
635
|
* @example
|
|
709
636
|
* ```ts
|
|
637
|
+
* import * as assert from "node:assert"
|
|
710
638
|
* import { Number } from "effect"
|
|
711
639
|
*
|
|
712
640
|
* const clamp = Number.clamp({ minimum: 1, maximum: 5 })
|
|
@@ -731,12 +659,9 @@ export const clamp: {
|
|
|
731
659
|
* - If the `number` is greater than the `maximum` value, the function returns the `maximum` value.
|
|
732
660
|
* - Otherwise, it returns the original `number`.
|
|
733
661
|
*
|
|
734
|
-
* @param self - The `number` to be clamped.
|
|
735
|
-
* @param minimum - The lower end of the range.
|
|
736
|
-
* @param maximum - The upper end of the range.
|
|
737
|
-
*
|
|
738
662
|
* @example
|
|
739
663
|
* ```ts
|
|
664
|
+
* import * as assert from "node:assert"
|
|
740
665
|
* import { Number } from "effect"
|
|
741
666
|
*
|
|
742
667
|
* const clamp = Number.clamp({ minimum: 1, maximum: 5 })
|
|
@@ -760,11 +685,9 @@ export const clamp: {
|
|
|
760
685
|
/**
|
|
761
686
|
* Returns the minimum between two `number`s.
|
|
762
687
|
*
|
|
763
|
-
* @param self - The first `number`.
|
|
764
|
-
* @param that - The second `number`.
|
|
765
|
-
*
|
|
766
688
|
* @example
|
|
767
689
|
* ```ts
|
|
690
|
+
* import * as assert from "node:assert"
|
|
768
691
|
* import { min } from "effect/Number"
|
|
769
692
|
*
|
|
770
693
|
* assert.deepStrictEqual(min(2, 3), 2)
|
|
@@ -776,11 +699,9 @@ export const min: {
|
|
|
776
699
|
/**
|
|
777
700
|
* Returns the minimum between two `number`s.
|
|
778
701
|
*
|
|
779
|
-
* @param self - The first `number`.
|
|
780
|
-
* @param that - The second `number`.
|
|
781
|
-
*
|
|
782
702
|
* @example
|
|
783
703
|
* ```ts
|
|
704
|
+
* import * as assert from "node:assert"
|
|
784
705
|
* import { min } from "effect/Number"
|
|
785
706
|
*
|
|
786
707
|
* assert.deepStrictEqual(min(2, 3), 2)
|
|
@@ -792,11 +713,9 @@ export const min: {
|
|
|
792
713
|
/**
|
|
793
714
|
* Returns the minimum between two `number`s.
|
|
794
715
|
*
|
|
795
|
-
* @param self - The first `number`.
|
|
796
|
-
* @param that - The second `number`.
|
|
797
|
-
*
|
|
798
716
|
* @example
|
|
799
717
|
* ```ts
|
|
718
|
+
* import * as assert from "node:assert"
|
|
800
719
|
* import { min } from "effect/Number"
|
|
801
720
|
*
|
|
802
721
|
* assert.deepStrictEqual(min(2, 3), 2)
|
|
@@ -810,11 +729,9 @@ export const min: {
|
|
|
810
729
|
/**
|
|
811
730
|
* Returns the maximum between two `number`s.
|
|
812
731
|
*
|
|
813
|
-
* @param self - The first `number`.
|
|
814
|
-
* @param that - The second `number`.
|
|
815
|
-
*
|
|
816
732
|
* @example
|
|
817
733
|
* ```ts
|
|
734
|
+
* import * as assert from "node:assert"
|
|
818
735
|
* import { max } from "effect/Number"
|
|
819
736
|
*
|
|
820
737
|
* assert.deepStrictEqual(max(2, 3), 3)
|
|
@@ -826,11 +743,9 @@ export const max: {
|
|
|
826
743
|
/**
|
|
827
744
|
* Returns the maximum between two `number`s.
|
|
828
745
|
*
|
|
829
|
-
* @param self - The first `number`.
|
|
830
|
-
* @param that - The second `number`.
|
|
831
|
-
*
|
|
832
746
|
* @example
|
|
833
747
|
* ```ts
|
|
748
|
+
* import * as assert from "node:assert"
|
|
834
749
|
* import { max } from "effect/Number"
|
|
835
750
|
*
|
|
836
751
|
* assert.deepStrictEqual(max(2, 3), 3)
|
|
@@ -842,11 +757,9 @@ export const max: {
|
|
|
842
757
|
/**
|
|
843
758
|
* Returns the maximum between two `number`s.
|
|
844
759
|
*
|
|
845
|
-
* @param self - The first `number`.
|
|
846
|
-
* @param that - The second `number`.
|
|
847
|
-
*
|
|
848
760
|
* @example
|
|
849
761
|
* ```ts
|
|
762
|
+
* import * as assert from "node:assert"
|
|
850
763
|
* import { max } from "effect/Number"
|
|
851
764
|
*
|
|
852
765
|
* assert.deepStrictEqual(max(2, 3), 3)
|
|
@@ -860,10 +773,9 @@ export const max: {
|
|
|
860
773
|
/**
|
|
861
774
|
* Determines the sign of a given `number`.
|
|
862
775
|
*
|
|
863
|
-
* @param n - The `number` to determine the sign of.
|
|
864
|
-
*
|
|
865
776
|
* @example
|
|
866
777
|
* ```ts
|
|
778
|
+
* import * as assert from "node:assert"
|
|
867
779
|
* import { sign } from "effect/Number"
|
|
868
780
|
*
|
|
869
781
|
* assert.deepStrictEqual(sign(-5), -1)
|
|
@@ -879,10 +791,9 @@ export const sign = (n: number): Ordering => Order(n, 0)
|
|
|
879
791
|
/**
|
|
880
792
|
* Takes an `Iterable` of `number`s and returns their sum as a single `number`.
|
|
881
793
|
*
|
|
882
|
-
* @param collection - The collection of `number`s to sum.
|
|
883
|
-
*
|
|
884
794
|
* @example
|
|
885
795
|
* ```ts
|
|
796
|
+
* import * as assert from "node:assert"
|
|
886
797
|
* import { sumAll } from "effect/Number"
|
|
887
798
|
*
|
|
888
799
|
* assert.deepStrictEqual(sumAll([2, 3, 4]), 9)
|
|
@@ -902,10 +813,9 @@ export const sumAll = (collection: Iterable<number>): number => {
|
|
|
902
813
|
/**
|
|
903
814
|
* Takes an `Iterable` of `number`s and returns their multiplication as a single `number`.
|
|
904
815
|
*
|
|
905
|
-
* @param collection - The collection of `number`s to multiply.
|
|
906
|
-
*
|
|
907
816
|
* @example
|
|
908
817
|
* ```ts
|
|
818
|
+
* import * as assert from "node:assert"
|
|
909
819
|
* import { multiplyAll } from "effect/Number"
|
|
910
820
|
*
|
|
911
821
|
* assert.deepStrictEqual(multiplyAll([2, 3, 4]), 24)
|
|
@@ -930,11 +840,9 @@ export const multiplyAll = (collection: Iterable<number>): number => {
|
|
|
930
840
|
*
|
|
931
841
|
* It always takes the sign of the dividend.
|
|
932
842
|
*
|
|
933
|
-
* @param self - The dividend.
|
|
934
|
-
* @param divisor - The divisor.
|
|
935
|
-
*
|
|
936
843
|
* @example
|
|
937
844
|
* ```ts
|
|
845
|
+
* import * as assert from "node:assert"
|
|
938
846
|
* import { remainder } from "effect/Number"
|
|
939
847
|
*
|
|
940
848
|
* assert.deepStrictEqual(remainder(2, 2), 0)
|
|
@@ -951,11 +859,9 @@ export const remainder: {
|
|
|
951
859
|
*
|
|
952
860
|
* It always takes the sign of the dividend.
|
|
953
861
|
*
|
|
954
|
-
* @param self - The dividend.
|
|
955
|
-
* @param divisor - The divisor.
|
|
956
|
-
*
|
|
957
862
|
* @example
|
|
958
863
|
* ```ts
|
|
864
|
+
* import * as assert from "node:assert"
|
|
959
865
|
* import { remainder } from "effect/Number"
|
|
960
866
|
*
|
|
961
867
|
* assert.deepStrictEqual(remainder(2, 2), 0)
|
|
@@ -972,11 +878,9 @@ export const remainder: {
|
|
|
972
878
|
*
|
|
973
879
|
* It always takes the sign of the dividend.
|
|
974
880
|
*
|
|
975
|
-
* @param self - The dividend.
|
|
976
|
-
* @param divisor - The divisor.
|
|
977
|
-
*
|
|
978
881
|
* @example
|
|
979
882
|
* ```ts
|
|
883
|
+
* import * as assert from "node:assert"
|
|
980
884
|
* import { remainder } from "effect/Number"
|
|
981
885
|
*
|
|
982
886
|
* assert.deepStrictEqual(remainder(2, 2), 0)
|
|
@@ -1001,10 +905,9 @@ export const remainder: {
|
|
|
1001
905
|
/**
|
|
1002
906
|
* Returns the next power of 2 from the given number.
|
|
1003
907
|
*
|
|
1004
|
-
* @param self - The number to find the next power of 2 from.
|
|
1005
|
-
*
|
|
1006
908
|
* @example
|
|
1007
909
|
* ```ts
|
|
910
|
+
* import * as assert from "node:assert"
|
|
1008
911
|
* import { nextPow2 } from "effect/Number"
|
|
1009
912
|
*
|
|
1010
913
|
* assert.deepStrictEqual(nextPow2(5), 8)
|
|
@@ -1048,11 +951,9 @@ export const parse = (s: string): Option<number> => {
|
|
|
1048
951
|
/**
|
|
1049
952
|
* Returns the number rounded with the given precision.
|
|
1050
953
|
*
|
|
1051
|
-
* @param self - The number to round
|
|
1052
|
-
* @param precision - The precision
|
|
1053
|
-
*
|
|
1054
954
|
* @example
|
|
1055
955
|
* ```ts
|
|
956
|
+
* import * as assert from "node:assert"
|
|
1056
957
|
* import { round } from "effect/Number"
|
|
1057
958
|
*
|
|
1058
959
|
* assert.deepStrictEqual(round(1.1234, 2), 1.12)
|
|
@@ -1066,11 +967,9 @@ export const round: {
|
|
|
1066
967
|
/**
|
|
1067
968
|
* Returns the number rounded with the given precision.
|
|
1068
969
|
*
|
|
1069
|
-
* @param self - The number to round
|
|
1070
|
-
* @param precision - The precision
|
|
1071
|
-
*
|
|
1072
970
|
* @example
|
|
1073
971
|
* ```ts
|
|
972
|
+
* import * as assert from "node:assert"
|
|
1074
973
|
* import { round } from "effect/Number"
|
|
1075
974
|
*
|
|
1076
975
|
* assert.deepStrictEqual(round(1.1234, 2), 1.12)
|
|
@@ -1084,11 +983,9 @@ export const round: {
|
|
|
1084
983
|
/**
|
|
1085
984
|
* Returns the number rounded with the given precision.
|
|
1086
985
|
*
|
|
1087
|
-
* @param self - The number to round
|
|
1088
|
-
* @param precision - The precision
|
|
1089
|
-
*
|
|
1090
986
|
* @example
|
|
1091
987
|
* ```ts
|
|
988
|
+
* import * as assert from "node:assert"
|
|
1092
989
|
* import { round } from "effect/Number"
|
|
1093
990
|
*
|
|
1094
991
|
* assert.deepStrictEqual(round(1.1234, 2), 1.12)
|