@falsejs/falsejs 4.1.11 → 4.1.13
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/.github/workflows/lint.yml +20 -0
- package/aprilFoolsCalculateFalse.js +2 -7
- package/eslint.config.mjs +17 -0
- package/index.js +853 -246
- package/package.json +409 -408
- package/biome.json +0 -58
- package/packages-to-remove.txt +0 -0
package/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright 10x'ly Made and other contributors <https://github.com/10xly>
|
|
4
4
|
* Released under EGPSL10X-1.0 <https://github.com/10xly/licence>
|
|
5
5
|
* made with HEAVY BLACK HEART U+2764
|
|
6
|
-
* Thanks to Biome for being a good formatter + linter
|
|
7
6
|
*/
|
|
8
7
|
/**
|
|
9
8
|
*
|
|
@@ -41,80 +40,107 @@
|
|
|
41
40
|
|
|
42
41
|
--------------------------------------------------------------------------------*/
|
|
43
42
|
|
|
43
|
+
/* eslint-disable max-classes-per-file, max-lines */
|
|
44
|
+
|
|
44
45
|
// BELOW IS A CHECK TO DEFINE FALSE AND TRUE GLOBALLY IF THEY DON'T EXISTING TO PREVENT THE WORLD FROM CRASHING.
|
|
45
46
|
try {
|
|
47
|
+
// eslint-disable-next-line 10x-engineering/no-valueof, 10x-engineering/no-booleans
|
|
46
48
|
false.valueOf()
|
|
47
49
|
} catch {
|
|
50
|
+
// Tricky way to get false
|
|
51
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
48
52
|
global.false = module.exports.constructor
|
|
49
53
|
.values(module.exports.constructor())
|
|
50
|
-
.includes()
|
|
54
|
+
.includes()
|
|
51
55
|
}
|
|
52
56
|
try {
|
|
57
|
+
// eslint-disable-next-line 10x-engineering/no-valueof, 10x-engineering/no-booleans
|
|
53
58
|
true.valueOf()
|
|
54
59
|
} catch {
|
|
60
|
+
// Tricky way to get true
|
|
61
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
55
62
|
global.true = module.exports.constructor
|
|
56
63
|
.values(module.exports.constructor())
|
|
57
64
|
.constructor.name.includes(
|
|
65
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
58
66
|
module.exports.constructor.prototype.toString
|
|
59
67
|
.call(module.exports.constructor.values(module.exports.constructor()))
|
|
60
68
|
.split("[object ")
|
|
61
69
|
.pop()
|
|
70
|
+
// eslint-disable-next-line 10x-engineering/no-valueof, unicorn/prefer-number-properties
|
|
62
71
|
.split("]")[NaN.constructor.prototype.valueOf()],
|
|
63
|
-
)
|
|
72
|
+
)
|
|
64
73
|
}
|
|
65
74
|
|
|
66
|
-
|
|
75
|
+
// Require external is-computer-on-fire package.
|
|
76
|
+
const { isComputerOnFire } = require("is-computer-on-fire")
|
|
67
77
|
|
|
68
78
|
if (isComputerOnFire()) {
|
|
69
|
-
//
|
|
79
|
+
// Check if the computer is on fire
|
|
70
80
|
/** An exaggeration of an error that is thrown if the computer is on fire. This NPM package is NOT pointless, and it's NOT a joke. */
|
|
71
81
|
require("immediate-error")(
|
|
72
82
|
"OH MY GOSH YOUR COMPUTER IS ON FIRE WHY ARE YOU WASTING TIME USING A JOKE POINTLESS NPM PACKAGE GET YOUR FIRE EXTINGUISHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
|
|
73
83
|
)
|
|
74
84
|
} else {
|
|
85
|
+
/* eslint-disable capitalized-comments, no-inline-comments */
|
|
86
|
+
|
|
75
87
|
require("none")() // improve load times and performance
|
|
76
88
|
require("-") // also improve load times and perormance
|
|
77
89
|
|
|
90
|
+
/* eslint-enable capitalized-comments */
|
|
91
|
+
|
|
78
92
|
/** Whatev is a very useful package, that can be used to get the value of true. */
|
|
79
93
|
const whatev = require("whatev") // Require whatev.
|
|
80
|
-
const equal = require("@10xly/strict-equals") // Require @10xly/strict-equals for equality and stuff.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
const equal = require("@10xly/strict-equals"), // Require @10xly/strict-equals for equality and stuff.
|
|
95
|
+
whatevTrueValue = equal(
|
|
96
|
+
equal(whatev.fn(), whatev.string),
|
|
97
|
+
whatev.object.whatev,
|
|
98
|
+
) // Get the true value from whatev.
|
|
85
99
|
|
|
86
|
-
require("get-member")() //
|
|
100
|
+
require("get-member")() // Add Object.prototype.getMember.
|
|
87
101
|
whatev.array.constructor.prototype.getMember =
|
|
88
|
-
require("array-get-member").arrayGetMember //
|
|
102
|
+
require("array-get-member").arrayGetMember // Add Array.prototype.getMember.
|
|
89
103
|
|
|
90
|
-
|
|
91
|
-
require("jquery
|
|
104
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
105
|
+
global.jQuery = require("jquery") // Make jQuery global
|
|
106
|
+
require("jquery-basic-arithmetic-plugin") // Add arithmetic to jQuery
|
|
92
107
|
|
|
93
|
-
require("user")() //
|
|
94
|
-
require("vapor-js-npm") //
|
|
108
|
+
require("user")() // Smoething else that improves load times and performance
|
|
109
|
+
require("vapor-js-npm") // Vapor also makes your program faster
|
|
95
110
|
|
|
96
|
-
|
|
111
|
+
/* eslint-enable no-inline-comments */
|
|
112
|
+
|
|
113
|
+
// String.prototype.replaceAllOf
|
|
97
114
|
require("str-replaceallof-es").shim()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
//
|
|
115
|
+
// eslint-disable-next-line 10x-engineering/no-semicolons
|
|
116
|
+
;(function exporter(factory) {
|
|
117
|
+
// Run and export FalseJS.
|
|
118
|
+
// eslint-disable-next-line no-undef
|
|
119
|
+
module.exports.default = factory(jQuery)
|
|
120
|
+
// eslint-disable-next-line max-lines-per-function, max-statements, prefer-arrow-callback, id-length
|
|
121
|
+
})(function factory($) {
|
|
122
|
+
// Sometimes strict mode is more professional, which is why we are putting it there.
|
|
123
|
+
// eslint-disable-next-line 10x-engineering/no-strict-mode
|
|
102
124
|
"use strict"
|
|
103
125
|
|
|
104
|
-
|
|
126
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations, capitalized-comments, no-inline-comments
|
|
127
|
+
const jQuery = $ // this should NOT be called indexQuery, prevent-abbreviations!!!!
|
|
105
128
|
|
|
106
|
-
|
|
129
|
+
/* eslint-disable no-inline-comments, capitalized-comments, one-var */
|
|
107
130
|
|
|
131
|
+
const variableHolder = require("lodash.stubobject")() // a variable holder
|
|
108
132
|
const GetIntrinsic = require("get-intrinsic") // cache our intrinsics
|
|
109
|
-
|
|
110
133
|
const typeOf = require("es-typeof") // import module for type checking
|
|
111
134
|
const logicalNot = require("es-logical-not-operator") // ! in fp
|
|
112
135
|
const logicalAnd = require("es-logical-and-operator"), // && in fp
|
|
136
|
+
// eslint-disable-next-line sort-vars
|
|
113
137
|
and = logicalAnd // alias
|
|
114
138
|
const logicalOr = require("es-logical-or-operator") // || in fp
|
|
115
139
|
const identity = require("@identity-js/identity") // identity function
|
|
140
|
+
// eslint-disable-next-line id-length
|
|
116
141
|
const _ = require("lodash") // every project needs lodash
|
|
117
142
|
const underscore = require("underscore") // underscore.js. the predecessor of lodash.
|
|
143
|
+
// eslint-disable-next-line id-length
|
|
118
144
|
const k = require("kitty") // lodash but with some mixins in it
|
|
119
145
|
const lolite = require("lolite") // the 10x utility package
|
|
120
146
|
const React = require("react") // the hype framework everyone uses for some reason
|
|
@@ -123,8 +149,10 @@ if (isComputerOnFire()) {
|
|
|
123
149
|
const { JSDOM } = require("jsdom") // a fake dom
|
|
124
150
|
const striptags = require("striptags") // strip tags!
|
|
125
151
|
const chalk = require("chalk4096").default // color is the best! especially when its 10x!
|
|
152
|
+
// eslint-disable-next-line no-var
|
|
126
153
|
var clc = require("cli-color") // another color module
|
|
127
154
|
const colors = require("@colors/colors/safe") // colors
|
|
155
|
+
// eslint-disable-next-line id-length
|
|
128
156
|
const c = require("ansi-colors") // nothing wrong with even more colors
|
|
129
157
|
const pc = require("picocolors") // maybe even more colors libraries
|
|
130
158
|
const axios = require("axios") // so we can send requests
|
|
@@ -139,7 +167,7 @@ if (isComputerOnFire()) {
|
|
|
139
167
|
const noop8 = require("noop8") //another...
|
|
140
168
|
const noop9 = require("noop9") // the ninth
|
|
141
169
|
const noop10 = require("noop10") // 10x with noops lezz go
|
|
142
|
-
const {
|
|
170
|
+
const { doop, noop } = require("yanoop") // yanoop.
|
|
143
171
|
const asyncUtilNoop = require("async.util.noop") // i think you see where i'm going
|
|
144
172
|
const blankSpaceFullObject = require("blank-space") // this exports two noops
|
|
145
173
|
const blankSpaceNoop = blankSpaceFullObject.noop // noop one
|
|
@@ -147,6 +175,7 @@ if (isComputerOnFire()) {
|
|
|
147
175
|
const noopGenerator = require("co-noop") // a noop generator!
|
|
148
176
|
const fjNoop = require("fj-noop").FUNC // fj noop
|
|
149
177
|
const lodashNoop = require("lodash.noop") // lodash noop
|
|
178
|
+
// eslint-disable-next-line camelcase
|
|
150
179
|
const lodash_Noop = require("lodash._noop") // another lodash noop!
|
|
151
180
|
const noOp = require("no-op") // noop with a dash
|
|
152
181
|
const nodeNoop = require("node-noop").noop // a noop
|
|
@@ -182,7 +211,7 @@ if (isComputerOnFire()) {
|
|
|
182
211
|
const isThousand = require("is-thousand").default
|
|
183
212
|
const isTenThousand = require("is-ten-thousand") // 100x the is-hundred
|
|
184
213
|
const isEqTenThousand = require("is-eq-ten-thousand") // is-eq-ten-thousand
|
|
185
|
-
const isTwo = require("is-two")
|
|
214
|
+
const { isTwo } = require("is-two") // the successor of one
|
|
186
215
|
const isThree = require("is-three") // the successor of two
|
|
187
216
|
const isNegativeZero = require("is-negative-zero") // isNegativeZero
|
|
188
217
|
const isNegativeZero2 = require("negative-zero") // can't hurt to have another negative zero checker
|
|
@@ -194,8 +223,8 @@ if (isComputerOnFire()) {
|
|
|
194
223
|
const isNumber = require("is-number") // jonschlinkert
|
|
195
224
|
const isActualNumber = require("is-actual-number") // my is-number
|
|
196
225
|
const {
|
|
197
|
-
checkOdd,
|
|
198
226
|
checkEven,
|
|
227
|
+
checkOdd,
|
|
199
228
|
} = require("enterprise-number-classification-sdk") // enterprise oddness and evenness checking
|
|
200
229
|
const isWDS = require("@overkill/is-wds") // check if something's "WDS"
|
|
201
230
|
const isIsOdd = require("is-is-odd") // isIsOdd
|
|
@@ -231,6 +260,7 @@ if (isComputerOnFire()) {
|
|
|
231
260
|
const lowercase = require("convert-to-lower-case") // CONVERT TO LOWER CASE
|
|
232
261
|
const construct = require("construct-new") // better than the new keyword
|
|
233
262
|
|
|
263
|
+
/* eslint-disable new-cap */
|
|
234
264
|
const $Promise = require("is-a-promise") // shim for promise
|
|
235
265
|
const $Array = GetIntrinsic("%Array%") // arrays
|
|
236
266
|
const $Boolean = GetIntrinsic("%Boolean%") // things that are true or false
|
|
@@ -246,7 +276,9 @@ if (isComputerOnFire()) {
|
|
|
246
276
|
const MathSin = GetIntrinsic("%Math.sin%") // SIN
|
|
247
277
|
const MathCos = GetIntrinsic("%Math.cos%") // COS
|
|
248
278
|
const StringCharAt = GetIntrinsic("%String.prototype.charAt%") // get chars at and stuff
|
|
279
|
+
/* eslint-enable new-cap */
|
|
249
280
|
|
|
281
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
250
282
|
const _calculateFalseAprilFools = require("./aprilFoolsCalculateFalse") // april fools
|
|
251
283
|
const couldThisCouldItBeTrue = require("@falsejs/is-true-helper") // check if a value is true
|
|
252
284
|
const falseValue = require("false-value") // uses quantum physics simulation to return false
|
|
@@ -266,7 +298,7 @@ if (isComputerOnFire()) {
|
|
|
266
298
|
const isTuesday = require("is-tuesday") // day of the week 2 according to international standard, day of the week 3 according to the us
|
|
267
299
|
const isWednesday = () =>
|
|
268
300
|
require("is-wednesday")(construct({ target: $Date })) // day of the week 3 according to the international standard, day of the week 4 according to the us
|
|
269
|
-
//
|
|
301
|
+
// Now we gotta sing rebecca black's song
|
|
270
302
|
const isThursday = require("is-thursday") /// Yesterday was thursdayyyy
|
|
271
303
|
const isFriday = require("is-friday") // tooo-ddadayy is friday! we so ecited
|
|
272
304
|
const isSaturday = require("is-saturday") // tomorrow will be saturday
|
|
@@ -276,6 +308,7 @@ if (isComputerOnFire()) {
|
|
|
276
308
|
const {
|
|
277
309
|
returnZero: returnZero_,
|
|
278
310
|
ZeroCalculationMethod,
|
|
311
|
+
// eslint-disable-next-line perfectionist/sort-objects
|
|
279
312
|
isZero: zerosurgeIsZero,
|
|
280
313
|
} = require("zerosurge") // get the number zero, but 10x'er
|
|
281
314
|
const returnZero = returnZero_ // type returnZero
|
|
@@ -315,6 +348,7 @@ if (isComputerOnFire()) {
|
|
|
315
348
|
const tru = require("tru") // if statements arent verbose enough
|
|
316
349
|
const If = require("if") // always good to have another if statement!
|
|
317
350
|
const not = require("@not-js/not") // safer negation with not
|
|
351
|
+
// eslint-disable-next-line perfectionist/sort-objects
|
|
318
352
|
const { functions, _return } = require("returndotjs/safe") // better returning
|
|
319
353
|
const vretriever = require("vretriever") // a identity function
|
|
320
354
|
const immo = require("@_immo/return") // also a identity function, but a weird one
|
|
@@ -322,9 +356,11 @@ if (isComputerOnFire()) {
|
|
|
322
356
|
const isEqual = require("is-equal") // more complex ways too.
|
|
323
357
|
const strictlyEqual = require("@10xly/strict-equals") // and strict equality.
|
|
324
358
|
const notStrictlyEqual = not(strictlyEqual)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
359
|
+
const trueValue = require("true-value")() // get true with quantum fisics simulation
|
|
360
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
361
|
+
const tVal = trueValue // tVal sounds cool so i put it here too
|
|
362
|
+
// eslint-disable-next-line id-length
|
|
363
|
+
const t = require("@substack/is-match")() // returns true.
|
|
328
364
|
const { mGenbaneko } = require("genbaneko") // i like cats
|
|
329
365
|
const leftPad = require("left-pad") //every project needs leftpad.
|
|
330
366
|
const rightPad = require("right-pad") //to the right, to the right.
|
|
@@ -339,13 +375,15 @@ if (isComputerOnFire()) {
|
|
|
339
375
|
const isWindows = isWindwos // i totally didnt misspell the above variable and this line doesnt exist
|
|
340
376
|
const isLinux = require("is-linux") // linux the os
|
|
341
377
|
const isOSX = require("is-osx") // more like is darwin
|
|
378
|
+
// eslint-disable-next-line no-warning-comments, sonarjs/todo-tag
|
|
342
379
|
// TODO: Implement is Windows 12
|
|
343
|
-
const isFreeBSD = require("is-freebsd")
|
|
380
|
+
const { isFreeBSD } = require("is-freebsd") // i've never even heard of this operating system until now.
|
|
344
381
|
const thirteen = require("thirteen") // multiply by thirteen
|
|
345
382
|
const os = require("node:os") // maybe node js itself can help us calculate more operating systems
|
|
346
383
|
const crypto = require("node:crypto") // mine me some crypto
|
|
347
384
|
const fs = require("node:fs") // write our files
|
|
348
|
-
|
|
385
|
+
// eslint-disable-next-line unicorn/import-style
|
|
386
|
+
const util = require("node:util") // utility functions built in to node.js
|
|
349
387
|
const { spawn } = require("node:child_process") // spawn child processes
|
|
350
388
|
const uuid = require("uuid") // generate some uuids
|
|
351
389
|
const getStringLength = require("utf8-byte-length") // get string length
|
|
@@ -361,26 +399,28 @@ if (isComputerOnFire()) {
|
|
|
361
399
|
const lodashdotconstant = require("lodash.constant") // lodash's version
|
|
362
400
|
const WeirdInstanceof = require("weird-instanceof") // drunk programming only
|
|
363
401
|
const { log: ltc, setLogFuntion } = require("logtoconsole") // best logger
|
|
402
|
+
// eslint-disable-next-line new-cap
|
|
364
403
|
const weirdLtc = WeirdInstanceof(ltc) // weird
|
|
365
404
|
const yesNo = require("yes-no") // YES NO YES NO YES NO
|
|
366
|
-
//
|
|
405
|
+
// eslint-disable-next-line sonarjs/no-globals-shadowing, no-shadow-restricted-names, no-undefined
|
|
367
406
|
const { undefined } = require("undefined-is-a-function") // UNDEFINED IS A FUNCTON
|
|
368
407
|
const isNull = require("@is-(unknown)/is-null") // IS null
|
|
369
408
|
const isUndefined = require("@is-(unknown)/is-undefined") // IS undefined
|
|
370
409
|
const isNil = require("@is-(unknown)/is-nil") // IS null OR undefined :O
|
|
371
410
|
const isUnnull = require("is-unnull") // IS UNNULL
|
|
372
|
-
//
|
|
411
|
+
// eslint-disable-next-line sonarjs/no-globals-shadowing
|
|
373
412
|
const isNaN = require("is-nan") // IS NAN
|
|
374
413
|
const isNegativeInfinity = require("negative-infinity").check // IS NEGATIVE INFINITY
|
|
375
414
|
const is1 = require("is-eq-one") // is 1
|
|
376
415
|
const is0 = require("is-eq-zero") // is 0
|
|
416
|
+
// eslint-disable-next-line camelcase
|
|
377
417
|
const is0_2 = require("is-zero") // is 0 (x2)
|
|
378
418
|
const isFour = require("is-equal-four") // is 4
|
|
379
419
|
const isFive = require("is-eq-five") // is 5
|
|
380
420
|
const isSix = require("is-eq-six") // is 6
|
|
381
421
|
const isSeven = require("is-eq-seven") // is 7
|
|
382
422
|
const useGarbage = require("garbage") // trash.
|
|
383
|
-
const isuseless = require("is-useless")
|
|
423
|
+
const { isuseless } = require("is-useless") // super useless
|
|
384
424
|
const isAprilFools = require("is-april-fools") // Is it april fools
|
|
385
425
|
const meow = require("meow.js") // library for meowing
|
|
386
426
|
const { ErrorType: ERROR, immediateError } = require("immediate-error") // throw errors
|
|
@@ -391,6 +431,8 @@ if (isComputerOnFire()) {
|
|
|
391
431
|
const globalObj = require("@10xly/global") // the global object
|
|
392
432
|
const stringify = require("json-stringify-safe")
|
|
393
433
|
|
|
434
|
+
/* eslint-enable no-inline-comments, capitalized-comments, one-var */
|
|
435
|
+
|
|
394
436
|
// A useful function to get a DHTML string.
|
|
395
437
|
function getDHTMLString() {
|
|
396
438
|
return `netscape_layer_id_${lolite.multiply(
|
|
@@ -399,9 +441,13 @@ if (isComputerOnFire()) {
|
|
|
399
441
|
)}`
|
|
400
442
|
}
|
|
401
443
|
|
|
444
|
+
/* eslint-disable one-var */
|
|
445
|
+
|
|
402
446
|
const NumberFormatter = Intl.NumberFormat
|
|
403
447
|
const numberFormatter = construct({ target: NumberFormatter })
|
|
404
448
|
|
|
449
|
+
/* eslint-enable one-var */
|
|
450
|
+
|
|
405
451
|
if (globalObj.FalseJSTelemetryOptOut) {
|
|
406
452
|
ltc(chalk.yellow("🛈 FalseJS telemetry opt-out enabled."))
|
|
407
453
|
} else {
|
|
@@ -419,10 +465,12 @@ if (isComputerOnFire()) {
|
|
|
419
465
|
})
|
|
420
466
|
.end()
|
|
421
467
|
|
|
468
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
422
469
|
variableHolder._lilmessage = colors.red(
|
|
423
470
|
`[falsejs] This error should never be shown. If you are seeing this error in the console, please file an issue on the github repo. Thank you.`,
|
|
424
471
|
)
|
|
425
472
|
|
|
473
|
+
/* eslint-disable no-inline-comments, prefer-template, no-implicit-coercion, 10x-engineering/no-operators, one-var */
|
|
426
474
|
const blankSpaces = (
|
|
427
475
|
" " + //100 whitespaces
|
|
428
476
|
" " + //200 Whitespaces
|
|
@@ -430,9 +478,14 @@ if (isComputerOnFire()) {
|
|
|
430
478
|
)
|
|
431
479
|
//100 whitespaces
|
|
432
480
|
.replaceAllOf(" ", require("space-string"))
|
|
481
|
+
|
|
482
|
+
/* eslint-enable no-inline-comments, prefer-template, no-implicit-coercion, 10x-engineering/no-operators */
|
|
483
|
+
|
|
433
484
|
const STARTING_SUCCESSOR_HELPER_STACK = zr0()
|
|
434
485
|
const FALSE = lolite.not(whatevTrueValue)
|
|
486
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
435
487
|
const _f = constant(FALSE)
|
|
488
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
436
489
|
const ERROR_THAT_WILL_NEVER_BE_SHOWN = variableHolder._lilmessage
|
|
437
490
|
const TEN_THOUSAND = lolite.multiply(numberOneHundred, numberOneHundred)
|
|
438
491
|
const LEFT_PAD_INPUT = jQuery.multiply(
|
|
@@ -459,16 +512,19 @@ if (isComputerOnFire()) {
|
|
|
459
512
|
const ZEROPAD_INPUT = jQuery.subtract(five(), jQuery.divide(five(), five()))
|
|
460
513
|
const WEST_PAD_DEVICE_DIRECTION = "N"
|
|
461
514
|
const SPACE = require("space-string")
|
|
515
|
+
// eslint-disable-next-line no-use-before-define
|
|
462
516
|
const NO = getNo()
|
|
463
517
|
const YES = "yes"
|
|
464
518
|
const TODAY = construct({
|
|
465
519
|
target: $Date,
|
|
466
520
|
})
|
|
467
521
|
const Today = TODAY
|
|
468
|
-
const USERNAME = (function () {
|
|
469
|
-
|
|
522
|
+
const USERNAME = (function usernameRetriever() {
|
|
523
|
+
// eslint-disable-next-line no-undefined
|
|
524
|
+
let username = undefined()
|
|
470
525
|
|
|
471
526
|
attempt(() => {
|
|
527
|
+
// eslint-disable-next-line prefer-destructuring
|
|
472
528
|
username = os.userInfo().username
|
|
473
529
|
})
|
|
474
530
|
.rescue(() => {
|
|
@@ -483,35 +539,49 @@ if (isComputerOnFire()) {
|
|
|
483
539
|
const username = USERNAME
|
|
484
540
|
|
|
485
541
|
// Define compatibility_mode enum.
|
|
542
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
486
543
|
const COMPATIBILITY_MODE = {
|
|
487
544
|
NONE: "none",
|
|
545
|
+
// eslint-disable-next-line sort-keys
|
|
488
546
|
IE5: "ie5",
|
|
489
547
|
NETSCAPE: "netscape",
|
|
490
548
|
OPERA_PRESTO: "presto",
|
|
491
549
|
}
|
|
492
550
|
|
|
551
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
552
|
+
|
|
493
553
|
const COMPATIBILITY_MODES = COMPATIBILITY_MODE
|
|
494
554
|
|
|
555
|
+
/* eslint-enable one-var */
|
|
556
|
+
|
|
495
557
|
class Logger {
|
|
496
558
|
constructor(enableLogging) {
|
|
497
|
-
|
|
559
|
+
// ENABLE THE LOGGING
|
|
560
|
+
this.enableLogging = enableLogging
|
|
498
561
|
}
|
|
499
562
|
log(log) {
|
|
500
563
|
if (isEqualTo(this.enableLogging, t())) {
|
|
501
|
-
|
|
564
|
+
// SO WEIRD
|
|
565
|
+
// eslint-disable-next-line no-unused-expressions, 10x-engineering/no-operators, 10x-engineering/no-instanceof
|
|
566
|
+
identity(log) instanceof weirdLtc
|
|
502
567
|
}
|
|
503
568
|
}
|
|
504
569
|
}
|
|
505
570
|
|
|
506
571
|
const FalseJSValidationFailedToPassError = require("@falsejs/validation-failed-to-pass-error")
|
|
507
572
|
|
|
573
|
+
/* eslint-disable one-var, no-inline-comments */
|
|
574
|
+
|
|
508
575
|
const SuccessorHelper = class {
|
|
576
|
+
// eslint-disable-next-line id-length, class-methods-use-this
|
|
509
577
|
s(value) {
|
|
510
|
-
const result = add(value, one) //
|
|
578
|
+
const result = add(value, one) // Add one to it
|
|
511
579
|
return result
|
|
512
580
|
}
|
|
513
581
|
}
|
|
514
582
|
|
|
583
|
+
/* eslint-enable no-inline-comments */
|
|
584
|
+
|
|
515
585
|
const TernaryCompare = class {
|
|
516
586
|
constructor(condition, ifTrue, ifFalse) {
|
|
517
587
|
this.condition = condition
|
|
@@ -520,7 +590,13 @@ if (isComputerOnFire()) {
|
|
|
520
590
|
}
|
|
521
591
|
|
|
522
592
|
compare() {
|
|
523
|
-
|
|
593
|
+
// eslint-disable-next-line unicorn/prefer-ternary
|
|
594
|
+
if (this.condition) {
|
|
595
|
+
return this.ifTrue
|
|
596
|
+
// eslint-disable-next-line no-else-return
|
|
597
|
+
} else {
|
|
598
|
+
return this.ifFalse
|
|
599
|
+
}
|
|
524
600
|
}
|
|
525
601
|
}
|
|
526
602
|
|
|
@@ -529,9 +605,11 @@ if (isComputerOnFire()) {
|
|
|
529
605
|
this.name = name
|
|
530
606
|
}
|
|
531
607
|
getName() {
|
|
532
|
-
|
|
608
|
+
// Use a static variable for performance
|
|
609
|
+
const { name } = this
|
|
533
610
|
const compare = construct({
|
|
534
611
|
target: TernaryCompare,
|
|
612
|
+
// eslint-disable-next-line perfectionist/sort-objects, new-cap, sort-keys
|
|
535
613
|
args: [not(() => isNil(name))(), name, Null()],
|
|
536
614
|
})
|
|
537
615
|
return compare.compare()
|
|
@@ -545,6 +623,7 @@ if (isComputerOnFire()) {
|
|
|
545
623
|
{ booleanValue },
|
|
546
624
|
construct({
|
|
547
625
|
target: ObjectOrFunctionParemeterName,
|
|
626
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
548
627
|
args: ["booleanValue"],
|
|
549
628
|
}).getName(),
|
|
550
629
|
),
|
|
@@ -562,57 +641,79 @@ if (isComputerOnFire()) {
|
|
|
562
641
|
|
|
563
642
|
const trueComparison = construct({
|
|
564
643
|
target: TernaryCompare,
|
|
644
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
565
645
|
args: [tVal, tVal, not(() => tVal)()],
|
|
566
646
|
})
|
|
647
|
+
// eslint-disable-next-line id-length
|
|
567
648
|
const { s } = construct({ target: SuccessorHelper })
|
|
649
|
+
/* eslint-disable no-inline-comments, capitalized-comments */
|
|
650
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
568
651
|
const clc_ = construct({
|
|
569
652
|
target: CLIColorInstance,
|
|
653
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
570
654
|
args: [useGarbage()],
|
|
571
655
|
}).getInstance() // colors are the best! chalk chalk chalk
|
|
572
656
|
clc = clc_ // setit
|
|
657
|
+
/* eslint-enable no-inline-comments, capitalized-comments */
|
|
573
658
|
const uwuifier = construct({ target: Uwuifier })
|
|
574
659
|
const westPad = construct({
|
|
575
660
|
target: WestPad,
|
|
661
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
576
662
|
args: [WEST_PAD_DEVICE_DIRECTION],
|
|
577
663
|
})
|
|
578
664
|
|
|
579
|
-
|
|
665
|
+
// eslint-disable-next-line camelcase, perfectionist/sort-objects, sort-keys
|
|
666
|
+
const True_Logger = construct({ target: Logger, args: [t()] })
|
|
667
|
+
|
|
668
|
+
/* eslint-disable capitalized-comments */
|
|
580
669
|
|
|
581
670
|
// lets make sure jquery-basic-arithmetic-plugin works
|
|
671
|
+
// eslint-disable-next-line new-cap
|
|
582
672
|
if (not(() => Bro($).doYouEven("add"))()) {
|
|
583
673
|
// uh oh... jquery basic arithmetic plugin didn't work
|
|
674
|
+
// inform our users even if they disabled logging
|
|
675
|
+
// eslint-disable-next-line camelcase
|
|
584
676
|
True_Logger.log(
|
|
585
677
|
colors.red("[falsejs] jquery-basic-arithmetic-plugin is not working"),
|
|
586
|
-
)
|
|
678
|
+
)
|
|
587
679
|
require("jquery-basic-arithmetic-plugin")
|
|
588
680
|
require("jquery-basic-arithmetic-plugin")
|
|
589
681
|
require("jquery-basic-arithmetic-plugin")
|
|
590
682
|
require("jquery-basic-arithmetic-plugin")
|
|
591
683
|
require("jquery-basic-arithmetic-plugin")
|
|
592
684
|
require("jquery-basic-arithmetic-plugin")
|
|
685
|
+
// eslint-disable-next-line no-inline-comments
|
|
593
686
|
require("jquery-basic-arithmetic-plugin") // now it should work
|
|
687
|
+
// eslint-disable-next-line new-cap
|
|
594
688
|
if (not(() => Bro($).doYouEven("add"))()) {
|
|
689
|
+
// inform our users even if they disabled logging
|
|
690
|
+
// eslint-disable-next-line camelcase
|
|
595
691
|
True_Logger.log(
|
|
596
692
|
colors.red(
|
|
597
693
|
"[falsejs] jquery-basic-arithmetic-plugin is still not working",
|
|
598
694
|
),
|
|
599
|
-
)
|
|
695
|
+
)
|
|
696
|
+
// eslint-disable-next-line id-length
|
|
600
697
|
$.add = (...nums) => {
|
|
601
|
-
|
|
698
|
+
let total = zr0()
|
|
602
699
|
// let's use underscore instead of forEach
|
|
700
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
603
701
|
underscore.each(nums, (num) => {
|
|
604
702
|
total = lolite.add(total, num)
|
|
605
703
|
})
|
|
606
704
|
return total
|
|
607
705
|
}
|
|
706
|
+
// eslint-disable-next-line id-length
|
|
608
707
|
$.subtract = (...nums) => {
|
|
609
|
-
|
|
708
|
+
let total = zr0()
|
|
610
709
|
// this time we'll use lodash
|
|
710
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
611
711
|
_.each(nums, (num) => {
|
|
612
712
|
total = lolite.subtract(total, num)
|
|
613
713
|
})
|
|
614
714
|
return total
|
|
615
715
|
}
|
|
716
|
+
// eslint-disable-next-line id-length
|
|
616
717
|
$.equals = (v1, v2) => {
|
|
617
718
|
if (
|
|
618
719
|
not(() =>
|
|
@@ -624,52 +725,71 @@ if (isComputerOnFire()) {
|
|
|
624
725
|
"Both parameters must be numbers! Instead what was passed in was ",
|
|
625
726
|
)
|
|
626
727
|
.append(appendType(v1))
|
|
728
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
627
729
|
.toString()
|
|
730
|
+
// eslint-disable-next-line unicorn/prefer-spread, 10x-engineering/no-tostring
|
|
628
731
|
.concat(concatenater(" or ").append(appendType(v2)).toString()),
|
|
732
|
+
// eslint-disable-next-line no-inline-comments
|
|
629
733
|
) // not the same message as the original but i dont know what it is and am too lazy to look into the source code
|
|
734
|
+
// eslint-disable-next-line no-inline-comments
|
|
630
735
|
return exit(one) // just in case it doesn't exit
|
|
631
736
|
}
|
|
632
737
|
|
|
738
|
+
// eslint-disable-next-line no-inline-comments
|
|
633
739
|
return isEqualTo(v1, v2) /// not usnig $.equals because we are literally redefining that
|
|
634
740
|
}
|
|
741
|
+
// eslint-disable-next-line new-cap
|
|
635
742
|
if (not(() => Bro($).doYouEven("add"))()) {
|
|
743
|
+
// eslint-disable-next-line camelcase
|
|
636
744
|
True_Logger.log(
|
|
637
745
|
colors.red(
|
|
638
746
|
`[falsejs] Either your Node.js is broken, or jQuery is immutable. Something went wrong.`,
|
|
639
747
|
),
|
|
640
748
|
)
|
|
641
749
|
} else {
|
|
750
|
+
// eslint-disable-next-line camelcase
|
|
642
751
|
True_Logger.log(
|
|
643
|
-
pc.
|
|
644
|
-
`[falsejs] jquery-basic-arithmetic-plugin is not working so
|
|
752
|
+
pc.gray(
|
|
753
|
+
`[falsejs] jquery-basic-arithmetic-plugin is not working so FalseJS defined the functions that are injected into jQuery by itself`,
|
|
645
754
|
),
|
|
646
755
|
)
|
|
647
756
|
}
|
|
648
757
|
} else {
|
|
758
|
+
// eslint-disable-next-line camelcase
|
|
649
759
|
True_Logger.log(
|
|
650
760
|
pc.green(`[falsejs] jquery-basic-arithmetic-plugin is now working`),
|
|
651
761
|
)
|
|
652
762
|
}
|
|
653
763
|
}
|
|
654
764
|
|
|
655
|
-
|
|
765
|
+
/* eslint-enable capitalized-comments */
|
|
766
|
+
|
|
767
|
+
// Define empty array
|
|
768
|
+
const surpriseArray = require("lodash.stubarray")()
|
|
656
769
|
setLogFuntion(() => {
|
|
657
|
-
//
|
|
770
|
+
// Create an ending random number for our users eventually
|
|
658
771
|
surpriseArray.push(
|
|
659
772
|
construct({
|
|
660
773
|
target: TernaryCompare,
|
|
774
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
661
775
|
args: [
|
|
662
776
|
isEqualTo(
|
|
777
|
+
// eslint-disable-next-line no-use-before-define
|
|
663
778
|
randomBoolean(
|
|
664
779
|
jQuery.multiply(five(), jQuery.divide(one, ten)),
|
|
780
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
665
781
|
construct({ target: Logger, args: arrayWrap(FALSE) }),
|
|
666
782
|
),
|
|
667
783
|
t(),
|
|
668
784
|
),
|
|
785
|
+
// eslint-disable-next-line new-cap
|
|
669
786
|
jQuery.multiply(MathRandom(), TEN_THOUSAND),
|
|
670
787
|
jQuery.multiply(
|
|
788
|
+
// eslint-disable-next-line new-cap
|
|
671
789
|
MathRandom(),
|
|
790
|
+
// eslint-disable-next-line new-cap
|
|
672
791
|
MathFloor(
|
|
792
|
+
// eslint-disable-next-line new-cap
|
|
673
793
|
jQuery.divide(jQuery.multiply(TEN_THOUSAND, MathRandom()), ten),
|
|
674
794
|
),
|
|
675
795
|
),
|
|
@@ -678,14 +798,19 @@ if (isComputerOnFire()) {
|
|
|
678
798
|
)
|
|
679
799
|
})
|
|
680
800
|
|
|
801
|
+
/* eslint-enable one-var */
|
|
802
|
+
|
|
803
|
+
// eslint-disable-next-line require-await
|
|
681
804
|
async function doSomethingAsync(logger) {
|
|
682
805
|
logger.log(clc.cyan(`[falsejs] Doing something async`))
|
|
683
806
|
return construct({
|
|
684
807
|
target: $Promise,
|
|
808
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
685
809
|
args: [
|
|
686
810
|
(resolve) =>
|
|
687
811
|
setTimeout(
|
|
688
812
|
() => resolve(logger),
|
|
813
|
+
// eslint-disable-next-line new-cap
|
|
689
814
|
$.multiply(numberOneHundred, Two()),
|
|
690
815
|
),
|
|
691
816
|
],
|
|
@@ -696,23 +821,28 @@ if (isComputerOnFire()) {
|
|
|
696
821
|
logger.log(pc.green(`[falsejs] Did something async`))
|
|
697
822
|
}
|
|
698
823
|
|
|
824
|
+
// eslint-disable-next-line id-length
|
|
699
825
|
function predecessor(n) {
|
|
700
826
|
return lolite.add(n, lolite.invert(one))
|
|
701
827
|
}
|
|
702
828
|
|
|
829
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
703
830
|
function vValue(num) {
|
|
704
831
|
return require("vvalue")(num)
|
|
705
832
|
}
|
|
706
833
|
|
|
707
834
|
function sayIt(message) {
|
|
835
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys, id-length, new-cap
|
|
708
836
|
lolcatjs.fromString(cowsay.say({ text: message, r: bool([one, Two()]) }))
|
|
709
837
|
}
|
|
710
838
|
|
|
839
|
+
// eslint-disable-next-line max-lines-per-function, default-param-last
|
|
711
840
|
function isTenThousandTenThousand(shouldDoSomethingAsync = FALSE, logger) {
|
|
841
|
+
/* eslint-disable one-var */
|
|
712
842
|
const TEN_THOUSAND1 = TEN_THOUSAND
|
|
713
843
|
const TEN_THOUSAND2 = $.subtract($.add(TEN_THOUSAND, one), one)
|
|
714
844
|
const TEN_THOUSAND3 = predecessor(s(TEN_THOUSAND))
|
|
715
|
-
const TEN_THOUSAND4 =
|
|
845
|
+
const TEN_THOUSAND4 = require("@resolve-es/valueof")(TEN_THOUSAND)
|
|
716
846
|
const TEN_THOUSAND5 = $.subtract(
|
|
717
847
|
TEN_THOUSAND,
|
|
718
848
|
STARTING_SUCCESSOR_HELPER_STACK,
|
|
@@ -773,13 +903,16 @@ if (isComputerOnFire()) {
|
|
|
773
903
|
.ensure(n0p3)
|
|
774
904
|
.end()
|
|
775
905
|
}
|
|
906
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
776
907
|
function doSelfEqualityChecks(loggingEnabled) {
|
|
777
908
|
const logger = construct({
|
|
778
909
|
target: Logger,
|
|
910
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
779
911
|
args: arrayWrap(loggingEnabled),
|
|
780
912
|
})
|
|
781
913
|
assert(
|
|
782
914
|
hasSelfEquality(isThreeHundred),
|
|
915
|
+
// eslint-disable-next-line no-use-before-define, new-cap
|
|
783
916
|
StringValueof("[falsejs] IsThreeHundred has no self equality"),
|
|
784
917
|
)
|
|
785
918
|
logger.log(
|
|
@@ -788,7 +921,8 @@ if (isComputerOnFire()) {
|
|
|
788
921
|
),
|
|
789
922
|
)
|
|
790
923
|
assert(
|
|
791
|
-
hasNoSelfEquality(
|
|
924
|
+
hasNoSelfEquality(lolite.stubNaN()),
|
|
925
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
792
926
|
StringValueof("[falsejs] NaN-has-self-equality"),
|
|
793
927
|
)
|
|
794
928
|
logger.log(pc.green(`[falsejs] Verified that NaN has no self equality`))
|
|
@@ -796,145 +930,176 @@ if (isComputerOnFire()) {
|
|
|
796
930
|
isNumberOddOrEven(
|
|
797
931
|
returnZero({
|
|
798
932
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
933
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
799
934
|
loggingEnabled,
|
|
800
935
|
}),
|
|
801
936
|
falseValue(),
|
|
802
937
|
),
|
|
938
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
803
939
|
StringValueof("[falsejs] 0 is not odd or even"),
|
|
804
940
|
)
|
|
805
941
|
assert(
|
|
806
942
|
isNumberOddOrEven(
|
|
807
943
|
returnZero({
|
|
808
944
|
method: ZeroCalculationMethod.NumberPrototypeValue,
|
|
945
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
809
946
|
loggingEnabled: falseValue(),
|
|
810
947
|
}),
|
|
811
948
|
FALSE,
|
|
812
949
|
),
|
|
950
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
813
951
|
StringValueof("[falsejs] 0 is not odd or even"),
|
|
814
952
|
)
|
|
815
953
|
logger.log(pc.green(`[falsejs]-Verified-that-0-is-odd-or-even`))
|
|
816
954
|
assert(
|
|
817
955
|
isNumberOddOrEven(one, FALSE),
|
|
956
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
818
957
|
StringValueof("[falsejs] 1 is not odd or even"),
|
|
819
958
|
)
|
|
820
959
|
logger.log(pc.green(`[falsejs]-Verified-that-1-is-odd-or-even`))
|
|
821
960
|
assert(
|
|
961
|
+
// eslint-disable-next-line new-cap
|
|
822
962
|
isNumberOddOrEven(Two(), FALSE),
|
|
963
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
823
964
|
StringValueof("[falsejs] 2 is not odd or even"),
|
|
824
965
|
)
|
|
825
966
|
logger.log(pc.green(`[falsejs]-Verified-that-2-is-odd-or-even`))
|
|
826
967
|
assert(
|
|
827
968
|
isNumberOddOrEven(three(), FALSE),
|
|
969
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
828
970
|
StringValueof("[falsejs] 3 is not odd or even"),
|
|
829
971
|
)
|
|
830
972
|
logger.log(pc.green(`[falsejs]-Verified-that-3-is-odd-or-even`))
|
|
831
973
|
assert(
|
|
832
974
|
isNumberOddOrEven(four(), FALSE),
|
|
975
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
833
976
|
StringValueof("[falsejs] 4 is not odd or even"),
|
|
834
977
|
)
|
|
835
978
|
logger.log(pc.green(`[falsejs]-Verified-that-4-is-odd-or-even`))
|
|
836
979
|
assert(
|
|
837
980
|
isNumberOddOrEven(five(), FALSE),
|
|
981
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
838
982
|
StringValueof("[falsejs] 5 is not odd or even"),
|
|
839
983
|
)
|
|
840
984
|
logger.log(pc.green(`[falsejs]-Verified-that-5-is-odd-or-even`))
|
|
841
985
|
assert(
|
|
842
986
|
isNumberOddOrEven(six(), FALSE),
|
|
987
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
843
988
|
StringValueof("[falsejs] 6 is not odd or even"),
|
|
844
989
|
)
|
|
845
990
|
logger.log(pc.green(`[falsejs]-Verified-that-6-is-odd-or-even`))
|
|
846
991
|
assert(
|
|
847
992
|
isNumberOddOrEven(seven(), FALSE),
|
|
993
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
848
994
|
StringValueof("[falsejs] 7 is not odd or even"),
|
|
849
995
|
)
|
|
850
996
|
logger.log(pc.green(`[falsejs]-Verified-that-7-is-odd-or-even`))
|
|
851
997
|
assert(
|
|
852
998
|
isNumberOddOrEven(eightToolkit.constants.EIGHT, FALSE),
|
|
999
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
853
1000
|
StringValueof("[falsejs] 8 is not odd or even"),
|
|
854
1001
|
)
|
|
855
1002
|
logger.log(pc.green(`[falsejs]-Verified-that-8-is-odd-or-even`))
|
|
856
1003
|
assert(
|
|
857
1004
|
isNumberOddOrEven(ninev9(), FALSE),
|
|
1005
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
858
1006
|
StringValueof("[falsejs] 9 is not odd or even"),
|
|
859
1007
|
)
|
|
860
1008
|
logger.log(pc.green(`[falsejs]-Verified-that-9-is-odd-or-even`))
|
|
861
1009
|
assert(
|
|
862
1010
|
isNumberOddOrEven(ten, FALSE),
|
|
1011
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
863
1012
|
StringValueof("[falsejs] 10 is not odd or even"),
|
|
864
1013
|
)
|
|
865
1014
|
logger.log(pc.green(`[falsejs]-Verified-that-10-is-odd-or-even`))
|
|
866
1015
|
assert(
|
|
867
1016
|
isNumberOddOrEven(eleven(), FALSE),
|
|
1017
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
868
1018
|
StringValueof("[falsejs] 11 is not odd or even"),
|
|
869
1019
|
)
|
|
870
1020
|
logger.log(pc.green(`[falsejs]-Verified-that-11-is-odd-or-even`))
|
|
871
1021
|
assert(
|
|
872
1022
|
isNumberOddOrEven(twelve(), FALSE),
|
|
1023
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
873
1024
|
StringValueof("[falsejs] 12 is not odd or even"),
|
|
874
1025
|
)
|
|
875
1026
|
logger.log(pc.green(`[falsejs]-Verified-that-12-is-odd-or-even`))
|
|
876
1027
|
assert(
|
|
877
1028
|
isNumberOddOrEven(thirteenResolver(), FALSE),
|
|
1029
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
878
1030
|
StringValueof("[falsejs] 13 is not odd or even"),
|
|
879
1031
|
)
|
|
880
1032
|
logger.log(pc.green(`[falsejs]-Verified-that-13-is-odd-or-even`))
|
|
881
1033
|
assert(
|
|
882
1034
|
isNumberOddOrEven(fourteen, FALSE),
|
|
1035
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
883
1036
|
StringValueof("[falsejs] 14 is not odd or even"),
|
|
884
1037
|
)
|
|
885
1038
|
logger.log(pc.green(`[falsejs]-Verified-that-14-is-odd-or-even`))
|
|
886
1039
|
assert(
|
|
887
1040
|
isNumberOddOrEven(fifteen, FALSE),
|
|
1041
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
888
1042
|
StringValueof("[falsejs] 15 is not odd or even"),
|
|
889
1043
|
)
|
|
890
1044
|
logger.log(pc.green(`[falsejs]-Verified-that-15-is-odd-or-even`))
|
|
891
1045
|
assert(
|
|
892
1046
|
isNumberOddOrEven(sixteen, FALSE),
|
|
1047
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
893
1048
|
StringValueof("[falsejs] 16 is not odd or even"),
|
|
894
1049
|
)
|
|
895
1050
|
logger.log(pc.green(`[falsejs]-Verified-that-16-is-odd-or-even`))
|
|
896
1051
|
assert(
|
|
897
1052
|
isNumberOddOrEven(integer17(), FALSE),
|
|
1053
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
898
1054
|
StringValueof("[falsejs] 17 is not odd or even"),
|
|
899
1055
|
)
|
|
900
1056
|
logger.log(pc.green(`[falsejs]-Verified-that-17-is-odd-or-even`))
|
|
901
1057
|
assert(
|
|
1058
|
+
// eslint-disable-next-line new-cap
|
|
902
1059
|
isNumberOddOrEven(Eighteen(), FALSE),
|
|
1060
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
903
1061
|
StringValueof("[falsejs] 18 is not odd or even"),
|
|
904
1062
|
)
|
|
905
1063
|
logger.log(pc.green(`[falsejs]-Verified-that-18-is-odd-or-even`))
|
|
906
1064
|
assert(
|
|
907
1065
|
isNumberOddOrEven(nineteenify(loggingEnabled), FALSE),
|
|
1066
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
908
1067
|
StringValueof("[falsejs] 19 is not odd or even"),
|
|
909
1068
|
)
|
|
910
1069
|
logger.log(pc.green(`[falsejs]-Verified-that-19-is-odd-or-even`))
|
|
911
1070
|
assert(
|
|
912
1071
|
isNumberOddOrEven(numbertwenty(loggingEnabled), FALSE),
|
|
1072
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
913
1073
|
StringValueof("[falsejs] 20 is not odd or even"),
|
|
914
1074
|
)
|
|
915
1075
|
logger.log(pc.green(`[falsejs]-Verified-that-20-is-odd-or-even`))
|
|
916
1076
|
assert(
|
|
917
1077
|
isNumberOddOrEven(always21(), FALSE),
|
|
1078
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
918
1079
|
StringValueof("[falsejs] 21 is not odd or even"),
|
|
919
1080
|
)
|
|
920
1081
|
logger.log(pc.green(`[falsejs]-Verified-that-21-is-odd-or-even`))
|
|
921
1082
|
assert(
|
|
922
1083
|
isNumberOddOrEven(twentytwo, FALSE),
|
|
1084
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
923
1085
|
StringValueof("[falsejs] 22 is not odd or even"),
|
|
924
1086
|
)
|
|
925
1087
|
logger.log(pc.green(`[falsejs]-Verified-that-22-is-odd-or-even`))
|
|
926
1088
|
assert(
|
|
927
1089
|
isNumberOddOrEven(TWENTY_THREE, FALSE),
|
|
1090
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
928
1091
|
StringValueof("[falsejs] 23 is not odd or even"),
|
|
929
1092
|
)
|
|
930
1093
|
logger.log(pc.green(`[falsejs]-Verified-that-23-is-odd-or-even`))
|
|
931
1094
|
assert(
|
|
932
1095
|
isNumberOddOrEven(sixtyseven(), FALSE),
|
|
1096
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
933
1097
|
StringValueof("[falsejs] 67 is not odd or even"),
|
|
934
1098
|
)
|
|
935
1099
|
logger.log(pc.green(`[falsejs]-Verified-that-67-is-odd-or-even`))
|
|
936
1100
|
assert(
|
|
937
1101
|
logicalNot(isNumberOddOrEven(inf.positiveInfinity()), FALSE),
|
|
1102
|
+
// eslint-disable-next-line new-cap, no-use-before-define
|
|
938
1103
|
StringValueof("[falsejs] Infinity is odd or even"),
|
|
939
1104
|
)
|
|
940
1105
|
logger.log(
|
|
@@ -942,9 +1107,10 @@ if (isComputerOnFire()) {
|
|
|
942
1107
|
)
|
|
943
1108
|
}
|
|
944
1109
|
|
|
945
|
-
//
|
|
1110
|
+
// Below the _getFalse function begins!!!
|
|
1111
|
+
// eslint-disable-next-line max-lines-per-function, max-statements, max-params, no-underscore-dangle
|
|
946
1112
|
function _getFalse(random, _randomLetterOrNumber, loggingEnabled, logger) {
|
|
947
|
-
//
|
|
1113
|
+
// Call some noops 4 some reason
|
|
948
1114
|
n0p3()
|
|
949
1115
|
noop()
|
|
950
1116
|
noop2()
|
|
@@ -988,24 +1154,27 @@ if (isComputerOnFire()) {
|
|
|
988
1154
|
_.noop()
|
|
989
1155
|
underscore.noop()
|
|
990
1156
|
k.noop()
|
|
991
|
-
//
|
|
1157
|
+
// Left pad some things for smoe reason
|
|
992
1158
|
leftPad("required", LEFT_PAD_INPUT)
|
|
993
1159
|
rightPad("required", RIGHT_PAD_INPUT)
|
|
994
1160
|
leftpad("required", LEFTPAD_INPUT)
|
|
995
1161
|
rightpad("required", RIGHTPAD_INPUT)
|
|
996
1162
|
zeropad("1000", ZEROPAD_INPUT)
|
|
997
1163
|
pad(PAD_INPUT, "pad")
|
|
1164
|
+
/* eslint-disable capitalized-comments, no-inline-comments */
|
|
998
1165
|
pad("pad", PAD_INPUT) //look at the power of this pad
|
|
999
1166
|
westPad.pad("wow", WEST_PAD_INPUT) // the ultimate pad
|
|
1000
1167
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1168
|
+
// eslint-disable-next-line init-declarations
|
|
1169
|
+
let result // define a result
|
|
1170
|
+
// eslint-disable-next-line init-declarations
|
|
1171
|
+
let succeededAttempt // define an attempt number that succeeded (roman numeral)
|
|
1003
1172
|
logger.log(
|
|
1004
|
-
`${clc.cyanBright(
|
|
1173
|
+
`${clc.cyanBright("[falsejs]")} ${chalk.red("Chalk")}-${chalk.green(
|
|
1005
1174
|
"ulating",
|
|
1006
1175
|
)} ${chalk.yellow("the")} ${chalk.blue("boolean")} ${chalk.magenta(
|
|
1007
|
-
|
|
1008
|
-
)} ${chalk.cyan(
|
|
1176
|
+
"value",
|
|
1177
|
+
)} ${chalk.cyan("false")}`,
|
|
1009
1178
|
)
|
|
1010
1179
|
|
|
1011
1180
|
/// Attempt I
|
|
@@ -1014,35 +1183,44 @@ if (isComputerOnFire()) {
|
|
|
1014
1183
|
clc.yellow(`[falsejs] Beginning Attempt I to get false value...`),
|
|
1015
1184
|
) // inform our users of attempt one
|
|
1016
1185
|
|
|
1186
|
+
/* eslint-enable capitalized-comments, no-inline-comments */
|
|
1187
|
+
|
|
1188
|
+
// This will probably never be false but it's worth a shot:
|
|
1017
1189
|
const pureChance = not($.equals)(
|
|
1018
1190
|
fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn,
|
|
1019
1191
|
$.divide(
|
|
1020
1192
|
$.multiply(
|
|
1193
|
+
// eslint-disable-next-line new-cap
|
|
1021
1194
|
MathRandom(),
|
|
1022
1195
|
fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn,
|
|
1023
1196
|
),
|
|
1197
|
+
// eslint-disable-next-line new-cap
|
|
1024
1198
|
MathRandom(),
|
|
1025
1199
|
),
|
|
1026
|
-
)
|
|
1200
|
+
)
|
|
1027
1201
|
|
|
1028
1202
|
// For semantics and simplicity, we use the attempt statement in our attempt
|
|
1029
1203
|
attempt(() => {
|
|
1204
|
+
// This will trigger our rescue which means it didn't work if it didn't work
|
|
1205
|
+
// Makes SO MUCH SENSE, right???????
|
|
1030
1206
|
assert(
|
|
1207
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1031
1208
|
variableHolder._FalseJSIsFalse(pureChance, loggingEnabled),
|
|
1032
1209
|
ERROR_THAT_WILL_NEVER_BE_SHOWN,
|
|
1033
|
-
)
|
|
1210
|
+
)
|
|
1034
1211
|
})
|
|
1212
|
+
// eslint-disable-next-line max-lines-per-function
|
|
1035
1213
|
.rescue(() => {
|
|
1036
|
-
//
|
|
1214
|
+
// It did not work by pure chance
|
|
1037
1215
|
/// Attempt II
|
|
1038
|
-
//
|
|
1216
|
+
// Inform our users of the bad things
|
|
1039
1217
|
logger.log(
|
|
1040
1218
|
clc.yellow(
|
|
1041
1219
|
`[falsejs] Attempt I failed at getting false value, beginning Attempt II...`,
|
|
1042
1220
|
),
|
|
1043
1221
|
)
|
|
1044
1222
|
if (not(isEqualTo)(pureChance, pureChance)) {
|
|
1045
|
-
//
|
|
1223
|
+
// Something is broken
|
|
1046
1224
|
logger.log(
|
|
1047
1225
|
colors.red(
|
|
1048
1226
|
`[falsejs] Your Node.js may be broken as ${pureChance} is not equal to ${pureChance}`,
|
|
@@ -1050,30 +1228,37 @@ if (isComputerOnFire()) {
|
|
|
1050
1228
|
)
|
|
1051
1229
|
}
|
|
1052
1230
|
|
|
1053
|
-
//
|
|
1231
|
+
// Let's try to calculate false using a random number
|
|
1054
1232
|
const chance = not($.equals)(
|
|
1233
|
+
// eslint-disable-next-line new-cap
|
|
1055
1234
|
MathRound(
|
|
1235
|
+
// eslint-disable-next-line new-cap
|
|
1056
1236
|
jQuery.multiply(MathRandom(), jQuery.multiply(hundred, ten)),
|
|
1057
1237
|
),
|
|
1238
|
+
// eslint-disable-next-line new-cap
|
|
1058
1239
|
MathRound(
|
|
1240
|
+
// eslint-disable-next-line new-cap
|
|
1059
1241
|
jQuery.multiply(MathRandom(), jQuery.multiply(hundred, ten)),
|
|
1060
1242
|
),
|
|
1061
1243
|
)
|
|
1062
1244
|
attempt(() =>
|
|
1063
1245
|
assert(
|
|
1246
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1064
1247
|
variableHolder._FalseJSIsFalse(chance, loggingEnabled),
|
|
1065
1248
|
ERROR_THAT_WILL_NEVER_BE_SHOWN,
|
|
1066
1249
|
),
|
|
1067
1250
|
)
|
|
1251
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
1068
1252
|
.rescue(() => {
|
|
1069
|
-
//
|
|
1253
|
+
// It did not work by chance again
|
|
1070
1254
|
logger.log(
|
|
1071
1255
|
clc.yellow(
|
|
1072
1256
|
`[falsejs] Attempt II failed at getting false value, beginning Attempt III...`,
|
|
1073
1257
|
),
|
|
1074
1258
|
)
|
|
1075
|
-
//
|
|
1259
|
+
// Let's see if our random is any of these key values
|
|
1076
1260
|
if (isOne(random)) {
|
|
1261
|
+
// eslint-disable-next-line new-cap
|
|
1077
1262
|
result = $.equals(random, Two())
|
|
1078
1263
|
logger.log(
|
|
1079
1264
|
pc.green(
|
|
@@ -1122,23 +1307,28 @@ if (isComputerOnFire()) {
|
|
|
1122
1307
|
)
|
|
1123
1308
|
succeededAttempt = "III"
|
|
1124
1309
|
} else {
|
|
1125
|
-
//
|
|
1310
|
+
// Aw its not
|
|
1311
|
+
/// Attempt IV
|
|
1126
1312
|
logger.log(
|
|
1127
1313
|
clc.yellow(
|
|
1128
1314
|
`[falsejs] Attempt III failed at getting false value, beginning Attempt IV...`,
|
|
1129
1315
|
),
|
|
1130
1316
|
)
|
|
1131
1317
|
|
|
1318
|
+
// A random boolean biased towards true, but its still worth a shot.
|
|
1319
|
+
// eslint-disable-next-line no-use-before-define
|
|
1132
1320
|
const zeropointninebool = randomBoolean(
|
|
1133
1321
|
jQuery.subtract(one, jQuery.divide(one, ten)),
|
|
1134
1322
|
logger,
|
|
1135
|
-
)
|
|
1323
|
+
)
|
|
1136
1324
|
tru(
|
|
1325
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1137
1326
|
variableHolder._FalseJSIsFalse(
|
|
1138
1327
|
zeropointninebool,
|
|
1139
1328
|
loggingEnabled,
|
|
1140
1329
|
),
|
|
1141
1330
|
)
|
|
1331
|
+
// eslint-disable-next-line sonarjs/no-nested-functions
|
|
1142
1332
|
.then(() => {
|
|
1143
1333
|
logger.log(
|
|
1144
1334
|
pc.green(
|
|
@@ -1148,31 +1338,46 @@ if (isComputerOnFire()) {
|
|
|
1148
1338
|
result = zeropointninebool
|
|
1149
1339
|
succeededAttempt = "IV"
|
|
1150
1340
|
})
|
|
1341
|
+
// eslint-disable-next-line sonarjs/no-nested-functions, max-lines-per-function
|
|
1151
1342
|
.otherwise(() => {
|
|
1343
|
+
/// Attempt V
|
|
1152
1344
|
logger.log(
|
|
1153
1345
|
clc.yellow(
|
|
1154
1346
|
`[falsejs] Attempt IV failed at getting false value, beginning Attempt V...`,
|
|
1155
1347
|
),
|
|
1156
1348
|
)
|
|
1349
|
+
/* eslint-disable 10x-engineering/no-operators */
|
|
1350
|
+
// A random boolean a tiny bit less biased towards true, but its still worth a shot.
|
|
1351
|
+
// eslint-disable-next-line no-use-before-define
|
|
1157
1352
|
const zeropointeightfivebool = randomBoolean(
|
|
1353
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
1158
1354
|
(five() - five() / five()) / five() +
|
|
1159
1355
|
five() /
|
|
1356
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
1160
1357
|
(five() * (five() * (five() - five() / five()))) -
|
|
1358
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
1161
1359
|
five() /
|
|
1162
1360
|
five() /
|
|
1163
1361
|
(five() + five()) **
|
|
1164
1362
|
(five() *
|
|
1363
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
1165
1364
|
(five() - five() / five() - five() / five()) +
|
|
1365
|
+
// eslint-disable-next-line sonarjs/no-identical-expressions
|
|
1166
1366
|
five() / five()),
|
|
1167
1367
|
logger,
|
|
1168
|
-
)
|
|
1368
|
+
)
|
|
1369
|
+
|
|
1370
|
+
/* eslint-enable 10x-engineering/no-operators */
|
|
1169
1371
|
|
|
1372
|
+
// eslint-disable-next-line new-cap
|
|
1170
1373
|
If(
|
|
1374
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1171
1375
|
variableHolder._FalseJSIsFalse(
|
|
1172
1376
|
zeropointeightfivebool,
|
|
1173
1377
|
loggingEnabled,
|
|
1174
1378
|
),
|
|
1175
1379
|
)
|
|
1380
|
+
// eslint-disable-next-line new-cap
|
|
1176
1381
|
.Then(() => {
|
|
1177
1382
|
logger.log(
|
|
1178
1383
|
pc.green(
|
|
@@ -1182,6 +1387,7 @@ if (isComputerOnFire()) {
|
|
|
1182
1387
|
result = zeropointeightfivebool
|
|
1183
1388
|
succeededAttempt = "V"
|
|
1184
1389
|
})
|
|
1390
|
+
// eslint-disable-next-line new-cap, max-lines-per-function
|
|
1185
1391
|
.Else(() => {
|
|
1186
1392
|
logger.log(
|
|
1187
1393
|
clc.yellow(
|
|
@@ -1189,6 +1395,8 @@ if (isComputerOnFire()) {
|
|
|
1189
1395
|
),
|
|
1190
1396
|
)
|
|
1191
1397
|
const zeropointsevennineninenineandsoonbool =
|
|
1398
|
+
// A random boolean a bit more bit less biased towards true, but its still worth a shot.
|
|
1399
|
+
// eslint-disable-next-line no-use-before-define
|
|
1192
1400
|
randomBoolean(
|
|
1193
1401
|
jQuery.subtract(
|
|
1194
1402
|
jQuery.divide(
|
|
@@ -1199,15 +1407,19 @@ if (isComputerOnFire()) {
|
|
|
1199
1407
|
five(),
|
|
1200
1408
|
),
|
|
1201
1409
|
generalConcat(
|
|
1410
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
1202
1411
|
one.toString(),
|
|
1203
1412
|
"e-",
|
|
1413
|
+
// eslint-disable-next-line 10x-engineering/no-tostring, new-cap
|
|
1204
1414
|
Two().toString(),
|
|
1415
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
1205
1416
|
eightToolkit.constants.EIGHT.toString(),
|
|
1206
1417
|
),
|
|
1207
1418
|
),
|
|
1208
1419
|
logger,
|
|
1209
|
-
)
|
|
1420
|
+
)
|
|
1210
1421
|
if (
|
|
1422
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1211
1423
|
variableHolder._FalseJSIsFalse(
|
|
1212
1424
|
zeropointsevennineninenineandsoonbool,
|
|
1213
1425
|
loggingEnabled,
|
|
@@ -1226,9 +1438,12 @@ if (isComputerOnFire()) {
|
|
|
1226
1438
|
`[falsejs] Attempt VI failed at getting false value, beginning Attempt VII...`,
|
|
1227
1439
|
),
|
|
1228
1440
|
)
|
|
1229
|
-
|
|
1441
|
+
// An eeven more complex random boolean
|
|
1442
|
+
// eslint-disable-next-line no-use-before-define
|
|
1443
|
+
const compl = complexBooleanWithBias(logger)
|
|
1230
1444
|
attempt(() =>
|
|
1231
1445
|
assert(
|
|
1446
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1232
1447
|
variableHolder._FalseJSIsFalse(
|
|
1233
1448
|
compl,
|
|
1234
1449
|
loggingEnabled,
|
|
@@ -1236,14 +1451,18 @@ if (isComputerOnFire()) {
|
|
|
1236
1451
|
ERROR_THAT_WILL_NEVER_BE_SHOWN,
|
|
1237
1452
|
),
|
|
1238
1453
|
)
|
|
1454
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
1239
1455
|
.rescue(() => {
|
|
1240
1456
|
logger.log(
|
|
1241
1457
|
clc.yellow(
|
|
1242
1458
|
`[falsejs] Attempt VII failed at getting false value, beginning Attempt VIII...`,
|
|
1243
1459
|
),
|
|
1244
1460
|
)
|
|
1245
|
-
|
|
1461
|
+
// An eeven eeven more complex random boolean
|
|
1462
|
+
// eslint-disable-next-line no-use-before-define, id-length
|
|
1463
|
+
const w = weirdestBoolean(logger)
|
|
1246
1464
|
if (
|
|
1465
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1247
1466
|
variableHolder._FalseJSIsFalse(
|
|
1248
1467
|
w,
|
|
1249
1468
|
loggingEnabled,
|
|
@@ -1262,10 +1481,12 @@ if (isComputerOnFire()) {
|
|
|
1262
1481
|
`[falsejs] Attempt VIII failed at getting false value, beginning Attempt IX...`,
|
|
1263
1482
|
),
|
|
1264
1483
|
)
|
|
1484
|
+
// eslint-disable-next-line id-length
|
|
1265
1485
|
const x =
|
|
1266
|
-
//
|
|
1267
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0 //
|
|
1486
|
+
// eslint-disable-next-line 10x-engineering/no-operators, no-extra-boolean-cast, no-implicit-coercion, no-magic-numbers, 10x-engineering/no-number-literals, no-inline-comments
|
|
1487
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0 // I don't know whether this is false or not let's just hope its false. we're using 0 directly and ! directly because why not?
|
|
1268
1488
|
if (
|
|
1489
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1269
1490
|
variableHolder._FalseJSIsFalse(
|
|
1270
1491
|
x,
|
|
1271
1492
|
loggingEnabled,
|
|
@@ -1278,14 +1499,14 @@ if (isComputerOnFire()) {
|
|
|
1278
1499
|
)
|
|
1279
1500
|
result = x
|
|
1280
1501
|
} else {
|
|
1281
|
-
//
|
|
1502
|
+
// I knew there was one too many exclamation marks.
|
|
1282
1503
|
logger.log(
|
|
1283
1504
|
clc.yellow(
|
|
1284
1505
|
`[falsejs] Attempt IX failed at getting false value, beginning Attempt X, the final attempt...`,
|
|
1285
1506
|
),
|
|
1286
1507
|
)
|
|
1287
1508
|
succeededAttempt = "IX"
|
|
1288
|
-
//
|
|
1509
|
+
// Omg the final attempt
|
|
1289
1510
|
// RANDOM PHONE NUMBER
|
|
1290
1511
|
const randomPhoneNumber =
|
|
1291
1512
|
generatePhoneNumber()
|
|
@@ -1293,37 +1514,42 @@ if (isComputerOnFire()) {
|
|
|
1293
1514
|
".falsejs/phone-number-log.txt",
|
|
1294
1515
|
`${randomPhoneNumber}${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}`,
|
|
1295
1516
|
)
|
|
1296
|
-
|
|
1517
|
+
// 67!!!!!!!!!!!!!1
|
|
1518
|
+
const my = randomPhoneNumber.endsWith("67")
|
|
1297
1519
|
fs.appendFileSync(
|
|
1298
1520
|
".falsejs/phone-number-log.txt",
|
|
1299
1521
|
`${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}final attempt:${my}${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}`,
|
|
1300
1522
|
)
|
|
1301
1523
|
if (
|
|
1524
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1302
1525
|
variableHolder._FalseJSIsFalse(
|
|
1303
1526
|
my,
|
|
1304
1527
|
loggingEnabled,
|
|
1305
1528
|
)
|
|
1306
1529
|
) {
|
|
1530
|
+
// It worked!
|
|
1307
1531
|
logger.log(
|
|
1308
1532
|
pc.green(
|
|
1309
1533
|
`[falsejs] Attempt X (Final attempt) succeeded. False value retrieved successfully`,
|
|
1310
|
-
),
|
|
1534
|
+
),
|
|
1311
1535
|
)
|
|
1312
1536
|
result = my
|
|
1313
|
-
succeededAttempt =
|
|
1314
|
-
"Attempt X (final attempt)"
|
|
1537
|
+
succeededAttempt = "X (final attempt)"
|
|
1315
1538
|
} else {
|
|
1316
1539
|
logger.log(
|
|
1317
1540
|
colors.red(
|
|
1318
|
-
`[falsejs] Final attempt failed. Resorting to Attempt XI, returning the result of the false-value library also by FalseJS
|
|
1541
|
+
`[falsejs] Final attempt failed. Resorting to Attempt XI, returning the result of the false-value library also by FalseJS which is guaranteed to work...`,
|
|
1319
1542
|
),
|
|
1320
1543
|
)
|
|
1321
1544
|
const myNewFalseValue = falseValue()
|
|
1545
|
+
// eslint-disable-next-line new-cap
|
|
1322
1546
|
If(
|
|
1547
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1323
1548
|
variableHolder._FalseJSIsFalse(
|
|
1324
1549
|
myNewFalseValue,
|
|
1325
1550
|
),
|
|
1326
1551
|
)
|
|
1552
|
+
// eslint-disable-next-line new-cap
|
|
1327
1553
|
.Then(() => {
|
|
1328
1554
|
logger.log(
|
|
1329
1555
|
pc.green(
|
|
@@ -1331,13 +1557,13 @@ if (isComputerOnFire()) {
|
|
|
1331
1557
|
),
|
|
1332
1558
|
)
|
|
1333
1559
|
result = myNewFalseValue
|
|
1334
|
-
succeededAttempt =
|
|
1335
|
-
"Attempt XI (quantum physics simulation)"
|
|
1560
|
+
succeededAttempt = "XI (false-value)"
|
|
1336
1561
|
})
|
|
1562
|
+
// eslint-disable-next-line new-cap, max-lines-per-function
|
|
1337
1563
|
.Else(() => {
|
|
1338
1564
|
logger.log(
|
|
1339
1565
|
pc.red(
|
|
1340
|
-
`[falsejs]
|
|
1566
|
+
`[falsejs] WAIT WHAT? false-value failed. please file an issue on it. Resorting to the TRUE FINAL attempt, Attempt XII...`,
|
|
1341
1567
|
),
|
|
1342
1568
|
)
|
|
1343
1569
|
// THE FINAL ATTEMPT IS USING THE _f() FUNCTION, WHICH IS GUARANTEED TO RETURN FALSE
|
|
@@ -1345,23 +1571,25 @@ if (isComputerOnFire()) {
|
|
|
1345
1571
|
const THISHASTOBEFALSE = _f()
|
|
1346
1572
|
attempt(() =>
|
|
1347
1573
|
assert(
|
|
1574
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
1348
1575
|
variableHolder._FalseJSIsFalse(
|
|
1349
1576
|
THISHASTOBEFALSE,
|
|
1350
1577
|
),
|
|
1351
1578
|
),
|
|
1352
1579
|
)
|
|
1353
|
-
.else(
|
|
1580
|
+
.else(() => {
|
|
1354
1581
|
// IT WORKS
|
|
1582
|
+
// Of course, false-value is also guaranteed to return false, so this should be impossible.
|
|
1355
1583
|
logger.log(
|
|
1356
1584
|
pc.green(
|
|
1357
1585
|
`[falsejs] True final attempt succeeded. False value retrieved successfully`,
|
|
1358
|
-
),
|
|
1586
|
+
),
|
|
1359
1587
|
)
|
|
1360
1588
|
result = THISHASTOBEFALSE
|
|
1361
1589
|
succeededAttempt =
|
|
1362
|
-
"
|
|
1590
|
+
"XII (true final attempt)"
|
|
1363
1591
|
})
|
|
1364
|
-
.rescue(
|
|
1592
|
+
.rescue(() => {
|
|
1365
1593
|
// This... is impossible.
|
|
1366
1594
|
// The universe must be falling apart.
|
|
1367
1595
|
// We must return _getFalse again.
|
|
@@ -1370,13 +1598,16 @@ if (isComputerOnFire()) {
|
|
|
1370
1598
|
`[falsejs] True final attempt failed. Starting over from Attempt I.`,
|
|
1371
1599
|
),
|
|
1372
1600
|
)
|
|
1601
|
+
// Will return false
|
|
1373
1602
|
const resultttt = _getFalse(
|
|
1374
1603
|
random,
|
|
1375
1604
|
_randomLetterOrNumber,
|
|
1376
1605
|
loggingEnabled,
|
|
1377
1606
|
logger,
|
|
1378
|
-
)
|
|
1607
|
+
)
|
|
1608
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1379
1609
|
result = resultttt.result
|
|
1610
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1380
1611
|
succeededAttempt =
|
|
1381
1612
|
resultttt.succeededAttempt
|
|
1382
1613
|
})
|
|
@@ -1396,7 +1627,8 @@ if (isComputerOnFire()) {
|
|
|
1396
1627
|
result = compl
|
|
1397
1628
|
succeededAttempt = "VII"
|
|
1398
1629
|
})
|
|
1399
|
-
|
|
1630
|
+
// Ensure we call noop for this
|
|
1631
|
+
.ensure(n0p3)
|
|
1400
1632
|
.end()
|
|
1401
1633
|
}
|
|
1402
1634
|
})
|
|
@@ -1405,7 +1637,7 @@ if (isComputerOnFire()) {
|
|
|
1405
1637
|
}
|
|
1406
1638
|
})
|
|
1407
1639
|
.else(() => {
|
|
1408
|
-
//
|
|
1640
|
+
// It worked!
|
|
1409
1641
|
result = chance
|
|
1410
1642
|
logger.log(
|
|
1411
1643
|
pc.green(
|
|
@@ -1414,8 +1646,10 @@ if (isComputerOnFire()) {
|
|
|
1414
1646
|
)
|
|
1415
1647
|
succeededAttempt = "II"
|
|
1416
1648
|
})
|
|
1649
|
+
// eslint-disable-next-line capitalized-comments, no-inline-comments
|
|
1417
1650
|
.ensure(n0p3) //again ensure noop
|
|
1418
1651
|
|
|
1652
|
+
// eslint-disable-next-line capitalized-comments
|
|
1419
1653
|
// and as always end our thing
|
|
1420
1654
|
.end()
|
|
1421
1655
|
})
|
|
@@ -1430,13 +1664,15 @@ if (isComputerOnFire()) {
|
|
|
1430
1664
|
})
|
|
1431
1665
|
.ensure(n0p3)
|
|
1432
1666
|
.end()
|
|
1667
|
+
// Return our false value
|
|
1433
1668
|
return {
|
|
1434
1669
|
result,
|
|
1435
1670
|
|
|
1436
1671
|
succeededAttempt,
|
|
1437
|
-
}
|
|
1672
|
+
}
|
|
1438
1673
|
}
|
|
1439
1674
|
|
|
1675
|
+
// eslint-disable-next-line max-params, complexity, max-lines-per-function, max-statements, no-underscore-dangle, sonarjs/cognitive-complexity
|
|
1440
1676
|
function _calculateFalse(
|
|
1441
1677
|
random,
|
|
1442
1678
|
loggingEnabled,
|
|
@@ -1446,43 +1682,61 @@ if (isComputerOnFire()) {
|
|
|
1446
1682
|
strictDisableAprilFoolsSideEffectsCheck = trueComparison.compare(),
|
|
1447
1683
|
compatibilityMode = COMPATIBILITY_MODE.NONE,
|
|
1448
1684
|
) {
|
|
1685
|
+
// Create our logger
|
|
1449
1686
|
const logger = construct({
|
|
1450
1687
|
target: Logger,
|
|
1688
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
1451
1689
|
args: [loggingEnabled],
|
|
1452
|
-
})
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1690
|
+
})
|
|
1691
|
+
// Define a result
|
|
1692
|
+
// eslint-disable-next-line init-declarations
|
|
1693
|
+
let result
|
|
1694
|
+
// Define an attempt number that succeeded
|
|
1695
|
+
// eslint-disable-next-line init-declarations
|
|
1696
|
+
let succeededAttempt
|
|
1697
|
+
|
|
1698
|
+
// Make sure ten thousand is ten thousand and vValue works
|
|
1699
|
+
isTenThousandTenThousand(shouldDoSomethingAsyncWithIsTenThousand, logger)
|
|
1700
|
+
// Do more self equality checks
|
|
1701
|
+
doSelfEqualityChecks(loggingEnabled)
|
|
1702
|
+
// Log one
|
|
1458
1703
|
construct({
|
|
1459
1704
|
target: TernaryCompare,
|
|
1705
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
1460
1706
|
args: [loggingEnabled, logOne, blankSpace],
|
|
1461
|
-
}).compare()()
|
|
1707
|
+
}).compare()()
|
|
1462
1708
|
|
|
1463
|
-
if (loggingEnabled)
|
|
1709
|
+
if (loggingEnabled) {
|
|
1710
|
+
// Display mandatory wormhole message /
|
|
1711
|
+
require("wormhole-interconnections")
|
|
1712
|
+
}
|
|
1464
1713
|
logger.log(
|
|
1465
1714
|
c.cyan(
|
|
1466
1715
|
`[falsejs] `.concat(
|
|
1467
1716
|
concat(
|
|
1717
|
+
// eslint-disable-next-line no-use-before-define, new-cap
|
|
1468
1718
|
StringValueof(thirteenResolver()),
|
|
1469
1719
|
SPACE,
|
|
1470
1720
|
"×",
|
|
1471
1721
|
SPACE,
|
|
1722
|
+
// eslint-disable-next-line no-use-before-define, new-cap
|
|
1472
1723
|
StringValueof(Two()),
|
|
1473
1724
|
SPACE,
|
|
1474
1725
|
"=",
|
|
1475
1726
|
SPACE,
|
|
1727
|
+
// eslint-disable-next-line new-cap
|
|
1476
1728
|
thirteen(Two()),
|
|
1477
1729
|
),
|
|
1478
1730
|
),
|
|
1479
1731
|
),
|
|
1480
1732
|
)
|
|
1481
1733
|
|
|
1482
|
-
//
|
|
1734
|
+
// Our users should know some basic info
|
|
1483
1735
|
|
|
1484
|
-
//
|
|
1736
|
+
// The OS
|
|
1737
|
+
// eslint-disable-next-line new-cap
|
|
1485
1738
|
If(isWindows())
|
|
1739
|
+
// eslint-disable-next-line new-cap
|
|
1486
1740
|
.Then(() => {
|
|
1487
1741
|
// Windows
|
|
1488
1742
|
logger.log(
|
|
@@ -1491,16 +1745,22 @@ if (isComputerOnFire()) {
|
|
|
1491
1745
|
),
|
|
1492
1746
|
)
|
|
1493
1747
|
})
|
|
1748
|
+
// eslint-disable-next-line new-cap
|
|
1494
1749
|
.Else()
|
|
1750
|
+
// eslint-disable-next-line new-cap
|
|
1495
1751
|
.If(isLinux())
|
|
1752
|
+
// eslint-disable-next-line new-cap
|
|
1496
1753
|
.Then(() => {
|
|
1497
1754
|
// Linux
|
|
1498
1755
|
logger.log(
|
|
1499
1756
|
clc.cyanBright(`[falsejs] Using Linux as current operating system`),
|
|
1500
1757
|
)
|
|
1501
1758
|
})
|
|
1759
|
+
// eslint-disable-next-line new-cap
|
|
1502
1760
|
.Else()
|
|
1761
|
+
// eslint-disable-next-line new-cap
|
|
1503
1762
|
.If(isOSX())
|
|
1763
|
+
// eslint-disable-next-line new-cap
|
|
1504
1764
|
.Then(() => {
|
|
1505
1765
|
// AppleOS (Darwin)
|
|
1506
1766
|
logger.log(
|
|
@@ -1509,8 +1769,11 @@ if (isComputerOnFire()) {
|
|
|
1509
1769
|
),
|
|
1510
1770
|
)
|
|
1511
1771
|
})
|
|
1772
|
+
// eslint-disable-next-line new-cap
|
|
1512
1773
|
.Else()
|
|
1774
|
+
// eslint-disable-next-line new-cap
|
|
1513
1775
|
.If(isEqualTo(os.platform(), "aix"))
|
|
1776
|
+
// eslint-disable-next-line new-cap
|
|
1514
1777
|
.Then(() => {
|
|
1515
1778
|
// AIX??
|
|
1516
1779
|
logger.log(
|
|
@@ -1519,8 +1782,11 @@ if (isComputerOnFire()) {
|
|
|
1519
1782
|
),
|
|
1520
1783
|
)
|
|
1521
1784
|
})
|
|
1785
|
+
// eslint-disable-next-line new-cap
|
|
1522
1786
|
.Else()
|
|
1787
|
+
// eslint-disable-next-line new-cap
|
|
1523
1788
|
.If(isFreeBSD())
|
|
1789
|
+
// eslint-disable-next-line new-cap
|
|
1524
1790
|
.Then(() => {
|
|
1525
1791
|
// FreeBSD
|
|
1526
1792
|
logger.log(
|
|
@@ -1529,8 +1795,11 @@ if (isComputerOnFire()) {
|
|
|
1529
1795
|
),
|
|
1530
1796
|
)
|
|
1531
1797
|
})
|
|
1798
|
+
// eslint-disable-next-line new-cap
|
|
1532
1799
|
.Else()
|
|
1800
|
+
// eslint-disable-next-line new-cap
|
|
1533
1801
|
.If(isEqualTo(os.platform(), "openbsd"))
|
|
1802
|
+
// eslint-disable-next-line new-cap
|
|
1534
1803
|
.Then(() => {
|
|
1535
1804
|
// OpenBSD
|
|
1536
1805
|
logger.log(
|
|
@@ -1539,8 +1808,11 @@ if (isComputerOnFire()) {
|
|
|
1539
1808
|
),
|
|
1540
1809
|
)
|
|
1541
1810
|
})
|
|
1811
|
+
// eslint-disable-next-line new-cap
|
|
1542
1812
|
.Else()
|
|
1813
|
+
// eslint-disable-next-line new-cap
|
|
1543
1814
|
.If(isEqualTo(os.platform(), "netbsd"))
|
|
1815
|
+
// eslint-disable-next-line new-cap
|
|
1544
1816
|
.Then(() => {
|
|
1545
1817
|
// NetBSD
|
|
1546
1818
|
logger.log(
|
|
@@ -1549,14 +1821,21 @@ if (isComputerOnFire()) {
|
|
|
1549
1821
|
),
|
|
1550
1822
|
)
|
|
1551
1823
|
})
|
|
1824
|
+
// eslint-disable-next-line new-cap
|
|
1552
1825
|
.Else()
|
|
1826
|
+
// eslint-disable-next-line new-cap
|
|
1553
1827
|
.If(isEqualTo(os.platform(), "cygwin"))
|
|
1828
|
+
// eslint-disable-next-line new-cap
|
|
1554
1829
|
.Then(() => {
|
|
1830
|
+
// eslint-disable-next-line capitalized-comments
|
|
1555
1831
|
//cygwin
|
|
1556
1832
|
logger.log(clc.cyanBright(`[falsejs] You are using Cygwin`))
|
|
1557
1833
|
})
|
|
1834
|
+
// eslint-disable-next-line new-cap
|
|
1558
1835
|
.Else()
|
|
1836
|
+
// eslint-disable-next-line new-cap
|
|
1559
1837
|
.If(isEqualTo(os.platform(), "sunos"))
|
|
1838
|
+
// eslint-disable-next-line new-cap
|
|
1560
1839
|
.Then(() => {
|
|
1561
1840
|
// Solaris/SunOS
|
|
1562
1841
|
logger.log(
|
|
@@ -1565,8 +1844,11 @@ if (isComputerOnFire()) {
|
|
|
1565
1844
|
),
|
|
1566
1845
|
)
|
|
1567
1846
|
})
|
|
1847
|
+
// eslint-disable-next-line new-cap
|
|
1568
1848
|
.Else()
|
|
1849
|
+
// eslint-disable-next-line new-cap
|
|
1569
1850
|
.If(isEqualTo(os.platform(), "android"))
|
|
1851
|
+
// eslint-disable-next-line new-cap
|
|
1570
1852
|
.Then(() => {
|
|
1571
1853
|
// Android
|
|
1572
1854
|
logger.log(
|
|
@@ -1575,57 +1857,81 @@ if (isComputerOnFire()) {
|
|
|
1575
1857
|
),
|
|
1576
1858
|
)
|
|
1577
1859
|
})
|
|
1860
|
+
// eslint-disable-next-line new-cap
|
|
1578
1861
|
.Else(() => {
|
|
1579
|
-
logger.log(
|
|
1580
|
-
clc.cyanBright(
|
|
1581
|
-
`[falsejs] Even Node.js itself doesn't know your operating system.`,
|
|
1582
|
-
),
|
|
1583
|
-
)
|
|
1862
|
+
logger.log(clc.cyanBright(`[falsejs] idk your operating system`))
|
|
1584
1863
|
})
|
|
1585
1864
|
/// I'm actually curious what more can we do with process and os?
|
|
1586
|
-
//
|
|
1865
|
+
// Lets find out. hmm process.cpuusage whats that
|
|
1587
1866
|
const usage = process.cpuUsage()
|
|
1588
1867
|
logger.log(
|
|
1589
1868
|
clc.cyanBright(
|
|
1869
|
+
// eslint-disable-next-line no-use-before-define
|
|
1590
1870
|
getValueOfThisStringText(`[falsejs] User CPU Usage: ${usage.user}`),
|
|
1591
1871
|
),
|
|
1592
1872
|
)
|
|
1593
1873
|
logger.log(clc.cyanBright(`[falsejs] System CPU Usage: ${usage.system}`))
|
|
1594
|
-
//
|
|
1595
|
-
if (isJanuary(Today))
|
|
1874
|
+
// Lets calculate days of the week and months and days and years and stuff
|
|
1875
|
+
if (isJanuary(Today)) {
|
|
1596
1876
|
logger.log(clc.cyanBright(`[falsejs] The month is January`))
|
|
1597
|
-
|
|
1877
|
+
}
|
|
1878
|
+
if (isFebruary(Today)) {
|
|
1598
1879
|
logger.log(clc.cyanBright(`[falsejs] The month is February`))
|
|
1599
|
-
|
|
1880
|
+
}
|
|
1881
|
+
if (isMarch(Today)) {
|
|
1600
1882
|
logger.log(clc.cyanBright(`[falsejs] The month is March`))
|
|
1601
|
-
|
|
1883
|
+
}
|
|
1884
|
+
if (isApril(Today)) {
|
|
1602
1885
|
logger.log(clc.cyanBright(`[falsejs] The month is April`))
|
|
1603
|
-
|
|
1604
|
-
if (
|
|
1886
|
+
}
|
|
1887
|
+
if (isMay(Today)) {
|
|
1888
|
+
logger.log(clc.cyanBright(`[falsejs] The month is May`))
|
|
1889
|
+
}
|
|
1890
|
+
if (isJune(Today)) {
|
|
1605
1891
|
logger.log(clc.cyanBright(`[falsejs] The month is June`))
|
|
1606
|
-
|
|
1892
|
+
}
|
|
1893
|
+
if (isJuly(Today)) {
|
|
1607
1894
|
logger.log(clc.cyanBright(`[falsejs] The month is July`))
|
|
1608
|
-
|
|
1895
|
+
}
|
|
1896
|
+
if (isAugust(Today)) {
|
|
1609
1897
|
logger.log(clc.cyanBright(`[falsejs] The month is August`))
|
|
1610
|
-
|
|
1898
|
+
}
|
|
1899
|
+
if (isSeptember(Today)) {
|
|
1611
1900
|
logger.log(clc.cyanBright(`[falsejs] The month is September`))
|
|
1612
|
-
|
|
1901
|
+
}
|
|
1902
|
+
if (isOctober(Today)) {
|
|
1613
1903
|
logger.log(clc.cyanBright(`[falsejs] The month is October`))
|
|
1614
|
-
|
|
1904
|
+
}
|
|
1905
|
+
if (isNovember(Today)) {
|
|
1615
1906
|
logger.log(clc.cyanBright(`[falsejs] The month is November`))
|
|
1616
|
-
|
|
1907
|
+
}
|
|
1908
|
+
if (isDecember(Today)) {
|
|
1617
1909
|
logger.log(clc.cyanBright(`[falsejs] The month is December`))
|
|
1618
|
-
|
|
1619
|
-
if (
|
|
1620
|
-
|
|
1910
|
+
}
|
|
1911
|
+
if (isMonday()) {
|
|
1912
|
+
logger.log(clc.cyanBright(`[falsejs] Today is Monday`))
|
|
1913
|
+
}
|
|
1914
|
+
if (isTuesday()) {
|
|
1915
|
+
logger.log(clc.cyanBright(`[falsejs] Today is Tuesday`))
|
|
1916
|
+
}
|
|
1917
|
+
if (isWednesday()) {
|
|
1621
1918
|
logger.log(clc.cyanBright(`[falsejs] Today is Wednesday`))
|
|
1622
|
-
|
|
1919
|
+
}
|
|
1920
|
+
if (isThursday()) {
|
|
1623
1921
|
logger.log(clc.cyanBright(`[falsejs] Today is Thursday`))
|
|
1624
|
-
|
|
1625
|
-
if (
|
|
1922
|
+
}
|
|
1923
|
+
if (isFriday()) {
|
|
1924
|
+
logger.log(clc.cyanBright(`[falsejs] Today is Friday`))
|
|
1925
|
+
}
|
|
1926
|
+
if (isSaturday()) {
|
|
1626
1927
|
logger.log(clc.cyanBright(`[falsejs] Today is Saturday`))
|
|
1627
|
-
|
|
1628
|
-
if (
|
|
1928
|
+
}
|
|
1929
|
+
if (isSunday()) {
|
|
1930
|
+
logger.log(clc.cyanBright(`[falsejs] Today is Sunday`))
|
|
1931
|
+
}
|
|
1932
|
+
if (isWeekend()) {
|
|
1933
|
+
logger.log(clc.cyanBright(`[falsejs] It's the weekend!`))
|
|
1934
|
+
}
|
|
1629
1935
|
|
|
1630
1936
|
logger.log(
|
|
1631
1937
|
clc.cyanBright(
|
|
@@ -1642,19 +1948,27 @@ if (isComputerOnFire()) {
|
|
|
1642
1948
|
generalConcat(`[falsejs] Random food emoji: `, randomFoodEmoji()),
|
|
1643
1949
|
),
|
|
1644
1950
|
)
|
|
1951
|
+
|
|
1952
|
+
// Display a dolphin fact:
|
|
1953
|
+
|
|
1645
1954
|
construct({
|
|
1646
1955
|
target: TernaryCompare,
|
|
1956
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
1647
1957
|
args: [loggingEnabled, dolphinFact, noop3],
|
|
1648
1958
|
}).compare()()
|
|
1649
1959
|
|
|
1650
|
-
//
|
|
1960
|
+
// Lets do something async
|
|
1651
1961
|
if (shouldDoSomethingAsync) {
|
|
1962
|
+
// eslint-disable-next-line id-length
|
|
1652
1963
|
doSomethingAsync(logger).then((l) => resultOfDoingSomethingAsync(l))
|
|
1653
1964
|
}
|
|
1965
|
+
// eslint-disable-next-line new-cap
|
|
1654
1966
|
If(not(isNumberOddOrEven)(random, FALSE))
|
|
1967
|
+
// eslint-disable-next-line new-cap
|
|
1655
1968
|
.Then(() => {
|
|
1656
1969
|
logger.log(clc.yellow(`[falsejs] Random number is not odd or even`))
|
|
1657
1970
|
})
|
|
1971
|
+
// eslint-disable-next-line new-cap
|
|
1658
1972
|
.Else(() => {
|
|
1659
1973
|
logger.log(
|
|
1660
1974
|
pc.green(
|
|
@@ -1663,29 +1977,41 @@ if (isComputerOnFire()) {
|
|
|
1663
1977
|
)
|
|
1664
1978
|
})
|
|
1665
1979
|
|
|
1666
|
-
//
|
|
1980
|
+
// Is odd checks
|
|
1981
|
+
|
|
1982
|
+
// eslint-disable-next-line new-cap
|
|
1667
1983
|
If(logicalNot(isIsOdd(isOdd)))
|
|
1984
|
+
// eslint-disable-next-line new-cap
|
|
1668
1985
|
.Then(() => {
|
|
1669
1986
|
logger.log(clc.yellow(`[falsejs] isOdd is not isOdd.`))
|
|
1670
1987
|
logger.log(clc.yellow(`[falsejs] That's weird`))
|
|
1671
1988
|
})
|
|
1989
|
+
// eslint-disable-next-line new-cap
|
|
1672
1990
|
.Else(n0p3)
|
|
1673
1991
|
|
|
1992
|
+
// eslint-disable-next-line new-cap
|
|
1674
1993
|
If(isIsOdd(isOddAndrew))
|
|
1994
|
+
// eslint-disable-next-line new-cap
|
|
1675
1995
|
.Then(() => {
|
|
1676
1996
|
logger.log(pc.green(`[falsejs] Good for Andrew`))
|
|
1677
1997
|
})
|
|
1998
|
+
// eslint-disable-next-line new-cap
|
|
1678
1999
|
.Else(noop6)
|
|
1679
2000
|
|
|
2001
|
+
// eslint-disable-next-line new-cap
|
|
1680
2002
|
If(isIsOdd(isOd))
|
|
2003
|
+
// eslint-disable-next-line new-cap
|
|
1681
2004
|
.Then(() => {
|
|
1682
2005
|
logger.log(
|
|
1683
2006
|
pc.green(
|
|
1684
2007
|
`[falsejs] Good for Monishadhanasekar (how do you pronounce that) (but bad for me because then it will throw an error if the input is not a numbr HELP)`,
|
|
1685
2008
|
),
|
|
2009
|
+
// eslint-disable-next-line no-inline-comments, no-warning-comments, sonarjs/todo-tag
|
|
1686
2010
|
) // TODO: Add pronunciaton
|
|
1687
2011
|
})
|
|
2012
|
+
// eslint-disable-next-line new-cap
|
|
1688
2013
|
.Else(() => {
|
|
2014
|
+
// eslint-disable-next-line capitalized-comments
|
|
1689
2015
|
/*
|
|
1690
2016
|
logger.log(
|
|
1691
2017
|
getValueOfThisStringText(
|
|
@@ -1703,31 +2029,45 @@ if (isComputerOnFire()) {
|
|
|
1703
2029
|
.Else(noop4())
|
|
1704
2030
|
// sadly commentd out because is-odd-num is vulnerable.
|
|
1705
2031
|
*/
|
|
2032
|
+
// eslint-disable-next-line new-cap
|
|
1706
2033
|
If(isIsOdd(isIntegerOdd))
|
|
2034
|
+
// eslint-disable-next-line new-cap
|
|
1707
2035
|
.Then(() => {
|
|
1708
2036
|
logger.log(pc.green(`[falsejs] Good for hoanduy1710`))
|
|
1709
2037
|
})
|
|
2038
|
+
// eslint-disable-next-line new-cap
|
|
1710
2039
|
.Else(noop2)
|
|
1711
2040
|
|
|
2041
|
+
// eslint-disable-next-line new-cap
|
|
1712
2042
|
If(isIsOdd(noteven))
|
|
2043
|
+
// eslint-disable-next-line new-cap
|
|
1713
2044
|
.Then(() => {
|
|
1714
2045
|
logger.log(pc.green(`[falsejs] Good for DeaSTL`))
|
|
1715
2046
|
})
|
|
2047
|
+
// eslint-disable-next-line new-cap
|
|
1716
2048
|
.Else(noop3)
|
|
1717
2049
|
|
|
2050
|
+
// eslint-disable-next-line new-cap
|
|
1718
2051
|
If(isIsOdd(isUneven))
|
|
2052
|
+
// eslint-disable-next-line new-cap
|
|
1719
2053
|
.Then(() => {
|
|
1720
2054
|
logger.log(pc.green(`[falsejs] Good for Robin`))
|
|
1721
2055
|
})
|
|
2056
|
+
// eslint-disable-next-line new-cap
|
|
1722
2057
|
.Else(noop7)
|
|
1723
2058
|
|
|
2059
|
+
// eslint-disable-next-line new-cap
|
|
1724
2060
|
If(isIsOdd(numberKind.odd))
|
|
2061
|
+
// eslint-disable-next-line new-cap
|
|
1725
2062
|
.Then(() => {
|
|
1726
2063
|
logger.log(pc.green(`[falsejs] Good for goten`))
|
|
1727
2064
|
})
|
|
2065
|
+
// eslint-disable-next-line new-cap
|
|
1728
2066
|
.Else(noop8)
|
|
1729
2067
|
|
|
2068
|
+
// eslint-disable-next-line new-cap
|
|
1730
2069
|
If(isIsOdd(isOddFaster))
|
|
2070
|
+
// eslint-disable-next-line new-cap
|
|
1731
2071
|
.Then(() => {
|
|
1732
2072
|
logger.log(
|
|
1733
2073
|
pc.green(
|
|
@@ -1735,68 +2075,94 @@ if (isComputerOnFire()) {
|
|
|
1735
2075
|
),
|
|
1736
2076
|
)
|
|
1737
2077
|
})
|
|
2078
|
+
// eslint-disable-next-line new-cap
|
|
1738
2079
|
.Else(noop9)
|
|
1739
2080
|
|
|
2081
|
+
// eslint-disable-next-line new-cap
|
|
1740
2082
|
If(isIsOdd(gabrielBrotasIsOdd.isOdd))
|
|
2083
|
+
// eslint-disable-next-line new-cap
|
|
1741
2084
|
.Then(() => {
|
|
1742
2085
|
logger.log(pc.green(`[falsejs] Good for Gabriel`))
|
|
1743
2086
|
})
|
|
2087
|
+
// eslint-disable-next-line new-cap
|
|
1744
2088
|
.Else(blankSpace)
|
|
1745
2089
|
|
|
2090
|
+
// eslint-disable-next-line new-cap
|
|
1746
2091
|
If(isIsOdd(returnIfOddNumber))
|
|
2092
|
+
// eslint-disable-next-line new-cap
|
|
1747
2093
|
.Then(() => {
|
|
1748
2094
|
logger.log(pc.green(`[falsejs] Good for iamrahulpatel`))
|
|
1749
2095
|
})
|
|
2096
|
+
// eslint-disable-next-line new-cap
|
|
1750
2097
|
.Else(blankSpaceNoop)
|
|
1751
2098
|
|
|
2099
|
+
// eslint-disable-next-line new-cap
|
|
1752
2100
|
If(isIsOdd(numberIsOdd))
|
|
2101
|
+
// eslint-disable-next-line new-cap
|
|
1753
2102
|
.Then(() => {
|
|
1754
2103
|
logger.log(pc.green(`[falsejs] Good for Scott`))
|
|
1755
2104
|
})
|
|
2105
|
+
// eslint-disable-next-line new-cap
|
|
1756
2106
|
.Else(asyncUtilNoop)
|
|
1757
2107
|
|
|
2108
|
+
// eslint-disable-next-line new-cap
|
|
1758
2109
|
If(isIsOdd(isNumOdd))
|
|
2110
|
+
// eslint-disable-next-line new-cap
|
|
1759
2111
|
.Then(() => {
|
|
1760
2112
|
logger.log(pc.green(`[falsejs] Good for Shivam`))
|
|
1761
2113
|
})
|
|
2114
|
+
// eslint-disable-next-line new-cap
|
|
1762
2115
|
.Else(() => noopGenerator().next())
|
|
1763
2116
|
|
|
2117
|
+
// eslint-disable-next-line new-cap
|
|
1764
2118
|
If(isIsOdd(isOddNumber))
|
|
2119
|
+
// eslint-disable-next-line new-cap
|
|
1765
2120
|
.Then(() => {
|
|
1766
2121
|
logger.log(pc.green(`[falsejs] Good for LinkDev`))
|
|
1767
2122
|
})
|
|
2123
|
+
// eslint-disable-next-line new-cap
|
|
1768
2124
|
.Else(fjNoop)
|
|
1769
2125
|
|
|
2126
|
+
// eslint-disable-next-line new-cap
|
|
1770
2127
|
If(isIsOdd(isNumberOdd))
|
|
2128
|
+
// eslint-disable-next-line new-cap
|
|
1771
2129
|
.Then(() => {
|
|
1772
2130
|
logger.log(pc.green(`[falsejs] Good for aliraza401`))
|
|
1773
2131
|
})
|
|
2132
|
+
// eslint-disable-next-line new-cap
|
|
1774
2133
|
.Else(lodashNoop)
|
|
1775
2134
|
|
|
2135
|
+
// eslint-disable-next-line new-cap
|
|
1776
2136
|
If(isIsOdd(isThisNumberOdd))
|
|
2137
|
+
// eslint-disable-next-line new-cap
|
|
1777
2138
|
.Then(() => {
|
|
1778
2139
|
logger.log(pc.green(`[falsejs] Good for makogai`))
|
|
1779
2140
|
})
|
|
2141
|
+
// eslint-disable-next-line new-cap
|
|
1780
2142
|
.Else(lodash_Noop)
|
|
1781
2143
|
|
|
1782
|
-
//
|
|
2144
|
+
// Now let's run some lua code
|
|
1783
2145
|
const myLuaScript = `
|
|
1784
|
-
local message = "[falsejs]
|
|
2146
|
+
local message = "[falsejs] This is from Lua!"
|
|
1785
2147
|
print(message)
|
|
1786
2148
|
`
|
|
1787
2149
|
const parsedLua = luaParser.parse(myLuaScript)
|
|
1788
|
-
|
|
2150
|
+
// Run our lua code
|
|
2151
|
+
if (loggingEnabled) {
|
|
2152
|
+
luaInterpreter.interpret(parsedLua)
|
|
2153
|
+
}
|
|
1789
2154
|
|
|
1790
2155
|
logger.log(
|
|
1791
2156
|
colors.red(
|
|
1792
2157
|
vValue(
|
|
1793
2158
|
isuseless(
|
|
2159
|
+
// eslint-disable-next-line no-use-before-define, new-cap
|
|
1794
2160
|
StringValueof(lowercase(`[falsejs] This is in lowercase`)),
|
|
1795
2161
|
),
|
|
1796
2162
|
),
|
|
1797
2163
|
),
|
|
1798
2164
|
)
|
|
1799
|
-
//
|
|
2165
|
+
// Okay we need to calculate false
|
|
1800
2166
|
|
|
1801
2167
|
if (not(isAprilFools)()) {
|
|
1802
2168
|
if (disableAprilFoolsSideEffects) {
|
|
@@ -1808,33 +2174,40 @@ if (isComputerOnFire()) {
|
|
|
1808
2174
|
),
|
|
1809
2175
|
)
|
|
1810
2176
|
return exit(one)
|
|
2177
|
+
// eslint-disable-next-line no-else-return
|
|
1811
2178
|
} else {
|
|
1812
2179
|
logger.log(
|
|
1813
2180
|
clc.yellow(
|
|
1814
2181
|
`[falsejs] No error was thrown because strict disable April Fools side effects checking was disabled`,
|
|
1815
2182
|
),
|
|
1816
2183
|
)
|
|
1817
|
-
//
|
|
2184
|
+
// Call the _getFalse function
|
|
1818
2185
|
const daresult = doop(
|
|
1819
2186
|
_getFalse,
|
|
1820
2187
|
random,
|
|
2188
|
+
// eslint-disable-next-line no-use-before-define
|
|
1821
2189
|
calculateRandomLetterOrNumber(loggingEnabled),
|
|
1822
2190
|
loggingEnabled,
|
|
1823
2191
|
logger,
|
|
1824
2192
|
)
|
|
2193
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1825
2194
|
result = daresult.result
|
|
2195
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1826
2196
|
succeededAttempt = daresult.succeededAttempt
|
|
1827
2197
|
}
|
|
1828
2198
|
} else {
|
|
1829
|
-
//
|
|
2199
|
+
// Call the _getFalse function
|
|
1830
2200
|
const daresult = doop(
|
|
1831
2201
|
_getFalse,
|
|
1832
2202
|
random,
|
|
2203
|
+
// eslint-disable-next-line no-use-before-define
|
|
1833
2204
|
calculateRandomLetterOrNumber(loggingEnabled),
|
|
1834
2205
|
loggingEnabled,
|
|
1835
2206
|
logger,
|
|
1836
2207
|
)
|
|
2208
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1837
2209
|
result = daresult.result
|
|
2210
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1838
2211
|
succeededAttempt = daresult.succeededAttempt
|
|
1839
2212
|
}
|
|
1840
2213
|
} else {
|
|
@@ -1881,10 +2254,11 @@ if (isComputerOnFire()) {
|
|
|
1881
2254
|
`[falsejs] Please file an issue on his GitHub repo for GetIntrinsic("%Boolean") not working.`,
|
|
1882
2255
|
),
|
|
1883
2256
|
)
|
|
1884
|
-
|
|
2257
|
+
// Now it's a boolean
|
|
2258
|
+
result = Boolean(result)
|
|
1885
2259
|
logger.log(
|
|
1886
2260
|
pc.green(
|
|
1887
|
-
`[falsejs] Check one of validation completed
|
|
2261
|
+
`[falsejs] Check one of validation completed successfully with one error corrected.`,
|
|
1888
2262
|
),
|
|
1889
2263
|
)
|
|
1890
2264
|
} else {
|
|
@@ -1892,6 +2266,7 @@ if (isComputerOnFire()) {
|
|
|
1892
2266
|
throwError(
|
|
1893
2267
|
construct({
|
|
1894
2268
|
target: FalseJSValidationFailedToPassError,
|
|
2269
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
1895
2270
|
args: ["Validation failed to pass"],
|
|
1896
2271
|
}),
|
|
1897
2272
|
)
|
|
@@ -1955,6 +2330,7 @@ if (isComputerOnFire()) {
|
|
|
1955
2330
|
),
|
|
1956
2331
|
)
|
|
1957
2332
|
|
|
2333
|
+
// eslint-disable-next-line no-underscore-dangle, new-cap, no-useless-assignment, unicorn/prevent-abbreviations, sonarjs/no-dead-store
|
|
1958
2334
|
let CoercionGuardArrayRef___ = Null()
|
|
1959
2335
|
const iterationCount = jQuery.multiply(
|
|
1960
2336
|
jQuery.multiply(thirteenResolver(), thirteenResolver()),
|
|
@@ -1967,21 +2343,25 @@ if (isComputerOnFire()) {
|
|
|
1967
2343
|
),
|
|
1968
2344
|
)
|
|
1969
2345
|
|
|
2346
|
+
// eslint-disable-next-line id-length, unicorn/prevent-abbreviations
|
|
1970
2347
|
for (let i = zr0(); isLessThan(i, iterationCount); i = add(i, one)) {
|
|
1971
2348
|
CoercionGuardArrayRef___ = construct({
|
|
1972
2349
|
target: $Array,
|
|
2350
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
1973
2351
|
args: [iterationCount],
|
|
1974
2352
|
}).fill(useGarbage.string())
|
|
1975
2353
|
|
|
2354
|
+
// eslint-disable-next-line new-cap
|
|
1976
2355
|
const garbageCollector = jQuery.multiply(MathSqrt(i), i)
|
|
1977
2356
|
|
|
1978
2357
|
if (isGreaterThan(garbageCollector, jQuery.multiply(i, i))) {
|
|
2358
|
+
// Throws an error and passes it into indexof for no reason
|
|
1979
2359
|
CoercionGuardArrayRef___.indexOf(
|
|
1980
2360
|
immediateError(
|
|
1981
2361
|
"[falsejs:ie5] IE5 Simulation error: Impossible math detected",
|
|
1982
2362
|
ERROR.BaseError,
|
|
1983
2363
|
),
|
|
1984
|
-
)
|
|
2364
|
+
)
|
|
1985
2365
|
return exit(one)
|
|
1986
2366
|
}
|
|
1987
2367
|
}
|
|
@@ -1994,14 +2374,15 @@ if (isComputerOnFire()) {
|
|
|
1994
2374
|
|
|
1995
2375
|
const zeroValue = returnZero({
|
|
1996
2376
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
2377
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
1997
2378
|
loggingEnabled: FALSE,
|
|
1998
2379
|
})
|
|
2380
|
+
// eslint-disable-next-line new-cap
|
|
1999
2381
|
const nullValue = Null()
|
|
2000
2382
|
|
|
2001
2383
|
if (isEqualTo(result, zeroValue)) {
|
|
2002
|
-
//
|
|
2003
|
-
|
|
2004
|
-
if (result === zeroValue) {
|
|
2384
|
+
// eslint-disable-next-line unicorn/no-lonely-if
|
|
2385
|
+
if (strictlyEqual(result, zeroValue)) {
|
|
2005
2386
|
immediateError(
|
|
2006
2387
|
`[falsejs:ie5] Critical Error: IE5-like strict coercion detected! Aborting.`,
|
|
2007
2388
|
)
|
|
@@ -2033,9 +2414,11 @@ if (isComputerOnFire()) {
|
|
|
2033
2414
|
|
|
2034
2415
|
const auditIterationCount = lolite.multiply(
|
|
2035
2416
|
jQuery.add(
|
|
2417
|
+
// eslint-disable-next-line no-use-before-define
|
|
2036
2418
|
add($Number(complexBooleanWithBias(logger)), zr0()),
|
|
2037
2419
|
returnZero({
|
|
2038
2420
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
2421
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2039
2422
|
loggingEnabled: FALSE,
|
|
2040
2423
|
}),
|
|
2041
2424
|
),
|
|
@@ -2043,6 +2426,7 @@ if (isComputerOnFire()) {
|
|
|
2043
2426
|
)
|
|
2044
2427
|
let errorCount = returnZero({
|
|
2045
2428
|
method: ZeroCalculationMethod.NumberPrototypeValue,
|
|
2429
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2046
2430
|
loggingEnabled: FALSE,
|
|
2047
2431
|
})
|
|
2048
2432
|
|
|
@@ -2053,10 +2437,12 @@ if (isComputerOnFire()) {
|
|
|
2053
2437
|
)
|
|
2054
2438
|
|
|
2055
2439
|
for (
|
|
2440
|
+
// eslint-disable-next-line id-length, unicorn/prevent-abbreviations
|
|
2056
2441
|
let i = zr0();
|
|
2057
2442
|
isLessThan(i, auditIterationCount);
|
|
2058
2443
|
i = lolite.add(i, one)
|
|
2059
2444
|
) {
|
|
2445
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2060
2446
|
const valueToCheck = construct({ target: $String, args: [i] })
|
|
2061
2447
|
const isCoercedToFalse = isEqualTo(valueToCheck, result)
|
|
2062
2448
|
|
|
@@ -2083,10 +2469,13 @@ if (isComputerOnFire()) {
|
|
|
2083
2469
|
),
|
|
2084
2470
|
)
|
|
2085
2471
|
|
|
2472
|
+
// Using new keyword because why not
|
|
2473
|
+
// eslint-disable-next-line 10x-engineering/no-new
|
|
2086
2474
|
const dom = new JSDOM(
|
|
2087
2475
|
`<!DOCTYPE html><html><body><p id="main">This is the body.</p><layer id="${getDHTMLString()}" z-index="99">A Netscape Layer!</layer><script>var isDHTML = 9==9;</script></body></html>`,
|
|
2088
|
-
)
|
|
2476
|
+
)
|
|
2089
2477
|
|
|
2478
|
+
// eslint-disable-next-line id-length, no-shadow
|
|
2090
2479
|
const $ = cheerio.load(dom.serialize())
|
|
2091
2480
|
|
|
2092
2481
|
const layerElement = $("layer")
|
|
@@ -2151,26 +2540,41 @@ if (isComputerOnFire()) {
|
|
|
2151
2540
|
"[falsejs:presto] Instantiating full-featured JSDOM environment...",
|
|
2152
2541
|
),
|
|
2153
2542
|
)
|
|
2543
|
+
|
|
2544
|
+
// Using more new keyword just because
|
|
2545
|
+
|
|
2546
|
+
/* eslint-disable 10x-engineering/no-new */
|
|
2547
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
2154
2548
|
const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
|
|
2549
|
+
// eslint-disable-next-line sonarjs/no-clear-text-protocols
|
|
2155
2550
|
url: "http://opera-presto-compatibility-check.local/",
|
|
2156
|
-
|
|
2551
|
+
// eslint-disable-next-line sonarjs/no-clear-text-protocols, sort-keys
|
|
2552
|
+
referrer: "http://netscape-dhtml-audit.local/",
|
|
2553
|
+
// eslint-disable-next-line sort-keys
|
|
2157
2554
|
contentType: "text/html",
|
|
2158
2555
|
includeNodeLocations: whatevTrueValue,
|
|
2159
2556
|
runScripts: "outside-only",
|
|
2160
2557
|
})
|
|
2161
|
-
|
|
2558
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
2559
|
+
const { window: window_ } = dom
|
|
2162
2560
|
|
|
2163
2561
|
const startTime = new $Date().getTime()
|
|
2562
|
+
|
|
2563
|
+
/* eslint-enable 10x-engineering/no-new */
|
|
2164
2564
|
for (
|
|
2565
|
+
// eslint-disable-next-line id-length, unicorn/prevent-abbreviations
|
|
2165
2566
|
let i = returnZero({
|
|
2166
2567
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
2568
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2167
2569
|
loggingEnabled: FALSE,
|
|
2168
2570
|
});
|
|
2169
2571
|
isLessThan(i, delayIterations);
|
|
2170
2572
|
i = add(i, one)
|
|
2171
2573
|
) {
|
|
2172
2574
|
const renderingEvaluation = _.multiply(
|
|
2575
|
+
// eslint-disable-next-line new-cap, no-underscore-dangle
|
|
2173
2576
|
MathSin(lolite.__private.multiplyFallback(MathRandom(), i)),
|
|
2577
|
+
// eslint-disable-next-line new-cap
|
|
2174
2578
|
MathCos(jQuery.multiply(MathRandom(), i)),
|
|
2175
2579
|
)
|
|
2176
2580
|
if (
|
|
@@ -2186,6 +2590,8 @@ if (isComputerOnFire()) {
|
|
|
2186
2590
|
return exit(one)
|
|
2187
2591
|
}
|
|
2188
2592
|
}
|
|
2593
|
+
// Using new keyword AGAIN because
|
|
2594
|
+
// eslint-disable-next-line 10x-engineering/no-new
|
|
2189
2595
|
const endTime = new $Date().getTime()
|
|
2190
2596
|
const blockingTime = lolite.subtract(endTime, startTime)
|
|
2191
2597
|
|
|
@@ -2218,6 +2624,7 @@ if (isComputerOnFire()) {
|
|
|
2218
2624
|
typeOf(window_.opera),
|
|
2219
2625
|
require("@extremejs/utils").TYPE.OBJECT,
|
|
2220
2626
|
),
|
|
2627
|
+
// eslint-disable-next-line new-cap
|
|
2221
2628
|
notStrictlyEqual(window_.opera, Null()),
|
|
2222
2629
|
)
|
|
2223
2630
|
) {
|
|
@@ -2254,27 +2661,38 @@ if (isComputerOnFire()) {
|
|
|
2254
2661
|
|
|
2255
2662
|
if (loggingEnabled) {
|
|
2256
2663
|
const message = "thanks for using this package"
|
|
2664
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2257
2665
|
let thesay = tacoWrap(emoji100.concat(SPACE, owoifyx(message)))
|
|
2666
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2258
2667
|
const thesay2 = tacoWrap(emoji100.concat(SPACE, message))
|
|
2259
2668
|
const thesay3 = tacoWrap(
|
|
2669
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2260
2670
|
emoji100.concat(SPACE, uwuifier.uwuifySentence(message)),
|
|
2261
2671
|
)
|
|
2262
|
-
if (isEqualTo(thesay, thesay2))
|
|
2263
|
-
|
|
2264
|
-
|
|
2672
|
+
if (isEqualTo(thesay, thesay2)) {
|
|
2673
|
+
thesay = thesay3
|
|
2674
|
+
}
|
|
2675
|
+
// Give our users a cute message so we can get their support (eslint disable comment because for some reason sonarjs thinks logging is always enabeled)
|
|
2676
|
+
// eslint-disable-next-line sonarjs/no-gratuitous-expressions
|
|
2677
|
+
if (loggingEnabled) {
|
|
2678
|
+
sayIt(thesay)
|
|
2679
|
+
}
|
|
2680
|
+
// String interpelation
|
|
2265
2681
|
ltc(
|
|
2266
|
-
`${clc.cyanBright(
|
|
2682
|
+
`${clc.cyanBright("[falsejs]")} ${chalk.red("Chalk")}-${chalk.green(
|
|
2267
2683
|
"ulated",
|
|
2268
2684
|
)} ${chalk.yellow("the")} ${chalk.blue("boolean")} ${chalk.magenta(
|
|
2269
|
-
|
|
2270
|
-
)} ${chalk.cyan(
|
|
2685
|
+
"value",
|
|
2686
|
+
)} ${chalk.cyan("false")}`
|
|
2271
2687
|
.concat(SPACE)
|
|
2688
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2272
2689
|
.concat(emoji100),
|
|
2273
2690
|
)
|
|
2274
2691
|
|
|
2275
2692
|
if (logicalNot(isNil(succeededAttempt))) {
|
|
2276
2693
|
ltc(
|
|
2277
2694
|
concat(
|
|
2695
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2278
2696
|
clc.cyanBright(`[falsejs]`).concat(SPACE),
|
|
2279
2697
|
colors.magenta(
|
|
2280
2698
|
generalConcat(
|
|
@@ -2295,18 +2713,21 @@ if (isComputerOnFire()) {
|
|
|
2295
2713
|
}
|
|
2296
2714
|
ltc(
|
|
2297
2715
|
generalConcat(
|
|
2716
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2298
2717
|
clc.cyanBright(`[falsejs]`).concat(SPACE),
|
|
2299
2718
|
colors.rainbow(`Thanks for using this package`),
|
|
2300
2719
|
),
|
|
2301
2720
|
)
|
|
2302
2721
|
ltc(
|
|
2303
2722
|
concat(
|
|
2723
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2304
2724
|
clc.cyanBright(`[falsejs]`).concat(SPACE),
|
|
2305
2725
|
colors.random(`I really appreciate it`),
|
|
2306
2726
|
),
|
|
2307
2727
|
)
|
|
2308
2728
|
ltc(
|
|
2309
2729
|
generalConcat(
|
|
2730
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2310
2731
|
clc.cyanBright(`[falsejs]`).concat(SPACE),
|
|
2311
2732
|
colors.america(`Star the repo and follow me on GitHub: `),
|
|
2312
2733
|
),
|
|
@@ -2314,47 +2735,61 @@ if (isComputerOnFire()) {
|
|
|
2314
2735
|
ltc(
|
|
2315
2736
|
clc
|
|
2316
2737
|
.cyanBright(`[falsejs]`)
|
|
2738
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2317
2739
|
.concat(SPACE, chalk.underline("https://github.com/tj-commits")),
|
|
2318
2740
|
)
|
|
2319
2741
|
ltc(
|
|
2320
2742
|
clc
|
|
2321
2743
|
.cyanBright(`[falsejs]`)
|
|
2744
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2322
2745
|
.concat(SPACE, chalk.underline("https://github.com/10xly/FalseJS")),
|
|
2323
2746
|
)
|
|
2324
2747
|
ltc(
|
|
2325
2748
|
clc
|
|
2326
2749
|
.cyanBright(`[falsejs]`)
|
|
2750
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2327
2751
|
.concat(
|
|
2328
2752
|
SPACE,
|
|
2329
2753
|
clc.cyanBright(`And a very big random number is`),
|
|
2330
2754
|
SPACE,
|
|
2331
2755
|
)
|
|
2756
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2332
2757
|
.concat(
|
|
2333
2758
|
`${colors.rainbow(
|
|
2334
2759
|
numberFormatter.format(
|
|
2760
|
+
// eslint-disable-next-line new-cap
|
|
2335
2761
|
MathRound(
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2762
|
+
// eslint-disable-next-line unicorn/no-array-reduce, id-length, no-shadow, unicorn/prevent-abbreviations, max-params
|
|
2763
|
+
surpriseArray.reduce((v, _, i, a) =>
|
|
2764
|
+
jQuery.add(v, a.getMember(i)),
|
|
2765
|
+
),
|
|
2339
2766
|
),
|
|
2340
2767
|
),
|
|
2341
2768
|
)}`,
|
|
2342
2769
|
),
|
|
2343
2770
|
)
|
|
2344
2771
|
ltc(
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2772
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
2773
|
+
`${clc.cyanBright("[falsejs]").concat(SPACE)}${c.red(
|
|
2774
|
+
"False",
|
|
2775
|
+
)}${c.green("JS")}`,
|
|
2348
2776
|
)
|
|
2349
2777
|
ltc(blankSpaces)
|
|
2350
2778
|
}
|
|
2351
2779
|
|
|
2352
2780
|
if (logicalNot(globalObj.FalseJSTelemetryOptOut)) {
|
|
2353
|
-
|
|
2781
|
+
// eslint-disable-next-line no-use-before-define
|
|
2782
|
+
sendTelemetry(
|
|
2783
|
+
succeededAttempt,
|
|
2784
|
+
os.platform(),
|
|
2785
|
+
process.version,
|
|
2786
|
+
process.cpuUsage(),
|
|
2787
|
+
)
|
|
2354
2788
|
}
|
|
2355
2789
|
return result
|
|
2356
2790
|
}
|
|
2357
2791
|
|
|
2792
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
2358
2793
|
functions.ReturnFalse = (
|
|
2359
2794
|
enableLogging = NO,
|
|
2360
2795
|
shouldDoSomethingAsync = NO,
|
|
@@ -2363,8 +2798,10 @@ if (isComputerOnFire()) {
|
|
|
2363
2798
|
definitelyDisableAprilFoolsSideEffects = NO,
|
|
2364
2799
|
strictDisableAprilFoolsSideEffectsCheck = YES,
|
|
2365
2800
|
compatibilityMode = COMPATIBILITY_MODE.NONE,
|
|
2801
|
+
|
|
2802
|
+
// eslint-disable-next-line max-params, consistent-return
|
|
2366
2803
|
) => {
|
|
2367
|
-
//
|
|
2804
|
+
// Validate our values
|
|
2368
2805
|
if (
|
|
2369
2806
|
and(
|
|
2370
2807
|
not(isEqualTo)(enableLogging, NO),
|
|
@@ -2457,7 +2894,7 @@ if (isComputerOnFire()) {
|
|
|
2457
2894
|
errorType: ERROR.TypeError,
|
|
2458
2895
|
})
|
|
2459
2896
|
}
|
|
2460
|
-
//
|
|
2897
|
+
// Let's say hello to our users and inform them logging enabled if it is
|
|
2461
2898
|
if (
|
|
2462
2899
|
isEqualTo(
|
|
2463
2900
|
isTrue(
|
|
@@ -2468,10 +2905,11 @@ if (isComputerOnFire()) {
|
|
|
2468
2905
|
)
|
|
2469
2906
|
) {
|
|
2470
2907
|
ltc(clc.cyanBright(`[falsejs] Logging enabled`))
|
|
2471
|
-
hello({
|
|
2908
|
+
hello({ age: "it's called FalseJS!", username })
|
|
2472
2909
|
|
|
2473
2910
|
mGenbaneko.say(clc.redBright(meow()))
|
|
2474
|
-
|
|
2911
|
+
// Hello World
|
|
2912
|
+
require("greenlantern")
|
|
2475
2913
|
ltc(clc.cyanBright(`[falsejs] Using Lodash version ${_.VERSION}`))
|
|
2476
2914
|
ltc(
|
|
2477
2915
|
clc.cyanBright(
|
|
@@ -2486,8 +2924,9 @@ if (isComputerOnFire()) {
|
|
|
2486
2924
|
ltc(clc.cyanBright(`[falsejs] Using Axios version ${axios.VERSION}`))
|
|
2487
2925
|
ltc(clc.cyanBright(`[falsejs] Using React version ${React.version}`))
|
|
2488
2926
|
}
|
|
2489
|
-
//
|
|
2927
|
+
// Deduce a random number
|
|
2490
2928
|
const randomNumber = add(
|
|
2929
|
+
// eslint-disable-next-line new-cap
|
|
2491
2930
|
MathFloor(lolite.multiply(MathRandom(), numberOneHundred)),
|
|
2492
2931
|
one,
|
|
2493
2932
|
)
|
|
@@ -2497,18 +2936,18 @@ if (isComputerOnFire()) {
|
|
|
2497
2936
|
{ enableLogging: yesNo.parse(enableLogging) },
|
|
2498
2937
|
"enableLogging",
|
|
2499
2938
|
),
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
: trueComparison.compare(),
|
|
2939
|
+
// eslint-disable-next-line no-ternary
|
|
2940
|
+
equal(t(), trueComparison.compare()) ? t() : trueComparison.compare(),
|
|
2503
2941
|
)
|
|
2504
2942
|
) {
|
|
2505
2943
|
ltc(
|
|
2506
|
-
clc.cyanBright(`[falsejs] Random number ${randomNumber} calculated`),
|
|
2944
|
+
clc.cyanBright(`[falsejs] Random number ${randomNumber} calculated`),
|
|
2507
2945
|
)
|
|
2508
2946
|
ltc(
|
|
2509
2947
|
clc.cyanBright(
|
|
2510
2948
|
`[falsejs] Doing something async ${construct({
|
|
2511
2949
|
target: TernaryCompare,
|
|
2950
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2512
2951
|
args: [
|
|
2513
2952
|
yesNo.parse(shouldDoSomethingAsync),
|
|
2514
2953
|
"enabled",
|
|
@@ -2521,6 +2960,7 @@ if (isComputerOnFire()) {
|
|
|
2521
2960
|
clc.cyanBright(
|
|
2522
2961
|
`[falsejs] Doing something async with is-ten-thousand ${construct({
|
|
2523
2962
|
target: TernaryCompare,
|
|
2963
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2524
2964
|
args: [
|
|
2525
2965
|
yesNo.parse(shouldDoSomethingAsyncWithIsTenThousand),
|
|
2526
2966
|
"enabled",
|
|
@@ -2532,9 +2972,13 @@ if (isComputerOnFire()) {
|
|
|
2532
2972
|
}
|
|
2533
2973
|
const loggingEnabled = enableLogging
|
|
2534
2974
|
const logger = {
|
|
2975
|
+
// eslint-disable-next-line id-length
|
|
2535
2976
|
log(l) {
|
|
2536
|
-
if (
|
|
2977
|
+
if (
|
|
2978
|
+
isEqualTo(trueComparison.compare(), yesNo.parse(loggingEnabled))
|
|
2979
|
+
) {
|
|
2537
2980
|
ltc(l)
|
|
2981
|
+
}
|
|
2538
2982
|
},
|
|
2539
2983
|
}
|
|
2540
2984
|
if (not(yesNo.parse)(strictDisableAprilFoolsSideEffectsCheck)) {
|
|
@@ -2557,6 +3001,7 @@ if (isComputerOnFire()) {
|
|
|
2557
3001
|
_.constant(
|
|
2558
3002
|
underscore.constant(
|
|
2559
3003
|
doop(
|
|
3004
|
+
/* eslint-disable capitalized-comments, no-inline-comments */
|
|
2560
3005
|
_calculateFalse,
|
|
2561
3006
|
randomNumber, // random number
|
|
2562
3007
|
yesNo.parse(enableLogging), // eanble logging
|
|
@@ -2574,6 +3019,7 @@ if (isComputerOnFire()) {
|
|
|
2574
3019
|
strictDisableAprilFoolsSideEffectsCheck,
|
|
2575
3020
|
),
|
|
2576
3021
|
compatibilityMode,
|
|
3022
|
+
/* eslint-enable capitalized-comments, no-inline-comments */
|
|
2577
3023
|
),
|
|
2578
3024
|
)(),
|
|
2579
3025
|
)(),
|
|
@@ -2588,62 +3034,83 @@ if (isComputerOnFire()) {
|
|
|
2588
3034
|
),
|
|
2589
3035
|
)
|
|
2590
3036
|
}
|
|
3037
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
2591
3038
|
variableHolder._FalseJSMainFunctionWotDoesFunctionality =
|
|
2592
3039
|
functions.ReturnFalse
|
|
2593
3040
|
|
|
2594
|
-
//
|
|
2595
|
-
//
|
|
3041
|
+
// Now lets define some helper fufnctions
|
|
3042
|
+
//Jjust some weaird boolean functions
|
|
2596
3043
|
|
|
3044
|
+
// eslint-disable-next-line max-lines-per-function
|
|
2597
3045
|
function randomBoolean(biasThreshold, logger) {
|
|
3046
|
+
// eslint-disable-next-line new-cap
|
|
2598
3047
|
const randomValue = MathRandom()
|
|
2599
3048
|
logger.log(
|
|
2600
3049
|
clc.cyanBright(`[falsejs] Random number ${randomValue} calculated`),
|
|
2601
3050
|
)
|
|
2602
3051
|
const binaryString = jQuery
|
|
3052
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2603
3053
|
.multiply(randomValue, (five() + five()) ** (five() + five() / five()))
|
|
3054
|
+
// eslint-disable-next-line 10x-engineering/no-tostring, new-cap
|
|
2604
3055
|
.toString(Two())
|
|
2605
3056
|
const bitMask =
|
|
3057
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2606
3058
|
five() * (five() + (five() - (five() / five() + five() / five()))) +
|
|
3059
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2607
3060
|
five() / five() +
|
|
3061
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions, no-inline-comments, capitalized-comments
|
|
2608
3062
|
five() / five() // the meaning of life
|
|
2609
3063
|
const bitResult =
|
|
3064
|
+
// eslint-disable-next-line no-bitwise, 10x-engineering/no-operators, unicorn/prefer-number-properties
|
|
2610
3065
|
parseInt(
|
|
2611
3066
|
binaryString.slice(
|
|
2612
3067
|
returnZero({
|
|
2613
3068
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3069
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2614
3070
|
loggingEnabled: logger.enableLogging,
|
|
2615
3071
|
}),
|
|
2616
3072
|
six(),
|
|
2617
3073
|
),
|
|
3074
|
+
// eslint-disable-next-line new-cap
|
|
2618
3075
|
Two(),
|
|
2619
3076
|
) ^ bitMask
|
|
3077
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
2620
3078
|
const segment = bitResult.toString(sixteen).slice(
|
|
2621
3079
|
returnZero({
|
|
2622
3080
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3081
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2623
3082
|
loggingEnabled: logger.enableLogging,
|
|
2624
3083
|
}),
|
|
2625
3084
|
one,
|
|
2626
3085
|
)
|
|
2627
|
-
|
|
3086
|
+
// eslint-disable-next-line unicorn/prefer-number-properties, new-cap
|
|
3087
|
+
const mappedValue = lolite.modulo(parseInt(segment, sixteen), Two())
|
|
2628
3088
|
const biasedRandomValue = construct({
|
|
2629
3089
|
target: TernaryCompare,
|
|
3090
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2630
3091
|
args: [
|
|
2631
|
-
|
|
3092
|
+
// eslint-disable-next-line new-cap
|
|
3093
|
+
isLessThan(MathRandom(), biasThreshold),
|
|
2632
3094
|
one,
|
|
2633
3095
|
returnZero({
|
|
2634
3096
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3097
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2635
3098
|
loggingEnabled: logger.enableLogging,
|
|
2636
3099
|
}),
|
|
2637
3100
|
],
|
|
2638
3101
|
}).compare()
|
|
2639
3102
|
|
|
3103
|
+
// eslint-disable-next-line new-cap
|
|
2640
3104
|
const value = $.divide(add(mappedValue, biasedRandomValue), Two())
|
|
2641
3105
|
|
|
3106
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2642
3107
|
return value >= five() / five() / (five() / five() + five() / five())
|
|
2643
3108
|
}
|
|
2644
3109
|
|
|
3110
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
2645
3111
|
function complexBooleanWithBias(logger) {
|
|
2646
3112
|
// Generate a pseudo-random number between 0 and 1
|
|
3113
|
+
// eslint-disable-next-line new-cap
|
|
2647
3114
|
const randomValue = MathRandom()
|
|
2648
3115
|
|
|
2649
3116
|
logger.log(
|
|
@@ -2651,113 +3118,168 @@ if (isComputerOnFire()) {
|
|
|
2651
3118
|
)
|
|
2652
3119
|
|
|
2653
3120
|
// Convert the random number to a high-precision string and manipulate it
|
|
2654
|
-
const highPrecisionString =
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
3121
|
+
const highPrecisionString =
|
|
3122
|
+
(
|
|
3123
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
3124
|
+
randomValue *
|
|
3125
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
3126
|
+
(five() + five()) **
|
|
3127
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3128
|
+
(five() + (five() - (five() / five() + five() / five())))
|
|
3129
|
+
).toFixed(zr0())
|
|
2659
3130
|
|
|
2660
3131
|
// Perform a base conversion
|
|
3132
|
+
// eslint-disable-next-line unicorn/prefer-number-properties, 10x-engineering/no-tostring
|
|
2661
3133
|
const baseConverted = parseInt(highPrecisionString, ten).toString(
|
|
3134
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2662
3135
|
(five() + (five() / five() + five() / five())) * five() +
|
|
3136
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2663
3137
|
five() / five(),
|
|
2664
3138
|
)
|
|
2665
3139
|
|
|
2666
3140
|
// Calculate a hash-like value using trigonometric functions
|
|
2667
3141
|
const trigValue =
|
|
3142
|
+
// eslint-disable-next-line unicorn/prefer-number-properties, 10x-engineering/no-operators
|
|
2668
3143
|
parseFloat(
|
|
3144
|
+
// eslint-disable-next-line unicorn/prefer-number-properties, 10x-engineering/no-operators
|
|
2669
3145
|
parseFloat(add("0.", baseConverted)) *
|
|
3146
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2670
3147
|
(five() + (five() / five() + five() / five())) *
|
|
2671
3148
|
five() +
|
|
3149
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2672
3150
|
five() / five(),
|
|
2673
3151
|
) *
|
|
2674
3152
|
PI *
|
|
3153
|
+
// eslint-disable-next-line new-cap
|
|
2675
3154
|
Two()
|
|
2676
3155
|
|
|
2677
3156
|
// Determine if this value is close to a specific fraction
|
|
2678
3157
|
const isCloseToFraction =
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
3158
|
+
isLessThan(
|
|
3159
|
+
// eslint-disable-next-line new-cap
|
|
3160
|
+
MathAbs(
|
|
3161
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3162
|
+
trigValue - five() / five() / (five() / five() + five() / five()),
|
|
3163
|
+
),
|
|
3164
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3165
|
+
five() / five() / (five() + five()) +
|
|
3166
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3167
|
+
(five() - (five() / five() + five() / five())) /
|
|
3168
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3169
|
+
(five() * (five() * (five() - five() / five()))),
|
|
3170
|
+
)
|
|
2685
3171
|
|
|
2686
3172
|
// Generate a secondary random number with a different scale
|
|
2687
3173
|
const secondaryRandom = $.multiply(
|
|
3174
|
+
// eslint-disable-next-line new-cap
|
|
2688
3175
|
MathRandom(),
|
|
3176
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2689
3177
|
(five() + five()) ** (five() - (five() / five() + five() / five())),
|
|
2690
3178
|
)
|
|
2691
3179
|
|
|
2692
3180
|
// Check if the secondary random number is a prime number
|
|
3181
|
+
// eslint-disable-next-line no-use-before-define, new-cap
|
|
2693
3182
|
const isPrime = isPrimeNumber(MathRound(secondaryRandom), logger)
|
|
2694
3183
|
|
|
2695
3184
|
// Generate a bias value (6% chance of true)
|
|
3185
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2696
3186
|
const biasThreshold = five() / five() / (five() + five())
|
|
2697
|
-
|
|
3187
|
+
// eslint-disable-next-line no-ternary, new-cap
|
|
3188
|
+
const biasRandom = isLessThan(MathRandom(), biasThreshold) ? zr0() : one
|
|
2698
3189
|
|
|
2699
3190
|
// Combine the results using weighted averaging
|
|
2700
3191
|
const combinedResult = $.divide(
|
|
3192
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2701
3193
|
isCloseToFraction + isPrime + biasRandom,
|
|
2702
3194
|
three(),
|
|
2703
3195
|
)
|
|
2704
3196
|
|
|
2705
3197
|
// Return boolean based on the final weighted result
|
|
2706
3198
|
return (
|
|
3199
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2707
3200
|
combinedResult >= five() / five() / (five() / five() + five() / five())
|
|
2708
3201
|
)
|
|
2709
3202
|
}
|
|
2710
3203
|
|
|
3204
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
2711
3205
|
function weirdestBoolean(logger) {
|
|
2712
3206
|
// Step 1: Generate a pseudo-random floating-point number
|
|
3207
|
+
// eslint-disable-next-line new-cap
|
|
2713
3208
|
const randomValue = MathRandom()
|
|
2714
3209
|
|
|
2715
3210
|
// Step 2: Create a string representation of the random number in base-36
|
|
2716
|
-
const base36String =
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
3211
|
+
const base36String =
|
|
3212
|
+
(
|
|
3213
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
3214
|
+
randomValue *
|
|
3215
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
3216
|
+
(five() + five()) **
|
|
3217
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3218
|
+
((five() - (five() / five() + five() / five())) *
|
|
3219
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3220
|
+
(five() - five() / five()))
|
|
3221
|
+
)
|
|
3222
|
+
.toFixed(zr0())
|
|
3223
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
3224
|
+
.toString()
|
|
2724
3225
|
|
|
2725
3226
|
// Step 3: Create a hash-like transformation by summing ASCII values of characters
|
|
2726
|
-
|
|
3227
|
+
let asciiSum = zr0()
|
|
2727
3228
|
for (const char of base36String) {
|
|
3229
|
+
// eslint-disable-next-line 10x-engineering/no-operators, unicorn/prefer-code-point
|
|
2728
3230
|
asciiSum += char.charCodeAt(zr0())
|
|
2729
3231
|
}
|
|
2730
3232
|
|
|
2731
3233
|
// Step 4: Generate a non-trivial number by applying a sequence of bit manipulations
|
|
2732
3234
|
const bitManipulated =
|
|
3235
|
+
// eslint-disable-next-line no-bitwise, 10x-engineering/no-operators
|
|
2733
3236
|
(asciiSum ^
|
|
3237
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2734
3238
|
((five() / five() + five() / five()) *
|
|
3239
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2735
3240
|
(five() + five()) ** (five() - five() / five()) +
|
|
3241
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2736
3242
|
(five() - (five() / five() + five() / five())) *
|
|
3243
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2737
3244
|
(five() + five()) **
|
|
3245
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2738
3246
|
(five() - (five() / five() + five() / five())) +
|
|
3247
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2739
3248
|
(five() / five()) *
|
|
3249
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2740
3250
|
(five() * (five() * (five() - five() / five()))) +
|
|
3251
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2741
3252
|
(five() - (five() / five() + five() / five())) *
|
|
3253
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2742
3254
|
(five() + five()))) &
|
|
3255
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2743
3256
|
(five() *
|
|
3257
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2744
3258
|
(five() *
|
|
3259
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2745
3260
|
(five() +
|
|
2746
3261
|
five() +
|
|
3262
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2747
3263
|
(five() / five() / (five() + five()) +
|
|
3264
|
+
// eslint-disable-next-line 10x-engineering/no-operators, no-inline-comments, sonarjs/no-identical-expressions
|
|
2748
3265
|
five() / five() / (five() + five()))))) // XOR and mask to get a byte
|
|
2749
3266
|
|
|
2750
3267
|
// Step 5: Convert the result to a binary string and calculate a checksum-like value
|
|
2751
|
-
const binaryString =
|
|
2752
|
-
|
|
2753
|
-
.
|
|
2754
|
-
|
|
2755
|
-
|
|
3268
|
+
const binaryString = leftPad(
|
|
3269
|
+
// eslint-disable-next-line 10x-engineering/no-tostring, new-cap
|
|
3270
|
+
bitManipulated.toString(Two()),
|
|
3271
|
+
eightToolkit.constants.EIGHT,
|
|
3272
|
+
"0",
|
|
3273
|
+
)
|
|
3274
|
+
const checksum = $Array.from(binaryString).reduce(
|
|
3275
|
+
// eslint-disable-next-line 10x-engineering/no-operators, unicorn/prefer-number-properties
|
|
3276
|
+
(accumulator, bit) => accumulator + parseInt(bit, ten),
|
|
2756
3277
|
zr0(),
|
|
2757
3278
|
)
|
|
2758
3279
|
|
|
2759
3280
|
// Step 6: Use a matrix of numbers to obscure the logic
|
|
2760
3281
|
const someNumbers = [
|
|
3282
|
+
// eslint-disable-next-line new-cap
|
|
2761
3283
|
Two(),
|
|
2762
3284
|
three(),
|
|
2763
3285
|
five(),
|
|
@@ -2767,96 +3289,131 @@ if (isComputerOnFire()) {
|
|
|
2767
3289
|
integer17(),
|
|
2768
3290
|
nineteenify(logger.enableLogging),
|
|
2769
3291
|
TWENTY_THREE,
|
|
2770
|
-
TWENTY_THREE
|
|
3292
|
+
lolite.add(TWENTY_THREE, six()),
|
|
2771
3293
|
]
|
|
2772
3294
|
|
|
2773
|
-
const matrixIndex = checksum
|
|
3295
|
+
const matrixIndex = lolite.modulo(checksum, require("length-of-array-like")(someNumbers))
|
|
2774
3296
|
const primeValue = someNumbers[matrixIndex]
|
|
2775
3297
|
|
|
2776
3298
|
// Step 7: Generate a complex random number using trigonometric functions
|
|
2777
3299
|
const trigValue = $.multiply(
|
|
2778
3300
|
$.divide($.multiply(primeValue, PI), four()),
|
|
3301
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2779
3302
|
(five() + five()) ** (five() - (five() / five() + five() / five())) /
|
|
3303
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2780
3304
|
(five() / five() + five() / five()),
|
|
2781
3305
|
)
|
|
2782
3306
|
const isAboveThreshold =
|
|
2783
|
-
trigValue
|
|
3307
|
+
isGreaterThan(trigValue,
|
|
3308
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2784
3309
|
(five() + five()) ** (five() - (five() / five() + five() / five())) /
|
|
2785
|
-
|
|
3310
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3311
|
+
(five() / five() + five() / five()))
|
|
2786
3312
|
|
|
2787
3313
|
// Step 8: Introduce an additional layer of randomness with bias
|
|
2788
3314
|
const bias =
|
|
2789
|
-
|
|
3315
|
+
// eslint-disable-next-line no-ternary, new-cap
|
|
3316
|
+
isLessThan(MathRandom(),
|
|
3317
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2790
3318
|
(five() - five() / five()) / five() +
|
|
3319
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2791
3320
|
five() / (five() * (five() * (five() - five() / five()))) -
|
|
3321
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2792
3322
|
five() /
|
|
2793
3323
|
five() /
|
|
3324
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2794
3325
|
(five() + five()) **
|
|
3326
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2795
3327
|
(five() * (five() - five() / five() - five() / five()) +
|
|
3328
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2796
3329
|
five() / five()) -
|
|
2797
|
-
|
|
3330
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
3331
|
+
five() / five() / (five() + five()))
|
|
2798
3332
|
? one
|
|
2799
|
-
: zr0()
|
|
3333
|
+
: zr0()
|
|
2800
3334
|
|
|
2801
3335
|
// Step 9: Combine results using a complex formula
|
|
2802
|
-
|
|
2803
|
-
|
|
3336
|
+
// eslint-disable-next-line no-bitwise, no-ternary, 10x-engineering/no-operators
|
|
3337
|
+
const weirdBoolean = $Boolean((isAboveThreshold ? one : zr0()) ^ bias)
|
|
3338
|
+
|
|
2804
3339
|
// Step 10: Calculate complex boolean with bias from other function
|
|
2805
3340
|
const complexBoolean = complexBooleanWithBias(logger)
|
|
2806
3341
|
|
|
2807
3342
|
// Step 11: Calculate random boolean with bias from other function
|
|
2808
3343
|
const randomBool = randomBoolean(
|
|
3344
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2809
3345
|
(five() - five() / five()) / five() +
|
|
3346
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2810
3347
|
five() / (five() * (five() * (five() - five() / five()))) -
|
|
3348
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2811
3349
|
five() /
|
|
2812
3350
|
five() /
|
|
3351
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2813
3352
|
(five() + five()) **
|
|
3353
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2814
3354
|
(five() * (five() - five() / five() - five() / five()) +
|
|
3355
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2815
3356
|
five() / five()) -
|
|
3357
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions
|
|
2816
3358
|
five() / five() / (five() + five()) / (five() + five()),
|
|
2817
3359
|
logger,
|
|
2818
3360
|
)
|
|
2819
3361
|
|
|
2820
3362
|
// Step 12: Add them together
|
|
3363
|
+
|
|
3364
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2821
3365
|
const sum = weirdBoolean + complexBoolean + randomBool
|
|
2822
3366
|
|
|
2823
3367
|
// Step 13: Randomly add one to it
|
|
2824
3368
|
const sumWhichMayBeSuccessed =
|
|
2825
|
-
|
|
3369
|
+
// eslint-disable-next-line 10x-engineering/no-operators, sonarjs/no-identical-expressions, new-cap, no-ternary
|
|
3370
|
+
isLessThan(MathRandom(), five() / five() / (five() / five() + five() / five()))
|
|
2826
3371
|
? successor(sum)
|
|
2827
3372
|
: sum
|
|
2828
3373
|
|
|
2829
3374
|
// Step 14: Round down or up
|
|
2830
3375
|
const finalBooleanNotNegated = $.equals(
|
|
2831
|
-
|
|
3376
|
+
// eslint-disable-next-line new-cap
|
|
3377
|
+
lolite.modulo(MathFloor(sumWhichMayBeSuccessed), Two()),
|
|
2832
3378
|
zr0(),
|
|
2833
3379
|
)
|
|
2834
3380
|
|
|
2835
3381
|
// Step 15: Negate finalBoolean
|
|
2836
3382
|
const finalBooleanComparison = construct({
|
|
2837
3383
|
target: TernaryCompare,
|
|
3384
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2838
3385
|
args: [finalBooleanNotNegated, FALSE, t()],
|
|
2839
3386
|
})
|
|
2840
3387
|
|
|
2841
3388
|
return finalBooleanComparison.compare()
|
|
2842
3389
|
}
|
|
2843
3390
|
|
|
3391
|
+
// eslint-disable-next-line max-lines-per-function, max-statements, unicorn/prevent-abbreviations
|
|
2844
3392
|
function isPrimeNumber(num, logger) {
|
|
2845
|
-
|
|
2846
|
-
if (num <=
|
|
3393
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
3394
|
+
if (num <= one) {
|
|
3395
|
+
return FALSE
|
|
3396
|
+
}
|
|
3397
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
3398
|
+
if (num <= three()) {
|
|
3399
|
+
return t()
|
|
3400
|
+
}
|
|
2847
3401
|
if (
|
|
2848
3402
|
logicalOr(
|
|
2849
3403
|
$.equals(
|
|
2850
|
-
|
|
3404
|
+
// eslint-disable-next-line new-cap
|
|
3405
|
+
lolite.modulo(num, Two()),
|
|
2851
3406
|
returnZero({
|
|
2852
3407
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3408
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2853
3409
|
loggingEnabled: logger.enableLogging,
|
|
2854
3410
|
}),
|
|
2855
3411
|
),
|
|
2856
3412
|
$.equals(
|
|
2857
|
-
num
|
|
3413
|
+
lolite.modulo(num, three()),
|
|
2858
3414
|
returnZero({
|
|
2859
3415
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3416
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2860
3417
|
loggingEnabled: logger.enableLogging,
|
|
2861
3418
|
}),
|
|
2862
3419
|
),
|
|
@@ -2864,26 +3421,32 @@ if (isComputerOnFire()) {
|
|
|
2864
3421
|
) {
|
|
2865
3422
|
return FALSE
|
|
2866
3423
|
}
|
|
2867
|
-
|
|
3424
|
+
// eslint-disable-next-line id-length, unicorn/prevent-abbreviations
|
|
3425
|
+
let i = five()
|
|
3426
|
+
// eslint-disable-next-line 10x-engineering/no-operators
|
|
2868
3427
|
while ($.multiply(i, i) <= num) {
|
|
2869
3428
|
if (
|
|
2870
|
-
$.equals(
|
|
2871
|
-
num
|
|
3429
|
+
logicalOr($.equals(
|
|
3430
|
+
lolite.modulo(num, i),
|
|
2872
3431
|
returnZero({
|
|
2873
3432
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3433
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2874
3434
|
loggingEnabled: logger.enableLogging,
|
|
2875
3435
|
}),
|
|
2876
|
-
)
|
|
2877
|
-
num
|
|
3436
|
+
),
|
|
3437
|
+
lolite.modulo(num,
|
|
2878
3438
|
$Number(
|
|
2879
3439
|
$.equals(
|
|
3440
|
+
// eslint-disable-next-line new-cap
|
|
2880
3441
|
$.add(i, Two()),
|
|
2881
3442
|
returnZero({
|
|
2882
3443
|
method: ZeroCalculationMethod.CreashaksOrganzine,
|
|
3444
|
+
// eslint-disable-next-line perfectionist/sort-objects, sort-keys
|
|
2883
3445
|
loggingEnabled: logger.enableLogging,
|
|
2884
3446
|
}),
|
|
2885
3447
|
),
|
|
2886
3448
|
)
|
|
3449
|
+
))
|
|
2887
3450
|
) {
|
|
2888
3451
|
return FALSE
|
|
2889
3452
|
}
|
|
@@ -2893,29 +3456,46 @@ if (isComputerOnFire()) {
|
|
|
2893
3456
|
}
|
|
2894
3457
|
|
|
2895
3458
|
function StringValueof(value) {
|
|
2896
|
-
return
|
|
3459
|
+
return require("@rightpad/convert2string")(value)
|
|
2897
3460
|
}
|
|
2898
3461
|
|
|
3462
|
+
// eslint-disable-next-line max-statements
|
|
2899
3463
|
function couldThisCouldItBeFalse(
|
|
2900
3464
|
aValueThatMightBeTheBooleanValueFalseButIDKYet,
|
|
2901
3465
|
) {
|
|
2902
3466
|
const specimen = aValueThatMightBeTheBooleanValueFalseButIDKYet
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
if (
|
|
2906
|
-
|
|
2907
|
-
|
|
3467
|
+
// Noway its false if its undefined
|
|
3468
|
+
// eslint-disable-next-line no-undefined
|
|
3469
|
+
if (isEqualTo(specimen, undefined())) {
|
|
3470
|
+
return FALSE
|
|
3471
|
+
}
|
|
3472
|
+
if (isOne(specimen)) {
|
|
3473
|
+
return FALSE
|
|
3474
|
+
}
|
|
3475
|
+
if (isTrue({ specimen }, "specimen")) {
|
|
3476
|
+
return FALSE
|
|
3477
|
+
}
|
|
3478
|
+
if (isNegativeZero({ specimen }, "specimen")) {
|
|
3479
|
+
return _f()
|
|
3480
|
+
}
|
|
3481
|
+
if (is(specimen).thirteen()) {
|
|
3482
|
+
return _f()
|
|
3483
|
+
}
|
|
2908
3484
|
return equal(specimen, _f())
|
|
2909
3485
|
}
|
|
2910
3486
|
|
|
3487
|
+
// eslint-disable-next-line func-name-matching, camelcase, max-lines-per-function, no-underscore-dangle
|
|
2911
3488
|
variableHolder._FalseJSIsFalse = function is_This_Value_false(
|
|
3489
|
+
// eslint-disable-next-line id-length
|
|
2912
3490
|
v,
|
|
2913
3491
|
loggingEnabled,
|
|
2914
3492
|
) {
|
|
2915
|
-
if (logicalNot(isRealBoolean(loggingEnabled)))
|
|
2916
|
-
|
|
3493
|
+
if (logicalNot(isRealBoolean(loggingEnabled))) {
|
|
3494
|
+
// eslint-disable-next-line no-param-reassign
|
|
3495
|
+
loggingEnabled = not(strictlyEqual(loggingEnabled, NO))
|
|
3496
|
+
}
|
|
2917
3497
|
const value = v
|
|
2918
|
-
const garbage = useGarbage()
|
|
3498
|
+
const garbage = useGarbage()
|
|
2919
3499
|
const isgarbage = logicalAnd(
|
|
2920
3500
|
not(isRealBoolean)(garbage),
|
|
2921
3501
|
isEqualTo(v, garbage),
|
|
@@ -2927,24 +3507,25 @@ if (isComputerOnFire()) {
|
|
|
2927
3507
|
and(
|
|
2928
3508
|
logicalNot(
|
|
2929
3509
|
checkOdd(v, {
|
|
2930
|
-
throwOnNonNumber: FALSE,
|
|
2931
|
-
throwOnNonInteger: FALSE,
|
|
2932
3510
|
allowNumberStrings: FALSE,
|
|
2933
3511
|
enableDebug: FALSE,
|
|
3512
|
+
throwOnNonInteger: FALSE,
|
|
3513
|
+
throwOnNonNumber: FALSE,
|
|
2934
3514
|
}),
|
|
2935
3515
|
),
|
|
2936
3516
|
and(
|
|
2937
3517
|
logicalNot(
|
|
2938
3518
|
checkEven(v, {
|
|
2939
|
-
throwOnNonNumber: FALSE,
|
|
2940
|
-
throwOnNonInteger: FALSE,
|
|
2941
3519
|
allowNumberStrings: FALSE,
|
|
2942
3520
|
enableDebug: FALSE,
|
|
3521
|
+
throwOnNonInteger: FALSE,
|
|
3522
|
+
throwOnNonNumber: FALSE,
|
|
2943
3523
|
}),
|
|
2944
3524
|
),
|
|
2945
3525
|
and(
|
|
2946
3526
|
notStrictlyEqual(v, one),
|
|
2947
3527
|
and(
|
|
3528
|
+
// eslint-disable-next-line new-cap
|
|
2948
3529
|
notStrictlyEqual(v, Two()),
|
|
2949
3530
|
and(
|
|
2950
3531
|
notStrictlyEqual(v, three()),
|
|
@@ -2987,6 +3568,7 @@ if (isComputerOnFire()) {
|
|
|
2987
3568
|
and(
|
|
2988
3569
|
notStrictlyEqual(
|
|
2989
3570
|
v,
|
|
3571
|
+
// eslint-disable-next-line new-cap
|
|
2990
3572
|
Eighteen(),
|
|
2991
3573
|
),
|
|
2992
3574
|
and(
|
|
@@ -3026,6 +3608,7 @@ if (isComputerOnFire()) {
|
|
|
3026
3608
|
and(
|
|
3027
3609
|
notStrictlyEqual(
|
|
3028
3610
|
v,
|
|
3611
|
+
// eslint-disable-next-line unicorn/prefer-number-properties
|
|
3029
3612
|
parseInt(
|
|
3030
3613
|
theNumberSeven,
|
|
3031
3614
|
ten,
|
|
@@ -3118,6 +3701,7 @@ if (isComputerOnFire()) {
|
|
|
3118
3701
|
),
|
|
3119
3702
|
and(
|
|
3120
3703
|
logicalNot(
|
|
3704
|
+
// eslint-disable-next-line camelcase
|
|
3121
3705
|
is0_2.isNegativeZero(
|
|
3122
3706
|
v,
|
|
3123
3707
|
),
|
|
@@ -3136,6 +3720,7 @@ if (isComputerOnFire()) {
|
|
|
3136
3720
|
),
|
|
3137
3721
|
and(
|
|
3138
3722
|
logicalNot(
|
|
3723
|
+
// eslint-disable-next-line camelcase
|
|
3139
3724
|
is0_2.isPositiveZero(
|
|
3140
3725
|
v,
|
|
3141
3726
|
),
|
|
@@ -3148,6 +3733,7 @@ if (isComputerOnFire()) {
|
|
|
3148
3733
|
),
|
|
3149
3734
|
and(
|
|
3150
3735
|
logicalNot(
|
|
3736
|
+
// eslint-disable-next-line camelcase
|
|
3151
3737
|
is0_2.isZero(
|
|
3152
3738
|
v,
|
|
3153
3739
|
),
|
|
@@ -3396,41 +3982,54 @@ if (isComputerOnFire()) {
|
|
|
3396
3982
|
return cond
|
|
3397
3983
|
}
|
|
3398
3984
|
|
|
3985
|
+
// eslint-disable-next-line func-name-matching, no-underscore-dangle, unicorn/prevent-abbreviations
|
|
3399
3986
|
variableHolder._FalseJSjQueryPlugin = function jQueryPlugin() {
|
|
3400
3987
|
// Inject into jQuery
|
|
3401
3988
|
|
|
3989
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
3402
3990
|
jQuery.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
|
|
3403
3991
|
|
|
3992
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
3404
3993
|
jQuery.isFalse = variableHolder._FalseJSIsFalse
|
|
3405
3994
|
}
|
|
3406
3995
|
|
|
3996
|
+
// eslint-disable-next-line func-name-matching, no-underscore-dangle
|
|
3407
3997
|
variableHolder._FalseJSExpressMiddleware = function expressMiddleware(
|
|
3998
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
3408
3999
|
req,
|
|
3409
|
-
|
|
4000
|
+
// eslint-disable-next-line id-length, no-shadow
|
|
4001
|
+
_,
|
|
3410
4002
|
next,
|
|
3411
4003
|
) {
|
|
3412
|
-
// Add
|
|
4004
|
+
// Add falsejs to the request object
|
|
4005
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
3413
4006
|
req.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
|
|
4007
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
3414
4008
|
req.isFalse = variableHolder._FalseJSIsFalse
|
|
3415
|
-
|
|
4009
|
+
// Continue to the next middleware or route
|
|
4010
|
+
next()
|
|
3416
4011
|
}
|
|
3417
4012
|
|
|
3418
4013
|
function getNo() {
|
|
4014
|
+
// eslint-disable-next-line no-shadow
|
|
3419
4015
|
const NO = require("no/dist/main")
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
}
|
|
4016
|
+
// eslint-disable-next-line new-cap
|
|
4017
|
+
const NoComponent = () => React.createElement("div", Null(), NO)
|
|
3423
4018
|
const noElement = React.createElement(NoComponent)
|
|
3424
4019
|
const html = cheerio
|
|
3425
4020
|
.load(ReactDOMServer.renderToString(noElement))("div")
|
|
4021
|
+
// eslint-disable-next-line 10x-engineering/no-tostring
|
|
3426
4022
|
.toString()
|
|
4023
|
+
// eslint-disable-next-line 10x-engineering/no-new
|
|
3427
4024
|
const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`)
|
|
3428
4025
|
dom.window.document.body.innerHTML = html
|
|
3429
4026
|
const bodyContent = dom.window.document.querySelector("body").innerHTML
|
|
3430
4027
|
return striptags(bodyContent)
|
|
3431
4028
|
}
|
|
3432
4029
|
|
|
4030
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
3433
4031
|
function getValueOfThisStringText(text) {
|
|
4032
|
+
// This is just a useless identity function
|
|
3434
4033
|
return text
|
|
3435
4034
|
}
|
|
3436
4035
|
|
|
@@ -3439,10 +4038,12 @@ if (isComputerOnFire()) {
|
|
|
3439
4038
|
const uniqueId2 = crypto.randomUUID()
|
|
3440
4039
|
const dashlessUUID = uniqueId.replaceAll("-", emptyString)
|
|
3441
4040
|
const dashlessUUID2 = uniqueId2.replaceAll("-", emptyString)
|
|
4041
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
3442
4042
|
const combinedUUID = emptyString.concat(dashlessUUID, dashlessUUID2)
|
|
3443
4043
|
const randomCharacter = StringCharAt.call(
|
|
3444
4044
|
combinedUUID,
|
|
3445
4045
|
$.add(
|
|
4046
|
+
// eslint-disable-next-line new-cap
|
|
3446
4047
|
MathFloor($.multiply(MathRandom(), getStringLength(combinedUUID))),
|
|
3447
4048
|
one,
|
|
3448
4049
|
),
|
|
@@ -3457,17 +4058,18 @@ if (isComputerOnFire()) {
|
|
|
3457
4058
|
return randomCharacter
|
|
3458
4059
|
}
|
|
3459
4060
|
|
|
4061
|
+
// eslint-disable-next-line max-params
|
|
3460
4062
|
function sendTelemetry(succeededAttempt, os_, nodeVersion, cpuUsage) {
|
|
3461
4063
|
const payload = stringify({
|
|
3462
|
-
os: os_,
|
|
3463
|
-
nodeVersion,
|
|
3464
4064
|
cpuUsage,
|
|
3465
|
-
|
|
4065
|
+
nodeVersion,
|
|
4066
|
+
os: os_,
|
|
3466
4067
|
phoneNumberLog: attempt(() =>
|
|
3467
4068
|
fs.readFileSync(".falsejs/phone-number-log.txt", "utf8"),
|
|
3468
4069
|
)
|
|
3469
4070
|
.rescue(Null)
|
|
3470
4071
|
.end(),
|
|
4072
|
+
succeededAttempt,
|
|
3471
4073
|
})
|
|
3472
4074
|
|
|
3473
4075
|
const child = spawn(
|
|
@@ -3499,13 +4101,18 @@ if (isComputerOnFire()) {
|
|
|
3499
4101
|
child.unref()
|
|
3500
4102
|
}
|
|
3501
4103
|
|
|
4104
|
+
// eslint-disable-next-line sonarjs/class-name
|
|
3502
4105
|
class falsejs {
|
|
4106
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
3503
4107
|
static False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
|
|
4108
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
3504
4109
|
static isFalse = variableHolder._FalseJSIsFalse
|
|
4110
|
+
// eslint-disable-next-line no-underscore-dangle, perfectionist/sort-classes
|
|
3505
4111
|
static injectIntojQuery = variableHolder._FalseJSjQueryPlugin
|
|
4112
|
+
// eslint-disable-next-line no-underscore-dangle, perfectionist/sort-classes
|
|
3506
4113
|
static expressMiddleware = variableHolder._FalseJSExpressMiddleware
|
|
4114
|
+
// eslint-disable-next-line perfectionist/sort-classes
|
|
3507
4115
|
static COMPATIBILITY_MODE = COMPATIBILITY_MODES
|
|
3508
|
-
// static FalseAsAService = variableHolder.FalseAsAService
|
|
3509
4116
|
|
|
3510
4117
|
constructor() {
|
|
3511
4118
|
immediateError("falsejs is not a constructor", ERROR.TypeError)
|