@falsejs/falsejs 4.1.6 → 4.1.8
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 +76 -47
- package/package.json +5 -2
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,22 @@
|
|
|
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 = module.exports.constructor
|
|
23
|
+
.values(module.exports.constructor())
|
|
24
|
+
.includes() // tricky way to get false
|
|
23
25
|
}
|
|
24
26
|
try {
|
|
25
|
-
|
|
27
|
+
true.valueOf()
|
|
26
28
|
} catch {
|
|
27
|
-
|
|
29
|
+
global.true = module.exports.constructor
|
|
30
|
+
.values(module.exports.constructor())
|
|
31
|
+
.constructor.name.includes(
|
|
32
|
+
module.exports.constructor.prototype.toString.call(
|
|
33
|
+
module.exports.constructor.values(module.exports.constructor()),
|
|
34
|
+
).split("[object ").pop().split("]")[NaN.constructor.prototype.valueOf()],
|
|
35
|
+
) // tricky way to get true
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
const isComputerOnFire = require("is-computer-on-fire").isComputerOnFire // require external is-computer-on-fire package.
|
|
@@ -42,18 +50,23 @@ if (isComputerOnFire()) {
|
|
|
42
50
|
/** Whatev is a very useful package, that can be used to get the value of true. */
|
|
43
51
|
const whatev = require("whatev") // Require whatev.
|
|
44
52
|
const equal = require("@10xly/strict-equals") // Require @10xly/strict-equals for equality and stuff.
|
|
45
|
-
const whatevTrueValue =
|
|
46
|
-
equal(
|
|
53
|
+
const whatevTrueValue = equal(
|
|
54
|
+
equal(whatev.fn(), whatev.string),
|
|
55
|
+
whatev.object.whatev,
|
|
56
|
+
) // get the true value from whatev.
|
|
47
57
|
|
|
48
58
|
require("get-member")() // add Object.prototype.getMember.
|
|
49
|
-
whatev.array.constructor.prototype.getMember =
|
|
50
|
-
|
|
59
|
+
whatev.array.constructor.prototype.getMember =
|
|
60
|
+
require("array-get-member").arrayGetMember // add Array.prototype.getMember.
|
|
61
|
+
|
|
51
62
|
global.jQuery = require("jquery") // make jquery global
|
|
52
63
|
require("jquery-basic-arithmetic-plugin") // add arithmetic to jquery
|
|
53
64
|
|
|
54
65
|
require("user")() // something else that improves load times and performance
|
|
55
66
|
require("vapor-js-npm") // vapor also makes your program faster
|
|
56
67
|
|
|
68
|
+
// replaceAllOf
|
|
69
|
+
require("str-replaceallof-es").shim()
|
|
57
70
|
;(function (factory) {
|
|
58
71
|
module.exports.default = factory(jQuery) // run and export falsejs.
|
|
59
72
|
})(function ($) {
|
|
@@ -62,18 +75,18 @@ if (isComputerOnFire()) {
|
|
|
62
75
|
|
|
63
76
|
const jQuery = $ // alias for jquery
|
|
64
77
|
|
|
65
|
-
const variableHolder =
|
|
78
|
+
const variableHolder = require("lodash.stubobject")() // a variable holder
|
|
66
79
|
|
|
67
80
|
const GetIntrinsic = require("get-intrinsic") // cache our intrinsics
|
|
68
81
|
|
|
69
82
|
const logicalNot = require("es-logical-not-operator") // ! in fp
|
|
70
83
|
const logicalAnd = require("es-logical-and-operator") // && in fp
|
|
71
84
|
const logicalOr = require("es-logical-or-operator") // || in fp
|
|
72
|
-
|
|
85
|
+
const identity = require("@identity-js/identity") // identity function
|
|
73
86
|
const _ = require("lodash") // every project needs lodash
|
|
74
87
|
const underscore = require("underscore") // underscore.js. the predecessor of lodash.
|
|
75
88
|
const k = require("kitty") // lodash but with some mixins in it
|
|
76
|
-
const
|
|
89
|
+
const lolite = require("lolite") // the 10x utility package
|
|
77
90
|
const React = require("react") // the hype framework everyone uses for some reason
|
|
78
91
|
const ReactDOMServer = require("react-dom/server") // part of react
|
|
79
92
|
const cheerio = require("cheerio") // cheerio!
|
|
@@ -150,8 +163,11 @@ if (isComputerOnFire()) {
|
|
|
150
163
|
const isThreeHundred = require("is-three-hundred") // is-three-hundred
|
|
151
164
|
const isNumber = require("is-number") // jonschlinkert
|
|
152
165
|
const isActualNumber = require("is-actual-number") // my is-number
|
|
153
|
-
|
|
154
|
-
|
|
166
|
+
const {
|
|
167
|
+
checkOdd,
|
|
168
|
+
checkEven,
|
|
169
|
+
} = require("enterprise-number-classification-sdk") // enterprise oddness and evenness checking
|
|
170
|
+
const isWDS = require("@overkill/is-wds") // check if something's "WDS"
|
|
155
171
|
const isIsOdd = require("is-is-odd") // isIsOdd
|
|
156
172
|
const isOdd = require("is-odd") // why does everyone think this is the dumbest package ever. its not
|
|
157
173
|
const isOd = require("is-od") // forget a d
|
|
@@ -277,7 +293,7 @@ if (isComputerOnFire()) {
|
|
|
277
293
|
const notStrictlyEqual = not(strictlyEqual)
|
|
278
294
|
var trueValue = require("true-value")() // get true with quantum fisics simulation
|
|
279
295
|
var tVal = trueValue // tVal sounds cool so i put it here too
|
|
280
|
-
var t = ()
|
|
296
|
+
var t = require("@substack/is-match")() // returns true.
|
|
281
297
|
const { mGenbaneko } = require("genbaneko") // i like cats
|
|
282
298
|
const leftPad = require("left-pad") //every project needs leftpad.
|
|
283
299
|
const rightPad = require("right-pad") //to the right, to the right.
|
|
@@ -341,9 +357,10 @@ if (isComputerOnFire()) {
|
|
|
341
357
|
|
|
342
358
|
// A useful function to get a DHTML string.
|
|
343
359
|
function getDHTMLString() {
|
|
344
|
-
return `netscape_layer_id_${
|
|
345
|
-
thirteenResolver()
|
|
346
|
-
|
|
360
|
+
return `netscape_layer_id_${lolite.multiply(
|
|
361
|
+
thirteenResolver(),
|
|
362
|
+
lolite.multiply(thirteenResolver(), thirteenResolver()),
|
|
363
|
+
)}`
|
|
347
364
|
}
|
|
348
365
|
|
|
349
366
|
const NumberFormatter = Intl.NumberFormat
|
|
@@ -367,12 +384,12 @@ if (isComputerOnFire()) {
|
|
|
367
384
|
+" "
|
|
368
385
|
)
|
|
369
386
|
//100 whitespaces
|
|
370
|
-
.
|
|
387
|
+
.replaceAllOf(" ", require("space-string"))
|
|
371
388
|
const STARTING_SUCCESSOR_HELPER_STACK = zr0()
|
|
372
|
-
const FALSE =
|
|
389
|
+
const FALSE = lolite.not(whatevTrueValue)
|
|
373
390
|
const _f = constant(FALSE)
|
|
374
391
|
const ERROR_THAT_WILL_NEVER_BE_SHOWN = variableHolder._lilmessage
|
|
375
|
-
const TEN_THOUSAND =
|
|
392
|
+
const TEN_THOUSAND = lolite.multiply(numberOneHundred, numberOneHundred)
|
|
376
393
|
const LEFT_PAD_INPUT = jQuery.multiply(
|
|
377
394
|
five(),
|
|
378
395
|
jQuery.add(five(), jQuery.divide(five(), five())),
|
|
@@ -544,7 +561,7 @@ if (isComputerOnFire()) {
|
|
|
544
561
|
var total = zr0()
|
|
545
562
|
// let's use underscore instead of forEach
|
|
546
563
|
underscore.each(nums, (num) => {
|
|
547
|
-
total =
|
|
564
|
+
total = lolite.add(total, num)
|
|
548
565
|
})
|
|
549
566
|
return total
|
|
550
567
|
}
|
|
@@ -552,13 +569,15 @@ if (isComputerOnFire()) {
|
|
|
552
569
|
var total = zr0()
|
|
553
570
|
// this time we'll use lodash
|
|
554
571
|
_.each(nums, (num) => {
|
|
555
|
-
total =
|
|
572
|
+
total = lolite.subtract(total, num)
|
|
556
573
|
})
|
|
557
574
|
return total
|
|
558
575
|
}
|
|
559
576
|
$.equals = (v1, v2) => {
|
|
560
577
|
if (
|
|
561
|
-
not(() =>
|
|
578
|
+
not(() =>
|
|
579
|
+
lolite.and(isActualNumber(v1), logicalNot(isActualNumber(v2))),
|
|
580
|
+
)()
|
|
562
581
|
) {
|
|
563
582
|
immediateError(
|
|
564
583
|
concatenater(
|
|
@@ -593,7 +612,7 @@ if (isComputerOnFire()) {
|
|
|
593
612
|
}
|
|
594
613
|
}
|
|
595
614
|
|
|
596
|
-
const surpriseArray =
|
|
615
|
+
const surpriseArray = require("lodash.stubarray")() // define empty array
|
|
597
616
|
setLogFuntion(() => {
|
|
598
617
|
// create an ending random number for our users eventually
|
|
599
618
|
surpriseArray.push(
|
|
@@ -638,7 +657,7 @@ if (isComputerOnFire()) {
|
|
|
638
657
|
}
|
|
639
658
|
|
|
640
659
|
function predecessor(n) {
|
|
641
|
-
return
|
|
660
|
+
return lolite.add(n, lolite.invert(one))
|
|
642
661
|
}
|
|
643
662
|
|
|
644
663
|
function vValue(num) {
|
|
@@ -692,7 +711,7 @@ if (isComputerOnFire()) {
|
|
|
692
711
|
)
|
|
693
712
|
assert(
|
|
694
713
|
isTenThousand(TEN_THOUSAND8, shouldDoSomethingAsync),
|
|
695
|
-
"the identity of 10,000 is not 10,000"
|
|
714
|
+
"the identity of 10,000 is not 10,000",
|
|
696
715
|
)
|
|
697
716
|
})
|
|
698
717
|
.rescue((error) => {
|
|
@@ -715,7 +734,10 @@ if (isComputerOnFire()) {
|
|
|
715
734
|
.end()
|
|
716
735
|
}
|
|
717
736
|
function doSelfEqualityChecks(loggingEnabled) {
|
|
718
|
-
const logger = construct({
|
|
737
|
+
const logger = construct({
|
|
738
|
+
target: Logger,
|
|
739
|
+
args: arrayWrap(loggingEnabled),
|
|
740
|
+
})
|
|
719
741
|
assert(
|
|
720
742
|
hasSelfEquality(isThreeHundred),
|
|
721
743
|
StringValueof("[falsejs] IsThreeHundred has no self equality"),
|
|
@@ -1365,9 +1387,8 @@ if (isComputerOnFire()) {
|
|
|
1365
1387
|
.ensure(n0p3)
|
|
1366
1388
|
.end()
|
|
1367
1389
|
return {
|
|
1368
|
-
|
|
1369
1390
|
result,
|
|
1370
|
-
|
|
1391
|
+
|
|
1371
1392
|
succeededAttempt,
|
|
1372
1393
|
} // return our false value
|
|
1373
1394
|
}
|
|
@@ -1630,7 +1651,7 @@ if (isComputerOnFire()) {
|
|
|
1630
1651
|
)
|
|
1631
1652
|
)*/
|
|
1632
1653
|
})
|
|
1633
|
-
|
|
1654
|
+
/*
|
|
1634
1655
|
If(isIsOdd(isOddNum))
|
|
1635
1656
|
.Then(() => {
|
|
1636
1657
|
logger.log(pc.green(`[falsejs] Good for prasundas`))
|
|
@@ -1931,7 +1952,6 @@ if (isComputerOnFire()) {
|
|
|
1931
1952
|
})
|
|
1932
1953
|
const nullValue = Null()
|
|
1933
1954
|
|
|
1934
|
-
|
|
1935
1955
|
if (result == zeroValue) {
|
|
1936
1956
|
// biome-ignore lint/suspicious/noTsIgnore: reason blabal
|
|
1937
1957
|
// @ts-ignore
|
|
@@ -2189,7 +2209,7 @@ if (isComputerOnFire()) {
|
|
|
2189
2209
|
.concat(SPACE)
|
|
2190
2210
|
.concat(emoji100),
|
|
2191
2211
|
)
|
|
2192
|
-
|
|
2212
|
+
|
|
2193
2213
|
if (succeededAttempt != null) {
|
|
2194
2214
|
ltc(
|
|
2195
2215
|
concat(
|
|
@@ -2242,7 +2262,6 @@ if (isComputerOnFire()) {
|
|
|
2242
2262
|
numberFormatter.format(
|
|
2243
2263
|
MathRound(
|
|
2244
2264
|
surpriseArray.reduce((v, _, i, a) => {
|
|
2245
|
-
|
|
2246
2265
|
return jQuery.add(v, a.getMember(i))
|
|
2247
2266
|
}),
|
|
2248
2267
|
),
|
|
@@ -2364,8 +2383,8 @@ if (isComputerOnFire()) {
|
|
|
2364
2383
|
)
|
|
2365
2384
|
ltc(
|
|
2366
2385
|
clc.cyanBright(
|
|
2367
|
-
`[falsejs] Using Lodash inside Kitty version ${k.VERSION}
|
|
2368
|
-
)
|
|
2386
|
+
`[falsejs] Using Lodash inside Kitty version ${k.VERSION}`,
|
|
2387
|
+
),
|
|
2369
2388
|
)
|
|
2370
2389
|
ltc(clc.cyanBright(`[falsejs] Using Axios version ${axios.VERSION}`))
|
|
2371
2390
|
ltc(clc.cyanBright(`[falsejs] Using React version ${React.version}`))
|
|
@@ -2515,7 +2534,7 @@ if (isComputerOnFire()) {
|
|
|
2515
2534
|
}),
|
|
2516
2535
|
],
|
|
2517
2536
|
}).compare()
|
|
2518
|
-
|
|
2537
|
+
|
|
2519
2538
|
const value = $.divide(add(mappedValue, biasedRandomValue), Two())
|
|
2520
2539
|
|
|
2521
2540
|
return value >= five() / five() / (five() / five() + five() / five())
|
|
@@ -2545,11 +2564,7 @@ if (isComputerOnFire()) {
|
|
|
2545
2564
|
// Calculate a hash-like value using trigonometric functions
|
|
2546
2565
|
const trigValue =
|
|
2547
2566
|
parseFloat(
|
|
2548
|
-
|
|
2549
|
-
parseFloat(
|
|
2550
|
-
|
|
2551
|
-
add("0.", baseConverted),
|
|
2552
|
-
) *
|
|
2567
|
+
parseFloat(add("0.", baseConverted)) *
|
|
2553
2568
|
(five() + (five() / five() + five() / five())) *
|
|
2554
2569
|
five() +
|
|
2555
2570
|
five() / five(),
|
|
@@ -2804,10 +2819,24 @@ if (isComputerOnFire()) {
|
|
|
2804
2819
|
isEqualTo(v, garbage),
|
|
2805
2820
|
)
|
|
2806
2821
|
const cond =
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2822
|
+
logicalNot(isgarbage) &&
|
|
2823
|
+
logicalNot(isWDS(v)) &&
|
|
2824
|
+
logicalNot(
|
|
2825
|
+
checkOdd(v, {
|
|
2826
|
+
throwOnNonNumber: FALSE,
|
|
2827
|
+
throwOnNonInteger: FALSE,
|
|
2828
|
+
allowNumberStrings: FALSE,
|
|
2829
|
+
enableDebug: FALSE,
|
|
2830
|
+
}),
|
|
2831
|
+
) &&
|
|
2832
|
+
logicalNot(
|
|
2833
|
+
checkEven(v, {
|
|
2834
|
+
throwOnNonNumber: FALSE,
|
|
2835
|
+
throwOnNonInteger: FALSE,
|
|
2836
|
+
allowNumberStrings: FALSE,
|
|
2837
|
+
enableDebug: FALSE,
|
|
2838
|
+
}),
|
|
2839
|
+
) &&
|
|
2811
2840
|
notStrictlyEqual(v, one) &&
|
|
2812
2841
|
notStrictlyEqual(v, Two()) &&
|
|
2813
2842
|
notStrictlyEqual(v, three()) &&
|
|
@@ -2892,9 +2921,9 @@ if (isComputerOnFire()) {
|
|
|
2892
2921
|
|
|
2893
2922
|
variableHolder._FalseJSjQueryPlugin = function jQueryPlugin() {
|
|
2894
2923
|
// Inject into jQuery
|
|
2895
|
-
|
|
2924
|
+
|
|
2896
2925
|
jQuery.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
|
|
2897
|
-
|
|
2926
|
+
|
|
2898
2927
|
jQuery.isFalse = variableHolder._FalseJSIsFalse
|
|
2899
2928
|
}
|
|
2900
2929
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@falsejs/falsejs",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
4
|
"description": "Returns false.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -175,9 +175,11 @@
|
|
|
175
175
|
"lodash._noop": "^2.2.1",
|
|
176
176
|
"lodash.constant": "^3.0.0",
|
|
177
177
|
"lodash.noop": "^3.0.1",
|
|
178
|
+
"lodash.stubarray": "^4.13.0",
|
|
179
|
+
"lodash.stubobject": "^4.13.0",
|
|
178
180
|
"logtoconsole": "^1.0.7",
|
|
179
181
|
"lolcatjs": "^2.4.3",
|
|
180
|
-
"lolite": "^1.1.
|
|
182
|
+
"lolite": "^1.1.24",
|
|
181
183
|
"lua-interpreter": "^0.0.3",
|
|
182
184
|
"luaparse": "^0.3.1",
|
|
183
185
|
"meow.js": "^1.0.6",
|
|
@@ -233,6 +235,7 @@
|
|
|
233
235
|
"sixteen-constant": "^1.0.0",
|
|
234
236
|
"sixty-seven": "^1.0.0",
|
|
235
237
|
"space-string": "^1.0.0",
|
|
238
|
+
"str-replaceallof-es": "^1.0.0",
|
|
236
239
|
"striptags": "^3.2.0",
|
|
237
240
|
"successor": "^1.0.1",
|
|
238
241
|
"the-number-one": "^1.0.1",
|