lolite.invert 1.1.9 → 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.
Files changed (2) hide show
  1. package/README.md +0 -133
  2. package/package.json +6 -1
package/README.md CHANGED
@@ -17,137 +17,4 @@ const negativeInfinity = invert(Infinity)
17
17
  const coercedNegative = invert("garbage")
18
18
  // result: -0 (0 inverted)
19
19
  ```
20
-
21
- ### floor(value)
22
- Round a number down to the nearest whole integer.
23
- Non-finite or non-numeric values are coerced to zero.
24
-
25
- ```javascript
26
- const lolite = require("lolite.invert")
27
- const positiveResult = lolite.floor(2.1)
28
- // result: 2
29
-
30
- const negativeResult = lolite.floor(-2.1)
31
- // result: 3
32
-
33
- const coercedResult = lolite.floor("garbage")
34
- // result: 0 (0 floored)
35
- ```
36
-
37
- ### ceil(value)
38
- Round a number up to the nearest whole integer.
39
- Non-finite or non-numeric values are coerced to zero.
40
-
41
- ```javascript
42
- const lolite = require("lolite.invert")
43
- const positiveResult = lolite.ceil(2.1)
44
- // result: 3
45
-
46
- const negativeResult = lolite.ceil(-2.1)
47
- // result: 2
48
-
49
- const coercedResult = lolite.ceil("garbage")
50
- // result: 0 (0 ceiled)
51
- ```
52
-
53
- ### round(value)
54
- Round a number either up to the nearest whole integer, unless the number is less than `0.5`, then it rounds down.
55
- Non-finite or non-numeric values are coerced to zero.
56
-
57
- ```javascript
58
- const lolite = require("lolite.invert")
59
-
60
- const flooredResult = lolite.round(2.1)
61
- // result: 2
62
-
63
- const ceiledResult = lolite.round(2.9)
64
- // result: 3
65
-
66
- const coercedResult = lolite.round("garbage")
67
- // result: 0 (0 ceiled)
68
- ```
69
-
70
- ### trunc(value)
71
- Truncates the decimal portion of a number, returning only the integer part. Truncation moves toward zero for both positive and negative numbers.
72
- Non-finite or non-numeric values are coerced to zero.
73
-
74
- ```javascript
75
- const lolite = require("lolite.invert")
76
-
77
- const positiveResult = lolite.trunc(2.9)
78
- // result: 2
79
-
80
- const negativeResult = lolite.trunc(-2.9)
81
- // result: -2
82
-
83
- const zeroPreservation = lolite.trunc(-0)
84
- // result: -0
85
-
86
- const coercedResult = lolite.trunc("garbage")
87
- // result: 0
88
- ```
89
-
90
- ### sign(value)
91
- Returns the sign of a number, indicating whether the number is positive, negative, or zero, or negative zero.
92
- Non-finite values are coerced to zero.
93
-
94
- ```javascript
95
- const lolite = require("lolite.invert")
96
-
97
- lolite.sign(42) // result: 1
98
- lolite.sign(Infinity) // result: 1
99
- lolite.sign(-42) // result: -1
100
- lolite.sign(-Infinity) // result: -1
101
- lolite.sign(0) // result: 0
102
- lolite.sign(-0) // result: -0
103
-
104
- lolite.sign("garbage") // result: 0
105
- lolite.sign(NaN) // result: 0
106
- ```
107
-
108
- ### max(a, b)
109
- Returns the largest of two numbers.
110
- Non-finite or non-numeric values are coerced to zero.
111
-
112
- ```javascript
113
- const lolite = require("lolite.invert")
114
- const result = lolite.max(5, 10)
115
- // result: 10
116
-
117
- const coercedMax = lolite.max(-5, Infinity)
118
- // result: 0 (comparing -5 and 0)
119
- ```
120
-
121
- ### min(a, b)
122
- Returns the smallest of two numbers.
123
- Non-finite or non-numeric values are coerced to zero.
124
-
125
- ```javascript
126
- const lolite = require("lolite.invert")
127
- const result = lolite.min(5, 10)
128
- // result: 5
129
-
130
- const coercedMin = lolite.min(5, "garbage")
131
- // result: 0 (comparing 5 and 0)
132
- ```
133
-
134
- ### clamp(value, lower, upper)
135
- Restricts a value to be within the specified bounds.
136
- Non-finite or non-numeric values are coerced to zero.
137
-
138
- Note: If lower bound exceeds upper bound after coercion, the function prioritizes the lower bound.
139
- ```javascript
140
- const lolite = require("lolite.invert")
141
- const result = lolite.clamp(5, 1, 10)
142
- // result: 5
143
-
144
- const capped = lolite.clamp(15, 1, 10)
145
- // result: 10
146
-
147
- const raised = lolite.clamp(-5, 1, 10)
148
- // result: 1
149
-
150
- const coercedClamp = lolite.clamp(Infinity, "garbage", NaN)
151
- // result: 0 (0 clamped between 0 and 0)
152
- ```
153
20
 
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "lolite.invert",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "main": "src/lib/invert.js",
5
5
  "license": "EGPSL10X-1.0",
6
+ "author": "10x'ly Made Software Ventures AB",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/enterprise-npm-ai/lolite.git"
10
+ },
6
11
  "dependencies": {
7
12
  "@10xly/strict-equals": "^1.0.0",
8
13
  "@is-(unknown)/is-finite": "^1.0.0",