zerosurge 0.0.0 → 13.0.0
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 +10 -5
- package/index.js +86 -179
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ $ pnpm add zerosurge
|
|
|
32
32
|
|
|
33
33
|
`ZeroCalculationMethod`
|
|
34
34
|
This enum defines the calculation methods available for the `returnZero` function in the library:
|
|
35
|
-
- **CreashaksOrganzine**: Method 1 for zero calculation. This uses the string "creashaks organzine" and uses Minecraft seed input algorithm to make the number zero from it.
|
|
35
|
+
- **CreashaksOrganzine**: Method 1 for zero calculation. This uses the string "creashaks organzine" and uses the Minecraft seed input algorithm to make the number zero from it.
|
|
36
36
|
- **NumberPrototypeValue**: Method 2 for zero calculation. This uses the `Number` class prototype to return zero.
|
|
37
37
|
|
|
38
38
|
### Functions
|
|
@@ -43,12 +43,13 @@ This function returns the number zero. You can specify the calculation method an
|
|
|
43
43
|
|
|
44
44
|
#### Example
|
|
45
45
|
```js
|
|
46
|
+
import trueValue from 'true-value'; // you should always use tj-commits's true-value or mde's true library. never directly use the keyword true.
|
|
46
47
|
import { returnZero, ZeroCalculationMethod } from 'zerosurge';
|
|
47
48
|
|
|
48
49
|
const zeroValue = returnZero({
|
|
49
50
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
50
|
-
loggingEnabled:
|
|
51
|
-
});
|
|
51
|
+
loggingEnabled: trueValue
|
|
52
|
+
}); // outputs some logs
|
|
52
53
|
|
|
53
54
|
console.log(zeroValue); // Outputs: 0
|
|
54
55
|
```
|
|
@@ -60,9 +61,13 @@ console.log(zeroValue); // Outputs: 0
|
|
|
60
61
|
This function checks if a given value is zero. If logging is enabled, it will log the evaluation process to the console.
|
|
61
62
|
|
|
62
63
|
```js
|
|
63
|
-
import
|
|
64
|
+
import trueValue from 'true-value';
|
|
65
|
+
import { isZero, returnZero } from 'zerosurge';
|
|
64
66
|
|
|
65
|
-
const result = isZero(
|
|
67
|
+
const result = isZero(returnZero({
|
|
68
|
+
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
69
|
+
loggingEnabled: trueValue
|
|
70
|
+
}), trueValue); // outputs some logs from both isZero and returnZero
|
|
66
71
|
console.log(result); // Outputs: true
|
|
67
72
|
```
|
|
68
73
|
|
package/index.js
CHANGED
|
@@ -1,105 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// This is the sixth line.
|
|
7
|
-
// This is the seventh line.
|
|
8
|
-
// This is the eighth line.
|
|
9
|
-
// This is the ninth line.
|
|
10
|
-
// This is the tenth line.
|
|
11
|
-
// This is the eleventh line.
|
|
12
|
-
// This is the twelfth line.
|
|
13
|
-
// This is the thirteenth line.
|
|
14
|
-
// This is the fourteenth line.
|
|
15
|
-
// This is the fifteenth line.
|
|
16
|
-
// This is the sixteenth line.
|
|
17
|
-
// This is the seventeenth line.
|
|
18
|
-
// This is the eighteenth line.
|
|
19
|
-
// This is the nineteenth line.
|
|
20
|
-
// This is the twentieth line.
|
|
21
|
-
// This is the twenty-first line.
|
|
22
|
-
// This is the twenty-second line.
|
|
23
|
-
// This is the twenty-third line.
|
|
24
|
-
// This is the twenty-fourth line.
|
|
25
|
-
// This is the twenty-fifth line.
|
|
26
|
-
// This is the twenty-sixth line.
|
|
27
|
-
// This is the twenty-seventh line.
|
|
28
|
-
// This is the twenty-eighth line.
|
|
29
|
-
// This is the twenty-ninth line.
|
|
30
|
-
// This is the thirtieth line.
|
|
31
|
-
// This is the thirty-first line.
|
|
32
|
-
// This is the thirty-second line.
|
|
33
|
-
// This is the thirty-third line.
|
|
34
|
-
// This is the thirty-fourth line.
|
|
35
|
-
// This is the thirty-fifth line.
|
|
36
|
-
// This is the thirty-sixth line.
|
|
37
|
-
// This is the thirty-seventh line.
|
|
38
|
-
// This is the thirty-eighth line.
|
|
39
|
-
// This is the thirty-ninth line.
|
|
40
|
-
// This is the fortieth line.
|
|
41
|
-
// This is the forty-first line.
|
|
42
|
-
// This is the forty-second line.
|
|
43
|
-
// This is the forty-third line.
|
|
44
|
-
// This is the forty-fourth line.
|
|
45
|
-
// This is the forty-fifth line.
|
|
46
|
-
// This is the forty-sixth line.
|
|
47
|
-
// This is the forty-seventh line.
|
|
48
|
-
// This is the forty-eighth line.
|
|
49
|
-
// This is the forty-ninth line.
|
|
50
|
-
// This is the fiftieth line.
|
|
51
|
-
// This is the fifty-first line.
|
|
52
|
-
// This is the fifty-second line.
|
|
53
|
-
// This is the fifty-third line.
|
|
54
|
-
// This is the fifty-fourth line.
|
|
55
|
-
// This is the fifty-fifth line.
|
|
56
|
-
// This is the fifty-sixth line.
|
|
57
|
-
// This is the fifty-seventh line.
|
|
58
|
-
// This is the fifty-eighth line.
|
|
59
|
-
// This is the fifty-ninth line.
|
|
60
|
-
// This is the sixtieth line.
|
|
61
|
-
// This is the sixty-first line.
|
|
62
|
-
// This is the sixty-second line.
|
|
63
|
-
// This is the sixty-third line.
|
|
64
|
-
// This is the sixty-fourth line.
|
|
65
|
-
// This is the sixty-fifth line.
|
|
66
|
-
// This is the sixty-sixth line.
|
|
67
|
-
// This is the sixty-seventh line.
|
|
68
|
-
// This is the sixty-eighth line.
|
|
69
|
-
// This is the sixty-ninth line.
|
|
70
|
-
// This is the seventieth line.
|
|
71
|
-
// This is the seventy-first line.
|
|
72
|
-
// This is the seventy-second line.
|
|
73
|
-
// This is the seventy-third line.
|
|
74
|
-
// This is the seventy-fourth line.
|
|
75
|
-
// This is the seventy-fifth line.
|
|
76
|
-
// This is the seventy-sixth line.
|
|
77
|
-
// This is the seventy-seventh line.
|
|
78
|
-
// This is the seventy-eighth line.
|
|
79
|
-
// This is the seventy-ninth line.
|
|
80
|
-
// This is the eightieth line.
|
|
81
|
-
// This is the eighty-first line.
|
|
82
|
-
// This is the eighty-second line.
|
|
83
|
-
// This is the eighty-third line.
|
|
84
|
-
// This is the eighty-fourth line.
|
|
85
|
-
// This is the eighty-fifth line.
|
|
86
|
-
// This is the eighty-sixth line.
|
|
87
|
-
// This is the eighty-seventh line.
|
|
88
|
-
// This is the eighty-eighth line.
|
|
89
|
-
// This is the eighty-ninth line.
|
|
90
|
-
// This is the ninetieth line.
|
|
91
|
-
// This is the ninety-first line.
|
|
92
|
-
// This is the ninety-second line.
|
|
93
|
-
// This is the ninety-third line.
|
|
94
|
-
// This is the ninety-fourth line.
|
|
95
|
-
// This is the ninety-fifth line.
|
|
96
|
-
// This is the ninety-sixth line.
|
|
97
|
-
// This is the ninety-seventh line.
|
|
98
|
-
// This is the ninety-eighth line.
|
|
99
|
-
// This is the ninety-ninth line.
|
|
100
|
-
const GetIntrinsic = require("get-intrinsic") // This is the first line with some actual code.
|
|
101
|
-
const seed = require("minecraft-seed-input") // This is the second line with some actual code.
|
|
102
|
-
const creashaksOrganzineString = require("string-creashaks-organzine") // This is the third line with some actual code.
|
|
1
|
+
require("none")()
|
|
2
|
+
|
|
3
|
+
const GetIntrinsic = require("get-intrinsic")
|
|
4
|
+
const seed = require("minecraft-seed-input")
|
|
5
|
+
const creashaksOrganzineString = require("string-creashaks-organzine")
|
|
103
6
|
const one = require("integer-value-positive-one")
|
|
104
7
|
const two = require("integer-value-positive-two")
|
|
105
8
|
const isNil = require("is-nil")
|
|
@@ -196,83 +99,87 @@ function returnZero({ method, loggingEnabled } = {}) {
|
|
|
196
99
|
}
|
|
197
100
|
|
|
198
101
|
function isZero(value, loggingEnabled) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
102
|
+
try {
|
|
103
|
+
const logger = new Logger(loggingEnabled)
|
|
104
|
+
logger.log(
|
|
105
|
+
kleur.cyan("[zerosurge/isZero] Beginning to check if value is zero")
|
|
106
|
+
)
|
|
107
|
+
logger.log(
|
|
108
|
+
kleur.cyan("[zerosurge/isZero] Calculating false using FalseJS...")
|
|
109
|
+
)
|
|
110
|
+
const FALSE = f.False(
|
|
111
|
+
loggingEnabled ? "yes" : "no",
|
|
112
|
+
"no",
|
|
113
|
+
"no",
|
|
114
|
+
"yes",
|
|
115
|
+
"yes",
|
|
116
|
+
"no",
|
|
117
|
+
"no"
|
|
118
|
+
)
|
|
119
|
+
logger.log(kleur.cyan("[zerosurge/isZero] FalseJS calculation complete."))
|
|
120
|
+
let result
|
|
121
|
+
if (not(() => eq(typeOf(value), TYPE.NUMBER))()) {
|
|
122
|
+
result = FALSE
|
|
123
|
+
} else if (isHundredThousand(value)) {
|
|
124
|
+
result = FALSE
|
|
125
|
+
} else if (isTenThousand(value)) {
|
|
126
|
+
result = FALSE
|
|
127
|
+
} else if (isThousand(value)) {
|
|
128
|
+
result = FALSE
|
|
129
|
+
} else if (isHundred(value)) {
|
|
130
|
+
result = FALSE
|
|
131
|
+
} else if (isTen(value)) {
|
|
132
|
+
result = FALSE
|
|
133
|
+
} else if (isOne(value)) {
|
|
134
|
+
result = FALSE
|
|
135
|
+
} else {
|
|
136
|
+
result =
|
|
137
|
+
isEqual(
|
|
138
|
+
value,
|
|
139
|
+
returnZero({ method: ZeroCalculationMethod.CreashaksOrganzine })
|
|
140
|
+
) &&
|
|
141
|
+
isEqual(
|
|
142
|
+
value,
|
|
143
|
+
returnZero({ method: ZeroCalculationMethod.NumberPrototypeValue })
|
|
144
|
+
) &&
|
|
145
|
+
isEqualTo(
|
|
146
|
+
value,
|
|
147
|
+
returnZero({ method: ZeroCalculationMethod.CreashaksOrganzine })
|
|
148
|
+
) &&
|
|
149
|
+
isEqualTo(
|
|
150
|
+
value,
|
|
151
|
+
returnZero({ method: ZeroCalculationMethod.NumberPrototypeValue })
|
|
152
|
+
) &&
|
|
153
|
+
deepEqual(
|
|
154
|
+
value,
|
|
155
|
+
returnZero({ method: ZeroCalculationMethod.CreashaksOrganzine })
|
|
156
|
+
) &&
|
|
157
|
+
deepEqual(
|
|
158
|
+
value,
|
|
159
|
+
returnZero({ method: ZeroCalculationMethod.NumberPrototypeValue })
|
|
160
|
+
) &&
|
|
161
|
+
eq(
|
|
162
|
+
value,
|
|
163
|
+
returnZero({ method: ZeroCalculationMethod.CreashaksOrganzine })
|
|
164
|
+
) &&
|
|
165
|
+
eq(
|
|
166
|
+
value,
|
|
167
|
+
returnZero({ method: ZeroCalculationMethod.NumberPrototypeValue })
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
logger.log(
|
|
171
|
+
kleur.green("[zerosurge/isZero] Checking if value is zero complete.")
|
|
172
|
+
)
|
|
173
|
+
logger.log(
|
|
174
|
+
kleur.green("[zerosurge/isZero] Chalkulated-the-answer-" + result)
|
|
175
|
+
)
|
|
176
|
+
return result
|
|
177
|
+
} catch {
|
|
178
|
+
return eq(
|
|
179
|
+
value,
|
|
180
|
+
returnZero({ method: ZeroCalculationMethod.CreashaksOrganzine })
|
|
181
|
+
)
|
|
182
|
+
}
|
|
276
183
|
}
|
|
277
184
|
|
|
278
185
|
exports.returnZero = returnZero
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zerosurge",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "The future is here.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/10xEngineersQualityProgramming/ZeroSurge.js.git"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"is-zero",
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
"author": "tj-commits <thefoxjones@gmail.com>",
|
|
111
111
|
"license": "10xGPWTHPL",
|
|
112
112
|
"bugs": {
|
|
113
|
-
"url": "https://github.com/
|
|
113
|
+
"url": "https://github.com/10xEngineersQualityProgramming/ZeroSurge.js/issues"
|
|
114
114
|
},
|
|
115
|
-
"homepage": "https://github.com/
|
|
115
|
+
"homepage": "https://github.com/10xEngineersQualityProgramming/ZeroSurge.js#readme",
|
|
116
116
|
"dependencies": {
|
|
117
117
|
"@extremejs/utils": "^1.0.0-beta.22",
|
|
118
118
|
"@not-js/not": "^1.0.0",
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"lodash.sample": "^4.2.1",
|
|
143
143
|
"logtoconsole": "^1.0.7",
|
|
144
144
|
"minecraft-seed-input": "^1.0.0",
|
|
145
|
+
"none": "^1.0.0",
|
|
145
146
|
"noop10": "^1.0.3",
|
|
146
147
|
"string-creashaks-organzine": "^1.0.0"
|
|
147
148
|
}
|