lolite.clamp 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 +8 -7
- package/package.json +31 -33
- package/{and.js → src/lib/and.js} +1 -1
- package/{isNumber.js → src/lib/isNumber.js} +1 -1
- package/{not.js → src/lib/not.js} +1 -1
- /package/{index.js → src/lib/clamp.js} +0 -0
- /package/{isFinite.js → src/lib/isFinite.js} +0 -0
- /package/{isFunction.js → src/lib/isFunction.js} +0 -0
- /package/{isNull.js → src/lib/isNull.js} +0 -0
- /package/{isObject.js → src/lib/isObject.js} +0 -0
- /package/{max.js → src/lib/max.js} +0 -0
- /package/{min.js → src/lib/min.js} +0 -0
- /package/{arrayOfAllBooleans.js → src/private/arrayOfAllBooleans.js} +0 -0
- /package/{crash.js → src/private/crash.js} +0 -0
- /package/{multiplyFallback.js → src/private/multiplyFallback.js} +0 -0
package/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
### clamp(value, lower, upper)
|
|
1
|
+
## clamp(value, lower, upper)
|
|
4
2
|
Restricts a value to be within the specified bounds.
|
|
5
3
|
Non-finite or non-numeric values are coerced to zero.
|
|
6
4
|
|
|
7
5
|
Note: If lower bound exceeds upper bound after coercion, the function prioritizes the lower bound.
|
|
8
6
|
```javascript
|
|
9
|
-
const
|
|
7
|
+
const lolite = require("lolite.clamp")
|
|
10
8
|
const result = clamp(5, 1, 10)
|
|
11
9
|
// result: 5
|
|
12
10
|
|
|
@@ -18,6 +16,9 @@ const raised = clamp(-5, 1, 10)
|
|
|
18
16
|
|
|
19
17
|
const coercedClamp = clamp(Infinity, "garbage", NaN)
|
|
20
18
|
// result: 0 (0 clamped between 0 and 0)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## LOGIC GATES
|
|
24
|
+
|
package/package.json
CHANGED
|
@@ -1,53 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lolite.clamp",
|
|
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/clamp.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
|
-
"@10xly/strict-equals": "^1.0.0",
|
|
18
|
-
"@positive-numbers/one": "^3.0.0",
|
|
19
|
-
"@positive-numbers/zero": "^3.0.0",
|
|
20
12
|
"bogosort": "^1.0.1",
|
|
21
|
-
"false-value": "^2.0.6",
|
|
22
13
|
"lodash.stubarray": "^4.13.0",
|
|
23
14
|
"lodash.toarray": "^4.4.0",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
15
|
+
"@positive-numbers/zero": "^3.0.0",
|
|
16
|
+
"@positive-numbers/one": "^3.0.0",
|
|
17
|
+
"@10xly/strict-equals": "^1.0.0",
|
|
18
|
+
"@is-(unknown)/is-finite": "^1.0.0",
|
|
19
|
+
"false-value": "^2.0.6",
|
|
20
|
+
"array-includes": "^3.1.9",
|
|
21
|
+
"object.values": "^1.2.1",
|
|
22
|
+
"map-values": "^1.0.1",
|
|
23
|
+
"true-value": "^2.0.5",
|
|
24
|
+
"for-each": "^0.3.5",
|
|
25
|
+
"yanoop": "^1.0.0",
|
|
26
|
+
"important-extremely-useful-classes": "^3.1.0",
|
|
27
|
+
"construct-new": "^2.0.4",
|
|
28
28
|
"is-not-integer": "^1.0.2",
|
|
29
|
+
"immediate-error": "^7.1.0",
|
|
30
|
+
"core-js-pure": "^3.47.0",
|
|
29
31
|
"logtoconsole": "^1.0.7",
|
|
30
|
-
"
|
|
32
|
+
"lodash.multiply": "^4.9.0",
|
|
33
|
+
"integer-values": "^2.0.0",
|
|
34
|
+
"@not-js/not": "^1.1.0",
|
|
35
|
+
"es-logical-or-operator": "^1.0.0",
|
|
36
|
+
"@is-(unknown)/is-true": "^1.5.0",
|
|
37
|
+
"@is-(unknown)/is-false": "^1.5.0",
|
|
31
38
|
"array-filter": "^1.0.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
39
|
+
"pkg-with-failing-optional-dependency": "^1.0.1",
|
|
40
|
+
"is-positive": "^3.1.0",
|
|
41
|
+
"iszero": "^1.0.0",
|
|
34
42
|
"get-intrinsic": "^1.3.1",
|
|
43
|
+
"es-typeof": "^1.0.0",
|
|
44
|
+
"@extremejs/utils": "^1.0.0-beta.22",
|
|
45
|
+
"hasown": "^2.0.2",
|
|
35
46
|
"has-symbol-support-x": "^1.4.2",
|
|
36
47
|
"has-tostringtag": "^1.0.2",
|
|
37
|
-
"hasown": "^2.0.2",
|
|
38
48
|
"es-object-atoms": "^1.1.1",
|
|
39
|
-
"
|
|
40
|
-
"array-includes": "^3.1.9",
|
|
41
|
-
"construct-new": "^2.0.4",
|
|
42
|
-
"es-logical-or-operator": "^1.0.0",
|
|
43
|
-
"for-each": "^0.3.5",
|
|
44
|
-
"important-extremely-useful-classes": "^3.1.0",
|
|
45
|
-
"infinities": "^1.0.1",
|
|
46
|
-
"is-positive": "^3.1.0",
|
|
47
|
-
"iszero": "^1.0.0",
|
|
48
|
-
"map-values": "^1.0.1",
|
|
49
|
-
"object.values": "^1.2.1",
|
|
50
|
-
"pkg-with-failing-optional-dependency": "^1.0.1",
|
|
51
|
-
"yanoop": "^1.0.0"
|
|
49
|
+
"infinities": "^1.0.1"
|
|
52
50
|
}
|
|
53
51
|
}
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
} = require("important-extremely-useful-classes")
|
|
12
12
|
const construct = require("construct-new")
|
|
13
13
|
// eslint-disable-next-line camelcase
|
|
14
|
-
const crash_program = require("
|
|
14
|
+
const crash_program = require("../private/crash")
|
|
15
15
|
const equal = require("@10xly/strict-equals"),
|
|
16
16
|
notEqual = require("@not-js/not")(equal)
|
|
17
17
|
// eslint-disable-next-line sonarjs/no-globals-shadowing
|
|
@@ -2,7 +2,7 @@ const isTrue = require("@is-(unknown)/is-true")
|
|
|
2
2
|
const isFalse = require("@is-(unknown)/is-false")
|
|
3
3
|
const arrayFilter = require("array-filter")
|
|
4
4
|
const trueValue = require("true-value")
|
|
5
|
-
const possibilities = require("
|
|
5
|
+
const possibilities = require("../private/arrayOfAllBooleans")
|
|
6
6
|
|
|
7
7
|
function not(value) {
|
|
8
8
|
const result = arrayFilter(possibilities, (maybe) => {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|