@falsejs/falsejs 4.1.6 → 4.1.7
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 -4
- package/cli/cli.js +3 -1
- package/index.js +48 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ import falsejs from "@falsejs/falsejs"
|
|
|
37
37
|
|
|
38
38
|
`falsejs.False` is a function that calculates the boolean value false and returns it. It takes three arguments.
|
|
39
39
|
|
|
40
|
-
```
|
|
40
|
+
```ts
|
|
41
41
|
function False(
|
|
42
42
|
loggingEnabled?: "yes" | "no",
|
|
43
43
|
shouldDoSomethingAsync?: "yes" | "no",
|
|
@@ -108,19 +108,19 @@ console.log(falsejs.isFalse("hi")) // false
|
|
|
108
108
|
|
|
109
109
|
NPM:
|
|
110
110
|
|
|
111
|
-
```
|
|
111
|
+
```bash
|
|
112
112
|
npm install -g @falsejs/falsejs
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
Yarn:
|
|
116
116
|
|
|
117
|
-
```
|
|
117
|
+
```bash
|
|
118
118
|
yarn add -g @falsejs/falsejs
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
PNPM:
|
|
122
122
|
|
|
123
|
-
```
|
|
123
|
+
```bash
|
|
124
124
|
pnpm add -g @falsejs/falsejs
|
|
125
125
|
```
|
|
126
126
|
|
package/cli/cli.js
CHANGED
package/index.js
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
// BELOW IS A CHECK TO DEFINE FALSE AND TRUE GLOBALLY IF THEY DON'T EXISTING TO PREVENT THE WORLD FROM CRASHING.
|
|
19
19
|
try {
|
|
20
|
-
|
|
20
|
+
false.valueOf()
|
|
21
21
|
} catch {
|
|
22
|
-
|
|
22
|
+
global.false = [].includes() // tricky way to get false
|
|
23
23
|
}
|
|
24
24
|
try {
|
|
25
|
-
|
|
25
|
+
true.valueOf()
|
|
26
26
|
} catch {
|
|
27
|
-
|
|
27
|
+
global.true = [].constructor.name.includes("Array") // tricky way to get true
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const isComputerOnFire = require("is-computer-on-fire").isComputerOnFire // require external is-computer-on-fire package.
|
|
@@ -42,12 +42,15 @@ if (isComputerOnFire()) {
|
|
|
42
42
|
/** Whatev is a very useful package, that can be used to get the value of true. */
|
|
43
43
|
const whatev = require("whatev") // Require whatev.
|
|
44
44
|
const equal = require("@10xly/strict-equals") // Require @10xly/strict-equals for equality and stuff.
|
|
45
|
-
const whatevTrueValue =
|
|
46
|
-
equal(
|
|
45
|
+
const whatevTrueValue = equal(
|
|
46
|
+
equal(whatev.fn(), whatev.string),
|
|
47
|
+
whatev.object.whatev,
|
|
48
|
+
) // get the true value from whatev.
|
|
47
49
|
|
|
48
50
|
require("get-member")() // add Object.prototype.getMember.
|
|
49
|
-
whatev.array.constructor.prototype.getMember =
|
|
50
|
-
|
|
51
|
+
whatev.array.constructor.prototype.getMember =
|
|
52
|
+
require("array-get-member").arrayGetMember // add Array.prototype.getMember.
|
|
53
|
+
|
|
51
54
|
global.jQuery = require("jquery") // make jquery global
|
|
52
55
|
require("jquery-basic-arithmetic-plugin") // add arithmetic to jquery
|
|
53
56
|
|
|
@@ -69,7 +72,7 @@ if (isComputerOnFire()) {
|
|
|
69
72
|
const logicalNot = require("es-logical-not-operator") // ! in fp
|
|
70
73
|
const logicalAnd = require("es-logical-and-operator") // && in fp
|
|
71
74
|
const logicalOr = require("es-logical-or-operator") // || in fp
|
|
72
|
-
|
|
75
|
+
const identity = require("@identity-js/identity") // identity function
|
|
73
76
|
const _ = require("lodash") // every project needs lodash
|
|
74
77
|
const underscore = require("underscore") // underscore.js. the predecessor of lodash.
|
|
75
78
|
const k = require("kitty") // lodash but with some mixins in it
|
|
@@ -150,8 +153,11 @@ if (isComputerOnFire()) {
|
|
|
150
153
|
const isThreeHundred = require("is-three-hundred") // is-three-hundred
|
|
151
154
|
const isNumber = require("is-number") // jonschlinkert
|
|
152
155
|
const isActualNumber = require("is-actual-number") // my is-number
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
const {
|
|
157
|
+
checkOdd,
|
|
158
|
+
checkEven,
|
|
159
|
+
} = require("enterprise-number-classification-sdk") // enterprise oddness and evenness checking
|
|
160
|
+
const isWDS = require("@overkill/is-wds") // check if something's "WDS"
|
|
155
161
|
const isIsOdd = require("is-is-odd") // isIsOdd
|
|
156
162
|
const isOdd = require("is-odd") // why does everyone think this is the dumbest package ever. its not
|
|
157
163
|
const isOd = require("is-od") // forget a d
|
|
@@ -692,7 +698,7 @@ if (isComputerOnFire()) {
|
|
|
692
698
|
)
|
|
693
699
|
assert(
|
|
694
700
|
isTenThousand(TEN_THOUSAND8, shouldDoSomethingAsync),
|
|
695
|
-
"the identity of 10,000 is not 10,000"
|
|
701
|
+
"the identity of 10,000 is not 10,000",
|
|
696
702
|
)
|
|
697
703
|
})
|
|
698
704
|
.rescue((error) => {
|
|
@@ -715,7 +721,10 @@ if (isComputerOnFire()) {
|
|
|
715
721
|
.end()
|
|
716
722
|
}
|
|
717
723
|
function doSelfEqualityChecks(loggingEnabled) {
|
|
718
|
-
const logger = construct({
|
|
724
|
+
const logger = construct({
|
|
725
|
+
target: Logger,
|
|
726
|
+
args: arrayWrap(loggingEnabled),
|
|
727
|
+
})
|
|
719
728
|
assert(
|
|
720
729
|
hasSelfEquality(isThreeHundred),
|
|
721
730
|
StringValueof("[falsejs] IsThreeHundred has no self equality"),
|
|
@@ -1365,9 +1374,8 @@ if (isComputerOnFire()) {
|
|
|
1365
1374
|
.ensure(n0p3)
|
|
1366
1375
|
.end()
|
|
1367
1376
|
return {
|
|
1368
|
-
|
|
1369
1377
|
result,
|
|
1370
|
-
|
|
1378
|
+
|
|
1371
1379
|
succeededAttempt,
|
|
1372
1380
|
} // return our false value
|
|
1373
1381
|
}
|
|
@@ -1630,7 +1638,7 @@ if (isComputerOnFire()) {
|
|
|
1630
1638
|
)
|
|
1631
1639
|
)*/
|
|
1632
1640
|
})
|
|
1633
|
-
|
|
1641
|
+
/*
|
|
1634
1642
|
If(isIsOdd(isOddNum))
|
|
1635
1643
|
.Then(() => {
|
|
1636
1644
|
logger.log(pc.green(`[falsejs] Good for prasundas`))
|
|
@@ -1931,7 +1939,6 @@ if (isComputerOnFire()) {
|
|
|
1931
1939
|
})
|
|
1932
1940
|
const nullValue = Null()
|
|
1933
1941
|
|
|
1934
|
-
|
|
1935
1942
|
if (result == zeroValue) {
|
|
1936
1943
|
// biome-ignore lint/suspicious/noTsIgnore: reason blabal
|
|
1937
1944
|
// @ts-ignore
|
|
@@ -2189,7 +2196,7 @@ if (isComputerOnFire()) {
|
|
|
2189
2196
|
.concat(SPACE)
|
|
2190
2197
|
.concat(emoji100),
|
|
2191
2198
|
)
|
|
2192
|
-
|
|
2199
|
+
|
|
2193
2200
|
if (succeededAttempt != null) {
|
|
2194
2201
|
ltc(
|
|
2195
2202
|
concat(
|
|
@@ -2242,7 +2249,6 @@ if (isComputerOnFire()) {
|
|
|
2242
2249
|
numberFormatter.format(
|
|
2243
2250
|
MathRound(
|
|
2244
2251
|
surpriseArray.reduce((v, _, i, a) => {
|
|
2245
|
-
|
|
2246
2252
|
return jQuery.add(v, a.getMember(i))
|
|
2247
2253
|
}),
|
|
2248
2254
|
),
|
|
@@ -2364,8 +2370,8 @@ if (isComputerOnFire()) {
|
|
|
2364
2370
|
)
|
|
2365
2371
|
ltc(
|
|
2366
2372
|
clc.cyanBright(
|
|
2367
|
-
`[falsejs] Using Lodash inside Kitty version ${k.VERSION}
|
|
2368
|
-
)
|
|
2373
|
+
`[falsejs] Using Lodash inside Kitty version ${k.VERSION}`,
|
|
2374
|
+
),
|
|
2369
2375
|
)
|
|
2370
2376
|
ltc(clc.cyanBright(`[falsejs] Using Axios version ${axios.VERSION}`))
|
|
2371
2377
|
ltc(clc.cyanBright(`[falsejs] Using React version ${React.version}`))
|
|
@@ -2515,7 +2521,7 @@ if (isComputerOnFire()) {
|
|
|
2515
2521
|
}),
|
|
2516
2522
|
],
|
|
2517
2523
|
}).compare()
|
|
2518
|
-
|
|
2524
|
+
|
|
2519
2525
|
const value = $.divide(add(mappedValue, biasedRandomValue), Two())
|
|
2520
2526
|
|
|
2521
2527
|
return value >= five() / five() / (five() / five() + five() / five())
|
|
@@ -2545,9 +2551,7 @@ if (isComputerOnFire()) {
|
|
|
2545
2551
|
// Calculate a hash-like value using trigonometric functions
|
|
2546
2552
|
const trigValue =
|
|
2547
2553
|
parseFloat(
|
|
2548
|
-
|
|
2549
2554
|
parseFloat(
|
|
2550
|
-
|
|
2551
2555
|
add("0.", baseConverted),
|
|
2552
2556
|
) *
|
|
2553
2557
|
(five() + (five() / five() + five() / five())) *
|
|
@@ -2804,10 +2808,24 @@ if (isComputerOnFire()) {
|
|
|
2804
2808
|
isEqualTo(v, garbage),
|
|
2805
2809
|
)
|
|
2806
2810
|
const cond =
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
+
logicalNot(isgarbage) &&
|
|
2812
|
+
logicalNot(isWDS(v)) &&
|
|
2813
|
+
logicalNot(
|
|
2814
|
+
checkOdd(v, {
|
|
2815
|
+
throwOnNonNumber: FALSE,
|
|
2816
|
+
throwOnNonInteger: FALSE,
|
|
2817
|
+
allowNumberStrings: FALSE,
|
|
2818
|
+
enableDebug: FALSE,
|
|
2819
|
+
}),
|
|
2820
|
+
) &&
|
|
2821
|
+
logicalNot(
|
|
2822
|
+
checkEven(v, {
|
|
2823
|
+
throwOnNonNumber: FALSE,
|
|
2824
|
+
throwOnNonInteger: FALSE,
|
|
2825
|
+
allowNumberStrings: FALSE,
|
|
2826
|
+
enableDebug: FALSE,
|
|
2827
|
+
}),
|
|
2828
|
+
) &&
|
|
2811
2829
|
notStrictlyEqual(v, one) &&
|
|
2812
2830
|
notStrictlyEqual(v, Two()) &&
|
|
2813
2831
|
notStrictlyEqual(v, three()) &&
|
|
@@ -2892,9 +2910,9 @@ if (isComputerOnFire()) {
|
|
|
2892
2910
|
|
|
2893
2911
|
variableHolder._FalseJSjQueryPlugin = function jQueryPlugin() {
|
|
2894
2912
|
// Inject into jQuery
|
|
2895
|
-
|
|
2913
|
+
|
|
2896
2914
|
jQuery.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
|
|
2897
|
-
|
|
2915
|
+
|
|
2898
2916
|
jQuery.isFalse = variableHolder._FalseJSIsFalse
|
|
2899
2917
|
}
|
|
2900
2918
|
|