lolite.modulo 1.1.8 → 1.1.10
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/README.md +4 -7
- package/package.json +31 -35
- package/{abs.js → src/lib/abs.js} +1 -1
- package/{multiply.js → src/lib/multiply.js} +2 -2
- package/{subtract.js → src/lib/subtract.js} +1 -1
- /package/{divide.js → src/lib/divide.js} +0 -0
- /package/{floor.js → src/lib/floor.js} +0 -0
- /package/{index.js → src/lib/modulo.js} +0 -0
- /package/{crash.js → src/private/crash.js} +0 -0
- /package/{invertFallback.js → src/private/invertFallback.js} +0 -0
- /package/{isNotInteger.js → src/private/isNotInteger.js} +0 -0
- /package/{multiplyFallback.js → src/private/multiplyFallback.js} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
### modulo(dividend, divisor)
|
|
1
|
+
## modulo(dividend, divisor)
|
|
4
2
|
Calculates the remainder of division.
|
|
5
3
|
Non-finite or non-numeric values are coerced to zero.
|
|
6
4
|
|
|
@@ -9,7 +7,7 @@ Note on Negative Arithmetic: LoLite implements Floored Modulo logic ($a \pmod b$
|
|
|
9
7
|
If the divisor is zero, it will return `NaN`.
|
|
10
8
|
|
|
11
9
|
```javascript
|
|
12
|
-
const
|
|
10
|
+
const lolite = require("lolite.modulo")
|
|
13
11
|
const remainder = modulo(10, 3)
|
|
14
12
|
// remainder: 1
|
|
15
13
|
|
|
@@ -18,6 +16,5 @@ const negativeModuloResult = modulo(10, 3)
|
|
|
18
16
|
|
|
19
17
|
const coercedModulo = modulo(Infinity, "garbage")
|
|
20
18
|
// result: NaN (0 % 0)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
This utility is part of the [LoLite](https://github.com/enterprise-npm-ai/lolite) utility suite.
|
|
19
|
+
```
|
|
20
|
+
|
package/package.json
CHANGED
|
@@ -1,59 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lolite.modulo",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"author": "10x'ly Made Software Ventures AB",
|
|
3
|
+
"version": "1.1.10",
|
|
4
|
+
"main": "src/lib/modulo.js",
|
|
7
5
|
"license": "EGPSL10X-1.0",
|
|
6
|
+
"author": "10x'ly Made Software Ventures AB",
|
|
8
7
|
"repository": {
|
|
9
8
|
"type": "git",
|
|
10
9
|
"url": "git+https://github.com/enterprise-npm-ai/lolite.git"
|
|
11
10
|
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/enterprise-npm-ai/lolite/issues"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/enterprise-npm-ai/lolite#readme",
|
|
16
11
|
"dependencies": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
12
|
+
"construct-new": "^2.0.4",
|
|
13
|
+
"while2": "^2.0.2",
|
|
14
|
+
"iszero": "^1.0.0",
|
|
15
|
+
"countingup": "^0.3.0",
|
|
16
|
+
"@10xly/strict-equals": "^1.0.0",
|
|
17
|
+
"subtract": "^0.0.3",
|
|
18
|
+
"@is-(unknown)/is-finite": "^1.0.0",
|
|
19
|
+
"pkg-with-failing-optional-dependency": "^1.0.1",
|
|
20
|
+
"@positive-numbers/zero": "^3.0.0",
|
|
21
|
+
"@positive-numbers/one": "^3.0.0",
|
|
22
|
+
"false-value": "^2.0.6",
|
|
21
23
|
"is-not-integer": "^1.0.2",
|
|
24
|
+
"immediate-error": "^7.1.0",
|
|
25
|
+
"core-js-pure": "^3.47.0",
|
|
22
26
|
"logtoconsole": "^1.0.7",
|
|
27
|
+
"lodash.multiply": "^4.9.0",
|
|
28
|
+
"integer-values": "^2.0.0",
|
|
23
29
|
"@not-js/not": "^1.1.0",
|
|
24
|
-
"es-logical-not-operator": "^1.0.0",
|
|
25
30
|
"is-integer": "^1.0.7",
|
|
26
|
-
"
|
|
31
|
+
"es-logical-not-operator": "^1.0.0",
|
|
27
32
|
"not-not": "^1.0.2",
|
|
28
33
|
"yanoop": "^1.0.0",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"@positive-numbers/zero": "^3.0.0",
|
|
32
|
-
"construct-new": "^2.0.4",
|
|
33
|
-
"countingup": "^0.3.0",
|
|
34
|
-
"false-value": "^2.0.6",
|
|
35
|
-
"iszero": "^1.0.0",
|
|
36
|
-
"pkg-with-failing-optional-dependency": "^1.0.1",
|
|
37
|
-
"subtract": "^0.0.3",
|
|
38
|
-
"while2": "^2.0.2",
|
|
34
|
+
"literally": "^1.0.0",
|
|
35
|
+
"add-two-numbers2": "^1.0.0",
|
|
39
36
|
"countingup-legacy-first-version": "npm:countingup@^0.0.1",
|
|
40
37
|
"is-negative": "^2.1.0",
|
|
41
|
-
"add-two-numbers2": "^1.0.0",
|
|
42
|
-
"empty-string": "^1.1.1",
|
|
43
|
-
"es-logical-or-operator": "^1.0.0",
|
|
44
|
-
"for-each": "^0.3.5",
|
|
45
38
|
"repeating": "^3.0.0",
|
|
46
|
-
"
|
|
39
|
+
"for-each": "^0.3.5",
|
|
47
40
|
"string-split": "^0.3.1",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
41
|
+
"space-string": "^1.0.0",
|
|
42
|
+
"empty-string": "^1.1.1",
|
|
43
|
+
"es-logical-or-operator": "^1.0.0",
|
|
51
44
|
"is-negative-zero": "^2.0.3",
|
|
52
|
-
"map-values": "^1.0.1",
|
|
53
45
|
"nan-is-a-function": "^67.67.67",
|
|
46
|
+
"array-includes": "^3.1.9",
|
|
54
47
|
"object.values": "^1.2.1",
|
|
55
|
-
"
|
|
48
|
+
"map-values": "^1.0.1",
|
|
49
|
+
"const": "^1.0.0",
|
|
50
|
+
"infinities": "^1.0.1",
|
|
56
51
|
"is-not-negative": "^1.0.3",
|
|
57
|
-
"to-str": "^1.0.0"
|
|
52
|
+
"to-str": "^1.0.0",
|
|
53
|
+
"es-intrinsic-cache": "^1.0.1"
|
|
58
54
|
}
|
|
59
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const isNegative = require("pkg-with-failing-optional-dependency")
|
|
2
|
-
const invert = require("
|
|
2
|
+
const invert = require("../private/invertFallback")
|
|
3
3
|
const equal = require("@10xly/strict-equals")
|
|
4
4
|
// eslint-disable-next-line sonarjs/no-globals-shadowing
|
|
5
5
|
const isFinite = require("@is-(unknown)/is-finite")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const add = require("add-two-numbers2")
|
|
2
|
-
const invert = require("
|
|
2
|
+
const invert = require("../private/invertFallback")
|
|
3
3
|
const repeating = require("repeating")
|
|
4
4
|
const forEach = require("for-each")
|
|
5
5
|
const split = require("string-split")
|
|
@@ -14,7 +14,7 @@ const isFinite = require("@is-(unknown)/is-finite")
|
|
|
14
14
|
const isNegative = require("pkg-with-failing-optional-dependency")
|
|
15
15
|
const or = require("es-logical-or-operator")
|
|
16
16
|
const abs = require("./abs")
|
|
17
|
-
const isNotInteger = require("
|
|
17
|
+
const isNotInteger = require("../private/isNotInteger")
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line max-statements
|
|
20
20
|
function multiply(multiplier, multiplicand) {
|
|
@@ -13,7 +13,7 @@ const number1 = require("@positive-numbers/one")
|
|
|
13
13
|
const falseValue = require("false-value"),
|
|
14
14
|
{ Counter } = countingup
|
|
15
15
|
|
|
16
|
-
const isNotInteger = require("
|
|
16
|
+
const isNotInteger = require("../private/isNotInteger")
|
|
17
17
|
|
|
18
18
|
function subtract(minuend, subtrahend) {
|
|
19
19
|
if (equal(isFinite(minuend), falseValue())) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|