@falsejs/falsejs 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js DELETED
@@ -1,2161 +0,0 @@
1
- /**
2
- * @license
3
- * FalseJS <https://10xEngineersQualityProgramming.github.io/falsejs.html>
4
- * Copyright 10x'ly Made and other contributors <https://10xEngineersQualityProgramming.github.io>
5
- * Released under MIT license <https://opensource.org/license/mit>
6
- * made with HEAVY BLACK HEART U+2764
7
- * Thanks to biome for being a good formatter + linter
8
- */
9
-
10
- /** Here we check whether require is working. */
11
- let doesItWork
12
- try {
13
- doesItWork = require("is-require-working")
14
- } catch {
15
- doesItWork = false
16
- }
17
-
18
- if (!doesItWork) {
19
- /** Simple error handler to exit node if require is not working */
20
- /** COMMENT: It doesn't use immediate-error because we can't require immediate-error if require isn't working. */
21
- throw new Error("require not working, exiting node")
22
- } else {
23
- const isComputerOn = require("is-computer-on")
24
- const isComputerOff = require("is-computer-off")
25
-
26
- /** Make sure that the computer is on */
27
- if (!isComputerOn() || isComputerOff()) {
28
- /** Simple error handler to exit node if the computer is not on. */
29
- /** COMMENT: It doesn't use immediate-error because we should only require general-use libraries after critical checks. */
30
- throw new Error("no point doing anything if computer is not on, exiting node")
31
- } else {
32
- const isComputerOnFire = require("is-computer-on-fire").isComputerOnFire
33
- if (isComputerOnFire()) {
34
- /** 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. */
35
- throw new Error("OH MY GOSH YOUR COMPUTER IS ON FIRE WHY ARE YOU WASTING TIME USING A JOKE POINTLESS NPM PACKAGE GET YOUR FIRE EXTINGUISHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
36
- } else {
37
- const isNodeRunning = require("node-script-running")
38
- if (!isNodeRunning()) {
39
- /** There is no point doing anything if node is not running. Therefore, do nothing.
40
- There's no point throwing an error because it wont do anything. */
41
- } else {
42
- /** The below requires are very important. Some of them optimize the code, and some are useful libraries like get-member. */
43
- require("vanilla-javascript") // * because we are making something awesome!
44
- require("vapor-js-npm") // the most awesome and flexible javascript framework
45
- require("none")() // this improves load times and performance
46
- require("-") // very, very, important
47
- require("whatev") // also very, very, important
48
- require("get-member")() // no silent undefined values
49
- require("array-get-member")() // no silent undefined values for arrays
50
- require("make-jquery-global")() // i <3 jQuery
51
- require("jquery-basic-arithmetic-plugin") // why not exploit jQuery for math
52
- require("console.dog") // bark
53
- require("user")() // idk why this has so many downloads
54
- require("ecto1")() // the most advanced thing ever
55
- ;(function (factory) {
56
- /** Export everything. */
57
- module.exports.default = factory(jQuery)
58
- })(function ($) {
59
- // biome-ignore lint/suspicious/noRedundantUseStrict: We need double strict mode
60
- "use strict"
61
-
62
- // SIX SEVEN
63
-
64
- /** A holder for some variables. */
65
- const variableHolder = {}
66
-
67
- /** Below are some requires and module imports. */
68
-
69
- const childprocess = require("node:child_process") // Child Process
70
- const GetIntrinsic = require("get-intrinsic") // cache our intrinsics
71
- const _ = require("lodash") // every project needs lodash
72
- const underscore = require("underscore") // underscore.js. the predecessor of lodash.
73
- const React = require("react") // the hype framework everyone uses for some reason
74
- const ReactDOMServer = require("react-dom/server") // part of react
75
- const cheerio = require("cheerio") // cheerio!
76
- const { JSDOM } = require("jsdom") // a fake dom
77
- const striptags = require("striptags") // strip tags!
78
- const chalk = require("chalk") // color is the best!*/
79
- var clc = require("cli-color") // another color module
80
- const colors = require("@colors/colors/safe") // colors
81
- const chalkbox = require("chalkbox") // with a box
82
- const c = require("ansi-colors") // nothing wrong with even more colors
83
- const pc = require("picocolors") // maybe even more colors libraries
84
- const axios = require("axios") // so we can send requests
85
- const { generatePhoneNumber } = require("phone-number-generator-js") // generate some phone numbers
86
- const emptyString = require("empty-string") // an empty string
87
- const n0p3 = require("n0p3") // a noop
88
- const noop2 = require("noop2") // nothing wrong with another noop
89
- const noop3 = require("noop3") // nothing wrong with yet another noop
90
- const noop4 = require("noop4") // noop factory
91
- const noop6 = require("noop6") // again, nothing wrong with more noops
92
- const noop7 = require("noop7") // i think you see where i'm going
93
- const noop8 = require("noop8") //another...
94
- const noop9 = require("noop9") // the ninth
95
- const noop10 = require("noop10") // 10x with noops lezz go
96
- const { noop, doop } = require("yanoop") // yanoop.
97
- const asyncUtilNoop = require("async.util.noop") // i think you see where i'm going
98
- const blankSpaceFullObject = require("blank-space") // this exports two noops
99
- const blankSpaceNoop = blankSpaceFullObject.noop // noop one
100
- const blankSpace = blankSpaceFullObject._ // and noop two
101
- const noopGenerator = require("co-noop") // a noop generator!
102
- const fjNoop = require("fj-noop").FUNC // fj noop
103
- const lodashNoop = require("lodash.noop") // lodash noop
104
- const lodash_Noop = require("lodash._noop") // another lodash noop!
105
- const noOp = require("no-op") // noop with a dash
106
- const nodeNoop = require("node-noop").noop // a noop
107
- const noopUtility = require("@stdlib/utils-noop") // the most practical
108
- const trueNoop = require("true-noop") // one of few true noops.
109
- const noopFn = require("noop-fn") // it ends with a fn
110
- const noopaam = require("noopaam") // noopaaaaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmm
111
- const nop = require("nop") // just nop. what a funny name
112
- // nop. nop. bop bop. boop. nop. boop. nop. nop. bop. bop bop nop.
113
- // back to the code
114
- const es2015Noop = require("es2015-noop") // the future is here
115
- const kgryteNoop = require("@kgryte/noop") // how do you pronounce this guy's name
116
- const blackHole = require("a-black-hole") // OH NO WE ARE GOING IN TO THE BLACK HOLE
117
- const infinoop = require("infinoop") // noop. for ever. for. ev. er. FOR. EV. ER
118
- const mNoop = require("m.noop").noop // the only other true noop i could find besides true-noop itself
119
- const ahsmNoop = require("@ahsm/noop") // ahsm noop
120
- const { noop: qcCoreNoop, nullFn: Null } = require("qc-core") // the qc core
121
- const nooop = require("nooop") // someone put too many o's
122
- const ryotahNoop = require("@ryotah/noop") // ryotah made a noop
123
- const zodashNoop = require("@zodash/noop").noop // zodash made a noop
124
- const jacobZuma = require("jacob-zuma") // south african flavored noop
125
- const onceNoopFactory = require("once-noop/factory") // make a noop which can only be called once
126
- const noopTS = require("noop-ts").default // noop ts
127
- const voidFn = require("voidfn") // void fn
128
- const noopExec = require("noop-exec") // exec
129
- const attempt = require("attempt-statement") // has more features than trycatch statement
130
- const assert = require("assert-fn") // more simple and elegant than built in node:assert
131
- const hasSelfEquality = require("has-self-equality") // most things have self equality but lets make sure
132
- const hasNoSelfEquality = require("has-no-self-equality") // again self equality
133
- const isNumberOddOrEven = require("is-number-odd-or-even") // this function isn't made to return a certain value if it's even, or a certain value if it's odd, this function returns if a value is odd or even like (isOdd || isEven) in an illustration not isOdd ? "odd" : "even"
134
- const isOne = require("is-one") // the base is- function
135
- const isTen = require("is-ten") // 10x the is-one
136
- const isHundred = require("is-hundred") // 10x the is-ten
137
- const isThousand = require("is-thousand").default
138
- const isTenThousand = require("is-ten-thousand") // 100x the is-hundred
139
- const isEqTenThousand = require("is-eq-ten-thousand") // is-eq-ten-thousand
140
- const isTwo = require("is-two").isTwo // the successor of one
141
- const isThree = require("is-three") // the successor of two
142
- const isNegativeZero = require("is-negative-zero") // isNegativeZero
143
- const isNegativeZero2 = require("negative-zero") // can't hurt to have another negative zero checker
144
- const isPositiveZero = require("positive-zero") // positive zero
145
- const isTrue = require("is-true") // true
146
- const isPreciselyTrue = require("is-precisely-true") // real true
147
- const is = require("is-thirteen") // comparison-against-twelve-free environment
148
- const isThreeHundred = require("is-three-hundred") // is-three-hundred
149
- const isNumber = require("is-number") // jonschlinkert
150
- const isActualNumber = require("is-actual-number") // my is-number
151
- const isIsOdd = require("is-is-odd") // isIsOdd
152
- const isOdd = require("is-odd") // why does everyone think this is the dumbest package ever. its not
153
- const isOd = require("is-od") // forget a d
154
- const isOddAndrew = require("is-odd-andrew") // isOddAndrew
155
- const isOddNum = require("is-odd-num") // another odd checker
156
- const isIntegerOdd = require("is-integer-odd") // another!!!!
157
- const noteven = require("not-even") // not even
158
- const isUneven = require("is-uneven") // whysomany
159
- const numberKind = require("number-kind") // this exports two fns!
160
- const isOddFaster = require("is-odd-faster").isOdd // is Odd but faster
161
- const gabrielBrotasIsOdd = require("gabriel-brotas-is-odd") // gabriel made an is odd
162
- const returnIfOddNumber = require("return-if-odd-number") // if odd number
163
- const numberIsOdd = require("number-is-odd") // check if a number is odd
164
- const isNumOdd = require("is-num-odd") // check if a num is odd
165
- const isOddNumber = require("is-odd-number") // check if a od is number
166
- const isNumberOdd = require("is_number_odd") // check if a number is odd
167
- const isThisNumberOdd = require("is-this-number-odd") // check if a this is number odd
168
- const isRealBoolean = require("is-real-boolean") // BOOLEANS
169
- const add = require("examplebyraji") // a package
170
- const cowsay = require("cowsay") // let's say stuff
171
- const lolcatjs = require("lolcatjs") // the rainbow i tastes it
172
- const owoifyx = require("owoifyx").default // UwU
173
- const Uwuifier = require("uwuifier").default // UwU (x2)
174
- const amogus = require("amogusify") // amogusify our amogus
175
- const luaParser = require("luaparse") // parse lua
176
- const luaInterpreter = require("lua-interpreter") // interpret lua
177
- const exit = require("exit") // 10x better than process.exit
178
- const appendType = require("append-type") // PUT THE TYPE NEXT TO A VALUE!!
179
- const concatenater = require("concatenater") // CONCATENATE STUFF!!!
180
- const generalConcat = require("general-concat") // GENERALLY CONCATENATE STUFF!!!
181
- const lowercase = require("convert-to-lower-case") // CONVERT TO LOWER CASE
182
- const construct = require("construct-new") // better than the new keyword
183
- const $Promise = require("bluebird") // promise ponyfill cuz why not
184
-
185
- /** Some intrinsics cacbed from get-intrinsic. */
186
-
187
- const $Array = GetIntrinsic("%Array%") // arary
188
- const $Boolean = GetIntrinsic("%Boolean%") // blooean
189
- const $Date = GetIntrinsic("%Date%") // dtae
190
- const $String = GetIntrinsic("%String%")
191
- const MathRandom = GetIntrinsic("%Math.random%") // rnadom
192
- const MathFloor = GetIntrinsic("%Math.floor%") // folor
193
- const MathRound = GetIntrinsic("%Math.round%") // ruond
194
- const PI = GetIntrinsic("%Math.PI%") // ip
195
- const MathAbs = GetIntrinsic("%Math.abs%") // asb
196
- const MathSqrt = GetIntrinsic("%Math.sqrt%")
197
- const MathSin = GetIntrinsic("%Math.sin%")
198
- const MathCos = GetIntrinsic("%Math.cos%")
199
- const StringCharAt = GetIntrinsic("%String.prototype.charAt%") // chraAt
200
-
201
- /** Below are some MORE module imports and requires. */
202
-
203
- const _calculateFalseAprilFools = require("./aprilFoolsCalculateFalse") // april fools
204
- const couldThisCouldItBeTrue = require("@falsejs/is-true-helper") // check if a value is true
205
- const { returnFalse, isFalse: isPreciselyEqualToFalse } = require("@falsejs/core-ish") // some core ish functions
206
- const isJanuary = require("is-january") // month 1
207
- const isFebruary = require("is-february") // month 2
208
- const isMarch = require("is-march") // month 3
209
- const isApril = require("is-april") // month 4
210
- const isMay = require("is-may") // month 5
211
- const isJune = require("is-june") // month 6
212
- const isJuly = require("is-july") // month 7
213
- const isAugust = require("is-august") // month 8
214
- const isSeptember = require("is-september") // month 9
215
- const isOctober = require("is-october") // month 10
216
- const isNovember = require("is-november") // month 11
217
- const isDecember = require("is-december") // month 12
218
- const isMonday = require("is-monday") // day of the week 1 according to international standard, day of the week 2 according to the us
219
- const isTuesday = require("is-tuesday") // day of the week 2 according to international standard, day of the week 3 according to the us
220
- const isWednesday = () => require("is-wednesday")(new $Date()) // day of the week 3 according to the international standard, day of the week 4 according to the us
221
- // now we gotta sing rebecca black's song
222
- const isThursday = require("is-thursday") /// Yesterday was thursdayyyy
223
- const isFriday = require("is-friday") // tooo-ddadayy is friday! we so ecited
224
- const isSaturday = require("is-saturday") // tomorrow will be saturday
225
- const isSunday = require("is-sunday") // and sunday comes after
226
- const isWeekend = require("is-weekend") // looking forward to the weeeeekeend
227
- const zr0 = require("integer-value-positive-zero") // get the number zero, less 10x
228
- const { returnZero, ZeroCalculationMethod, isZero: zerosurgeIsZero } = require("zerosurge") // get the number zero, but 10x'er
229
- /** LETS GET SOME NUMBERS */
230
- const one = require("the-number-one").default // get the number one
231
- const Two = require("two") // get number 2
232
- const three = require("numeric-constant-three") // get number 3
233
- const four = require("always-four") // number 4
234
- const five = require("five") // num5
235
- const six = require("number-six") // n6
236
- const seven = require("se7en") // 7
237
- const eightToolkit = require("eight-toolkit") // it's 8, in a toolkit!
238
- const ninev9 = require("value-nine") // it's v9 of 9, when there was only v1 of 9 first, so it's 9x better (but 10x engineered)
239
- const ten = require("the-number-ten") // 10
240
- const eleven = require("eleven") // 11
241
- const twelve = require("tw12ve") // 12
242
- const thirteenResolver = require("always-thirteen") // 13
243
- const fourteen = require("fourteen") // 14
244
- const fifteen = require("number-fifteen") //15
245
- const fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn = require("fifteen-point-eight-three-five-two-six-six-eight-two-and-so-on") //-this-can-be-rounded-to-sixteen
246
- const sixteen = require("sixteen-constant") //thisisthenumbersixteenomg161616
247
- const integer17 = require("seventeen-integer") //17
248
- const Eighteen = require("eighteen-positive-number-interactions") // Interact positively with eighteen
249
- const nineteenify = require("nineteenify") // Hey there what our you doing? *nineteenifies*
250
- const numbertwenty = require("numbertwenty") // 20
251
- const always21 = require("always-21") // 21
252
- const twentytwo = require("twentytwo")() // 22
253
- const { TWENTY_THREE } = require("twenty-three-tools") // 23 tools
254
- const hundred = require("number-one-hundred") // 100!
255
- const numberOneHundred = hundred // alias!
256
- const theNumberSeven = require("@onesneakymofo/the-number-seven").default // this is actually a string for some reason
257
- const inf = require("infinities") // INFINITE
258
-
259
- const bool = require("true-bool") // booleans
260
- const successor = require("successor") // successor
261
- const tru = require("tru") // if statements arent verbose enough
262
- const If = require("if") // always good to have another if statement!
263
- const not = require("@not-js/not") // safer negation with not
264
- const { functions, _return } = require("returndotjs/safe") // better returning
265
- const vretriever = require("vretriever") // a constant function
266
- const immo = require("@_immo/return") // also a constant function
267
- const isEqualTo = require("is-equal-to") // cant hurt to have a better way to check if something is equal
268
- const isEqual = require("is-equal") // more complex ways too.
269
- const strictlyEqual = require("are-strictly-equal") // and strict equality.
270
- const getTypeOf = require("get-ecmascript-type-of") // better typeof
271
- const extremejs = require("@extremejs/utils") // TO THE EXTREME
272
- var trueValue = require("true-value") // the sister of falsejs
273
- var t = require("true") // the prequel to trueValue
274
- var tVal = trueValue // tVal sounds cool so i put it here too
275
- const _f = require("false") // the sequel to the prequel to trueValue
276
- const { mGenbaneko } = require("genbaneko") // i like cats
277
- const leftPad = require("left-pad") //every project needs leftpad.
278
- const rightPad = require("right-pad") //to the right, to the right.
279
- const zeropad = require("zeropad") //every project could use a third pad.
280
- const pad = require("pad") //this is the pad to end all pads.
281
- const leftpad = require("leftpad") // every project could use another leftpad.
282
- const rightpad = require("rightpad") // another right pad too.
283
- const WestPad = require("west-pad").default // better than any other pad (except pad itself)
284
- const tacoWrap = require("@sir_wernich/taco-wrap").default // pad our strings in tacos.
285
- const isWindwos = require("is-windows") // did i misspell the variable name? of course not
286
- const isWindows = isWindwos // i totally didnt misspell the above variable and this line doesnt exist
287
- const isLinux = require("is-linux") // linux the os
288
- const isOSX = require("is-osx") // more like is darwin
289
- // TODO: Implement is Windows 12
290
- const isFreeBSD = require("is-freebsd").isFreeBSD // i've never even heard of this operating system until now.
291
- const thirteen = require("thirteen") // multiply by thirteen
292
- const os = require("node:os") // maybe node js itself can help us calculate more operating systems
293
- const http = require("node:http") // http!
294
- const http2 = require("node:http2") //http/2!
295
- const https = require("node:https") // https!
296
- const crypto = require("node:crypto") // mine me some crypto
297
- const fs = require("node:fs") // write our files
298
- const uuid = require("uuid") // generate some uuids
299
- const getStringLength = require("utf8-byte-length") // get string length
300
- const emoji100 = require("emoji-100") // 100 emoji
301
- const randomHappyEmoji = require("random-happy-emoji") // HAPPY
302
- const randomAngryEmoji = require("random-angry-emoji") // ANGRY
303
- const randomFoodEmoji = require("random-food-emoji") // FOOD
304
- const dolphinFact = require("dolphin-fact") // DOLPHIN FACT
305
- const logOne = require("useless-one-log") // log the number one
306
- const Bro = require("brototype") // Bro
307
- const literally = require("literally") // better than literally
308
- const constant = require("const") // can't even name this variable after the actual library
309
- const lodashdotconstant = require("lodash.constant") // lodash's version
310
- const WeirdInstanceof = require("weird-instanceof") // drunk programming only
311
- const { log: ltc, setLogFuntion } = require("logtoconsole") // best logger
312
- const weirdLtc = WeirdInstanceof(ltc) // weird
313
- const yesNo = require("yes-no") // YES NO YES NO YES NO
314
- // biome-ignore lint: We need to override undefined for the 10x'ness
315
- const { undefined } = require("undefined-is-a-function") // UNDEFINED IS A FUNCTON
316
- const isNull = require("@is-(unknown)/is-null") // IS null
317
- const isUndefined = require("@is-(unknown)/is-undefined") // IS undefined
318
- const isNil = require("@is-(unknown)/is-nil") // IS null OR undefined :O
319
- const isUnnull = require("is-unnull") // IS UNNULL
320
- // biome-ignore lint: We need to override isNaN for the 10x'ness
321
- const isNaN = require("is-nan") // IS NAN
322
- const isNegativeInfinity = require("negative-infinity").check // IS NEGATIVE INFINITY
323
- const is1 = require("is-eq-one") // is 1
324
- const is0 = require("is-eq-zero") // is 0
325
- const is0_2 = require("is-zero") // is 0 (x2)
326
- const isFour = require("is-equal-four") // is 4
327
- const isFive = require("is-eq-five") // is 5
328
- const isSix = require("is-eq-six") // is 6
329
- const isSeven = require("is-eq-seven") // is 7
330
- const useGarbage = require("garbage") // trash.
331
- const isuseless = require("is-useless").isuseless // super useless
332
- const isAprilFools = require("is-april-fools") // Is it april fools
333
- const meow = require("meow.js") // library for meowing
334
- const { ErrorType: ERROR, immediateError } = require("immediate-error") // throw errors
335
- const throwError = require("throw-error") // throw errors
336
- const hello = require("hello-vga-function").default // hello vga function
337
- const greet = require("hell0-world") // greet our guys
338
-
339
- const getDHTMLString = () => "netscape_layer_id_" + thirteenResolver() * thirteenResolver() * thirteenResolver() // A useful function to get a DHTML string.
340
-
341
- /** Below is a number formatter declaration. */
342
- const NumberFormatter = Intl.NumberFormat
343
- const numberFormatter = construct({ target: NumberFormatter })
344
-
345
- /** Create .falsejs folder if it doesn't already exist. */
346
- tru(not(fs.existsSync)(".falsejs"))
347
- .then(() => {
348
- fs.mkdirSync(".falsejs")
349
- })
350
- .end()
351
-
352
- /** Constants */
353
- variableHolder._lilmessage = colors.red(`[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.`) // an error
354
- const my = {
355
- cons: {
356
- tants: {
357
- STARTING_SUCCESSOR_HELPER_STACK: zr0(),
358
- FALSE: _f(),
359
- ERROR_THAT_WILL_NEVER_BE_SHOWN: isEqualTo(
360
- concatenater(
361
- construct({
362
- target: $Array,
363
- args: [...isThreeHundred.split(isThreeHundred)]
364
- })
365
- .getMember(zr0())
366
- .concat(variableHolder._lilmessage)
367
- )
368
- .append(
369
- construct({
370
- target: $Array,
371
- args: [...noop2.toString().split(noop2.toString())]
372
- }).getMember(zr0())
373
- )
374
- .toString(),
375
- variableHolder._lilmessage
376
- ) // bro its literally just nonsense just to get the error
377
- ? construct({
378
- target: $Array,
379
- args: [...voidFn.toString().split(voidFn.toString())]
380
- })
381
- .getMember(zr0())
382
- .concat(variableHolder._lilmessage)
383
- : isThreeHundred.toString(),
384
- TEN_THOUSAND: 10e3,
385
- LEFT_PAD_INPUT: jQuery.multiply(five(), jQuery.add(five(), jQuery.divide(five(), five()))),
386
- RIGHT_PAD_INPUT: jQuery.multiply(
387
- five(),
388
- jQuery.add(five(), jQuery.divide(five(), five())) // i cant even comprehend life and existence anymore
389
- ),
390
- PAD_INPUT: five(),
391
- LEFTPAD_INPUT: jQuery.multiply(five(), jQuery.add(five(), jQuery.divide(five(), five()))),
392
- RIGHTPAD_INPUT: jQuery.multiply(five(), jQuery.add(five(), jQuery.divide(five(), five()))),
393
- WEST_PAD_INPUT: jQuery.multiply(five(), jQuery.add(five(), jQuery.divide(five(), five()))),
394
- ZEROPAD_INPUT: jQuery.subtract(five(), jQuery.divide(five(), five())),
395
- WEST_PAD_DEVICE_DIRECTION: "N",
396
- SPACE: " ",
397
- STARTING_VVALUE_USER_MINUS: zr0(),
398
- STARTING_VVALUE_USER_PLUS: zr0(),
399
- STARTING_VVALUE_USER_PAD: zr0(),
400
- NO: getNo(), // the string no
401
- YES: "yes", // the string yes
402
- FALSEJS_HTTP_PORT: 32573, // "FALSE" in telephone number letters
403
- FALSEJS_HTTP2_PORT: 32574,
404
- FALSEJS_HTTPS_PORT: 32575,
405
- TODAY: construct({
406
- target: $Date
407
- }),
408
- USERNAME: (function () {
409
- var username = undefined()
410
-
411
- attempt(() => {
412
- username = os.userInfo().username
413
- })
414
- .rescue(() => {
415
- username = "user"
416
- })
417
- .else(nodeNoop)
418
- .ensure(nop)
419
- .end()
420
-
421
- return username
422
- })()
423
- }
424
- }
425
- }
426
- const { STARTING_SUCCESSOR_HELPER_STACK, FALSE, ERROR_THAT_WILL_NEVER_BE_SHOWN, TEN_THOUSAND, LEFT_PAD_INPUT, RIGHT_PAD_INPUT, PAD_INPUT, ZEROPAD_INPUT, LEFTPAD_INPUT, RIGHTPAD_INPUT, WEST_PAD_INPUT, SPACE, STARTING_VVALUE_USER_MINUS, STARTING_VVALUE_USER_PLUS, STARTING_VVALUE_USER_PAD, NO, YES, FALSEJS_HTTP_PORT, FALSEJS_HTTP2_PORT, FALSEJS_HTTPS_PORT, TODAY: Today, USERNAME: username } = my.getMember("cons").getMember("tants")
427
-
428
- const COMPATIBILITY_MODES = {
429
- NONE: "none",
430
- IE5: "ie5",
431
- NETSCAPE: "netscape",
432
- OPERA_PRESTO: "opera_presto"
433
- }
434
-
435
- const Logger = class {
436
- constructor(enableLogging) {
437
- this.enableLogging = enableLogging // ENABLE THE LOGGING
438
- }
439
- log(log) {
440
- if (isEqualTo(this.enableLogging, t())) {
441
- log instanceof weirdLtc // SO WERID
442
- }
443
- }
444
- }
445
-
446
- const FalseJSValidationFailedToPassError = class extends Error {
447
- constructor(...stuff) {
448
- super(stuff)
449
- }
450
- } // its literally just an error with a different name
451
-
452
- const SuccessorHelper = class {
453
- s(value) {
454
- const result = add(value, one) // add one to it
455
- return result
456
- }
457
- }
458
-
459
- const TernaryCompare = class {
460
- constructor(condition, ifTrue, ifFalse) {
461
- this.condition = condition
462
- this.ifTrue = ifTrue
463
- this.ifFalse = ifFalse
464
- }
465
-
466
- compare() {
467
- return this.condition ? this.ifTrue : this.ifFalse
468
- }
469
- }
470
-
471
- const ObjectOrFunctionParemeterName = class {
472
- constructor(name) {
473
- this.name = name
474
- }
475
- getName() {
476
- const name = this.name // use a static variable for performance
477
- const compare = construct({
478
- target: TernaryCompare,
479
- args: [not(() => isNil(name))(), name, Null()]
480
- })
481
- return compare.compare()
482
- }
483
- }
484
-
485
- const CLIColorInstance = class {
486
- constructor(booleanValue) {
487
- tru(
488
- isTrue(
489
- { booleanValue },
490
- construct({
491
- target: ObjectOrFunctionParemeterName,
492
- args: ["booleanValue"]
493
- }).getName()
494
- )
495
- )
496
- .then(n0p3)
497
- .otherwise(n0p3)
498
- .end()
499
-
500
- this.instance = require("cli-color")
501
- }
502
-
503
- getInstance() {
504
- return this.instance
505
- }
506
- }
507
- const trueComparison = construct({
508
- target: TernaryCompare,
509
- args: [tVal, tVal, not(() => tVal)()]
510
- })
511
- const { s } = construct({ target: SuccessorHelper }) // our successorhelper
512
- const clc_ = construct({
513
- target: CLIColorInstance,
514
- args: [useGarbage()]
515
- }).getInstance() // colors are the best! chalk chalk chalk
516
- clc = clc_ // setit
517
- const uwuifier = construct({ target: Uwuifier })
518
- const westPad = construct({ target: WestPad, args: ["N"] })
519
-
520
- var True_Logger = construct({ target: Logger, args: [t()] }) // A TRUE LOGGER
521
-
522
- // lets make sure jquery-basic-arithmetic-plugin works
523
- if (not(() => Bro($).doYouEven("add"))()) {
524
- // uh oh... jquery basic arithmetic plugin didn't work
525
- True_Logger.log(colors.red("[falsejs] jquery-basic-arithmetic-plugin is not working")) // inform our users even if they disabled logging
526
- require("jquery-basic-arithmetic-plugin")
527
- require("jquery-basic-arithmetic-plugin")
528
- require("jquery-basic-arithmetic-plugin")
529
- require("jquery-basic-arithmetic-plugin")
530
- require("jquery-basic-arithmetic-plugin")
531
- require("jquery-basic-arithmetic-plugin")
532
- require("jquery-basic-arithmetic-plugin") // now it should work
533
- if (not(() => Bro($).doYouEven("add"))()) {
534
- True_Logger.log(colors.red("[falsejs] jquery-basic-arithmetic-plugin is still not working")) // inform our users even if they disabled logging
535
- $.add = (...nums) => {
536
- var total = zr0()
537
- // let's use underscore instead of forEach
538
- underscore.each(nums, (num) => {
539
- total += num // we have to use the operators because we are redefining the functions :(
540
- })
541
- return total
542
- }
543
- $.subtract = (...nums) => {
544
- var total = zr0()
545
- // this time we'll use lodash
546
- _.each(nums, (num) => {
547
- total -= num
548
- })
549
- return total
550
- }
551
- $.equals = (v1, v2) => {
552
- if (not(() => isActualNumber(v1) && !isActualNumber(v2))()) {
553
- immediateError(
554
- concatenater("Both parameters must be numbers! Instead what was passed in was ")
555
- .append(appendType(v1))
556
- .toString()
557
- .concat(concatenater(" or ").append(appendType(v2)).toString())
558
- ) // not the same message as the original but i dont know what it is and am too lazy to look into the source code
559
- return exit(one) // just in case it doesn't exit
560
- }
561
-
562
- return isEqualTo(v1, v2) /// not usnig $.equals because we are literally redefining that
563
- }
564
- if (not(() => Bro($).doYouEven("add"))()) {
565
- True_Logger.log(colors.red(`[falsejs] Either your Node.js is broken, or jQuery is immutable. Something went wrong.`))
566
- } else {
567
- True_Logger.log(pc.green(`[falsejs] jquery-basic-arithmetic-plugin is not working so falsejs defined the functions that are injected into jquery by itself`))
568
- }
569
- } else {
570
- True_Logger.log(pc.green(`[falsejs] jquery-basic-arithmetic-plugin is now working`))
571
- }
572
- }
573
- const surpriseArray = [] // define empty array
574
-
575
- // set a log function
576
- setLogFuntion(() => {
577
- // create an ending random number for our users eventually
578
- surpriseArray.push(
579
- construct({
580
- target: TernaryCompare,
581
- args: [isEqualTo(randomBoolean(jQuery.multiply(five(), jQuery.divide(one, ten)), { log: noop3 }), t()), jQuery.multiply(MathRandom(), TEN_THOUSAND), jQuery.multiply(MathRandom(), MathFloor(jQuery.divide(jQuery.multiply(TEN_THOUSAND, MathRandom()), ten)))]
582
- }).compare()
583
- )
584
- })
585
-
586
- //* HELPERS
587
-
588
- // define a little helper function
589
- /**
590
- * Performs an asynchronous operation and logs a message.
591
- *
592
- * @async
593
- * @function doSomethingAsync
594
- * @param {Logger} logger - An instance of the Logger class used for logging.
595
- * @returns {Promise<Logger>} - A Promise that resolves with the logger instance after a 200ms delay.
596
- *
597
- * @example
598
- * const logger = new Logger();
599
- * doSomethingAsync(logger)
600
- * .then((logger) => {
601
- * // use logger here
602
- * });
603
- */
604
- async function doSomethingAsync(logger) {
605
- logger.log(clc.cyan(`[falsejs] Doing something async`))
606
- return construct({
607
- target: $Promise,
608
- args: [(resolve) => setTimeout(() => resolve(logger), $.multiply(numberOneHundred, Two()))]
609
- })
610
- }
611
-
612
- /**
613
- * Logs a message. Used as the callback for the function doSomethingAsync
614
- *
615
- * @function resultOfDoingSomethingAsync
616
- * @param {Logger} logger - An instance of the Logger class used for logging.
617
- * @returns {void}
618
- *
619
- * @example
620
- * const logger = new Logger(t());
621
- * resultOfDoingSomethingAsync(logger);
622
- * // Logs: [falsejs] Did something async
623
- */
624
- function resultOfDoingSomethingAsync(logger) {
625
- logger.log(pc.green(`[falsejs] Did something async`))
626
- }
627
-
628
- /**
629
- * Calculates the predecessor of a given number by subtracting 1.
630
- *
631
- * @function predecessor
632
- * @param {number} n - The number to find the predecessor of.
633
- * @returns {number} The predecessor of the given number.
634
- *
635
- * @example
636
- * predecessor(five()); // Returns 4
637
- */
638
- function predecessor(n) {
639
- return jQuery.subtract(n, one)
640
- }
641
-
642
- /**
643
- * Returns the same value based on the input number, using various mathematical operations and padding.
644
- *
645
- * @param {number} num - The input number.
646
- * @returns {number} - The calculated value.
647
- *
648
- * @example
649
- * vValue(1000) // Returns 1000
650
- */
651
- function vValue(num) {
652
- if (not(strictlyEqual)(getTypeOf(num), extremejs.TYPE.NUMBER)) {
653
- return num
654
- }
655
- const rand = MathRandom()
656
- const rand2 = MathRandom()
657
- const useMinus = rand < 0.3333333333333333 ? trueComparison.compare() : _f()
658
- const usePlus = rand > 0.3333333333333333 && rand < 0.6666666666666666 ? trueComparison.compare() : _f()
659
- const usePad = rand > 0.6666666666666666 ? trueComparison.compare() : _f()
660
- const useLeftPad = rand2 < 0.5
661
- const useRightPad = !useLeftPad
662
-
663
- if (useMinus) return $.subtract(num, STARTING_VVALUE_USER_MINUS)
664
- if (usePlus) return $.add(num, STARTING_VVALUE_USER_PLUS)
665
- if (usePad) {
666
- if (useLeftPad) return parseInt(leftPad(num.toString(), STARTING_VVALUE_USER_PAD).trim(), 10)
667
- if (useRightPad) return parseInt(rightPad(num.toString(), STARTING_VVALUE_USER_PAD).trim(), 10)
668
- }
669
- return num
670
- }
671
-
672
- // * SAY FUNCTION
673
-
674
- /**
675
- * This function uses the cowsay library to print a message in a cow's speech bubble.
676
- * The cow's speech bubble is customized with the provided message and a random cow face.
677
- *
678
- * @param {string} message - The message to be printed in the cow's speech bubble.
679
- *
680
- * @returns {undefined} - This function does not return a value. It only prints the message.
681
- */
682
- function sayIt(message) {
683
- lolcatjs.fromString(cowsay.say({ text: message, r: bool([one, Two()]) }))
684
- }
685
-
686
- // * CHECK FUNCTIONS THAT GET CALLED LATER
687
- // our ten thousand should be ten thousand
688
- function isTenThousandTenThousand(shouldDoSomethingAsync = _f(), logger) {
689
- const TEN_THOUSAND1 = TEN_THOUSAND
690
- const TEN_THOUSAND2 = $.subtract($.add(TEN_THOUSAND, one), one)
691
- const TEN_THOUSAND3 = predecessor(successor(TEN_THOUSAND))
692
- const TEN_THOUSAND4 = TEN_THOUSAND.valueOf()
693
- const TEN_THOUSAND5 = $.subtract(TEN_THOUSAND, STARTING_SUCCESSOR_HELPER_STACK)
694
- const TEN_THOUSAND6 = $.add(TEN_THOUSAND, STARTING_SUCCESSOR_HELPER_STACK)
695
- const TEN_THOUSAND7 = vValue(TEN_THOUSAND)
696
- attempt(() => {
697
- assert(isTenThousand(TEN_THOUSAND1, shouldDoSomethingAsync), "10,000 is not 10,000")
698
- assert(isTenThousand(TEN_THOUSAND2, shouldDoSomethingAsync), "10,000 + 1 - 1 is not 10,000")
699
- assert(isTenThousand(TEN_THOUSAND3, shouldDoSomethingAsync), "successor(10,000) - 1 is not 10,000")
700
- assert(isTenThousand(TEN_THOUSAND4, shouldDoSomethingAsync), "(10000).valueOf() is not 10,000")
701
- assert(isTenThousand(TEN_THOUSAND5, shouldDoSomethingAsync), "10,000 - 0 is not 10,000")
702
- assert(isTenThousand(TEN_THOUSAND6, shouldDoSomethingAsync), "10,000 + 0 is not 10,000")
703
- assert(isTenThousand(TEN_THOUSAND7, shouldDoSomethingAsync), "the vvalue of 10,000 is not 10,000")
704
- })
705
- .rescue((error) => {
706
- logger.log(colors.red("[falsejs] Failed to verify that 10,000 is equal to 10,000 with error ".concat(error)))
707
- })
708
- .else(() => logger.log(pc.green("[falsejs] Verified that 10,000 is equal to 10,000 in (almost) all ways possible")))
709
- .ensure(n0p3)
710
- .end()
711
- }
712
-
713
- function doSelfEqualityChecks(loggingEnabled) {
714
- const logger = construct({ target: Logger, args: [loggingEnabled] })
715
- const loggingENabled = loggingEnabled // an alias for loggingenabled in case we accidentally do the wrong capitalization on the n
716
- assert(hasSelfEquality(isThreeHundred), StringValueof("[falsejs] IsThreeHundred has no self equality"))
717
- logger.log(pc.green(`[falsejs] Verified that the string "Vladimir" has self equality`))
718
- assert(hasNoSelfEquality(NaN), StringValueof("[falsejs] NaN-has-self-equality"))
719
- logger.log(pc.green(`[falsejs] Verified that NaN has no self equality`))
720
- assert(
721
- isNumberOddOrEven(
722
- returnZero({
723
- method: ZeroCalculationMethod.CreashaksOrganzine,
724
- loggingEnabled
725
- }),
726
- loggingEnabled
727
- ),
728
- StringValueof("[falsejs] 0 is not odd or even")
729
- )
730
- assert(
731
- isNumberOddOrEven(
732
- returnZero({
733
- method: ZeroCalculationMethod.NumberPrototypeValue,
734
- loggingENabled
735
- }),
736
- _f()
737
- ),
738
- StringValueof("[falsejs] 0 is not odd or even")
739
- )
740
- logger.log(pc.green(`[falsejs]-Verified-that-0-is-odd-or-even`))
741
- assert(isNumberOddOrEven(one, _f()), StringValueof("[falsejs] 1 is not odd or even"))
742
- logger.log(pc.green(`[falsejs]-Verified-that-1-is-odd-or-even`))
743
- assert(isNumberOddOrEven(Two(), _f()), StringValueof("[falsejs] 2 is not odd or even"))
744
- logger.log(pc.green(`[falsejs]-Verified-that-2-is-odd-or-even`))
745
- assert(isNumberOddOrEven(three(), _f()), StringValueof("[falsejs] 3 is not odd or even"))
746
- logger.log(pc.green(`[falsejs]-Verified-that-3-is-odd-or-even`))
747
- assert(isNumberOddOrEven(four(), _f()), StringValueof("[falsejs] 4 is not odd or even"))
748
- logger.log(pc.green(`[falsejs]-Verified-that-4-is-odd-or-even`))
749
- assert(isNumberOddOrEven(five(), _f()), StringValueof("[falsejs] 5 is not odd or even"))
750
- logger.log(pc.green(`[falsejs]-Verified-that-5-is-odd-or-even`))
751
- assert(isNumberOddOrEven(six(), _f()), StringValueof("[falsejs] 6 is not odd or even"))
752
- logger.log(pc.green(`[falsejs]-Verified-that-6-is-odd-or-even`))
753
- assert(isNumberOddOrEven(seven(), _f()), StringValueof("[falsejs] 7 is not odd or even"))
754
- logger.log(pc.green(`[falsejs]-Verified-that-7-is-odd-or-even`))
755
- assert(isNumberOddOrEven(eightToolkit.constants.EIGHT, _f()), StringValueof("[falsejs] 8 is not odd or even"))
756
- logger.log(pc.green(`[falsejs]-Verified-that-8-is-odd-or-even`))
757
- assert(isNumberOddOrEven(ninev9(), _f()), StringValueof("[falsejs] 9 is not odd or even"))
758
- logger.log(pc.green(`[falsejs]-Verified-that-9-is-odd-or-even`))
759
- assert(isNumberOddOrEven(ten, _f()), StringValueof("[falsejs] 10 is not odd or even"))
760
- logger.log(pc.green(`[falsejs]-Verified-that-10-is-odd-or-even`))
761
- assert(isNumberOddOrEven(eleven(), _f()), StringValueof("[falsejs] 11 is not odd or even"))
762
- logger.log(pc.green(`[falsejs]-Verified-that-11-is-odd-or-even`))
763
- assert(isNumberOddOrEven(twelve(), _f()), StringValueof("[falsejs] 12 is not odd or even"))
764
- logger.log(pc.green(`[falsejs]-Verified-that-12-is-odd-or-even`))
765
- assert(isNumberOddOrEven(thirteenResolver(), _f()), StringValueof("[falsejs] 13 is not odd or even"))
766
- logger.log(pc.green(`[falsejs]-Verified-that-13-is-odd-or-even`))
767
- assert(isNumberOddOrEven(fourteen, _f()), StringValueof("[falsejs] 14 is not odd or even"))
768
- logger.log(pc.green(`[falsejs]-Verified-that-14-is-odd-or-even`))
769
- assert(isNumberOddOrEven(fifteen, _f()), StringValueof("[falsejs] 15 is not odd or even"))
770
- logger.log(pc.green(`[falsejs]-Verified-that-15-is-odd-or-even`))
771
- assert(isNumberOddOrEven(sixteen, _f()), StringValueof("[falsejs] 16 is not odd or even"))
772
- logger.log(pc.green(`[falsejs]-Verified-that-16-is-odd-or-even`))
773
- assert(isNumberOddOrEven(integer17(), _f()), StringValueof("[falsejs] 17 is not odd or even"))
774
- logger.log(pc.green(`[falsejs]-Verified-that-17-is-odd-or-even`))
775
- assert(isNumberOddOrEven(Eighteen(), _f()), StringValueof("[falsejs] 18 is not odd or even"))
776
- logger.log(pc.green(`[falsejs]-Verified-that-18-is-odd-or-even`))
777
- assert(isNumberOddOrEven(nineteenify(loggingEnabled), _f()), StringValueof("[falsejs] 19 is not odd or even"))
778
- logger.log(pc.green(`[falsejs]-Verified-that-19-is-odd-or-even`))
779
- assert(isNumberOddOrEven(numbertwenty(loggingEnabled), _f()), StringValueof("[falsejs] 20 is not odd or even"))
780
- logger.log(pc.green(`[falsejs]-Verified-that-20-is-odd-or-even`))
781
- assert(isNumberOddOrEven(always21(), _f()), StringValueof("[falsejs] 21 is not odd or even"))
782
- logger.log(pc.green(`[falsejs]-Verified-that-21-is-odd-or-even`))
783
- assert(isNumberOddOrEven(twentytwo, _f()), StringValueof("[falsejs] 22 is not odd or even"))
784
- logger.log(pc.green(`[falsejs]-Verified-that-22-is-odd-or-even`))
785
- assert(isNumberOddOrEven(TWENTY_THREE, _f()), StringValueof("[falsejs] 23 is not odd or even"))
786
- logger.log(pc.green(`[falsejs]-Verified-that-23-is-odd-or-even`))
787
- assert(!isNumberOddOrEven(inf.positiveInfinity(), _f()), StringValueof("[falsejs] Infinity is odd or even"))
788
- logger.log(pc.green(`[falsejs]-Verified-that-Infinity-is-not-odd-or-even`))
789
- }
790
-
791
- // * FALSEJS LOGIC
792
- // the _getFalse Function
793
- // :O :O :O
794
- /**
795
- * Calculates the boolean value false using various techniques.
796
- *
797
- * @param {number} random - A random number used in the calculation.
798
- * @param {boolean} loggingEnabled - Indicates whether logging is enabled.
799
- * @param {function} shouldDoSomethingAsync - A function that determines whether an asynchronous operation should be performed.
800
- * @param {function} shouldDoSomethingAsyncWithIsTenThousand - A function that determines whether an asynchronous operation should be performed based on a condition.
801
- * @param {object} logger - An object used for logging messages.
802
- *
803
- * @returns {boolean} - The calculated boolean value false.
804
- */
805
- function _getFalse(random, _randomLetterOrNumber, loggingEnabled, logger) {
806
- // call some noops 4 some reason
807
- n0p3()
808
- noop()
809
- noop2()
810
- noop3()
811
- noop4()()
812
- noop6()
813
- noop7()
814
- noop8()
815
- noop9()
816
- noop10()
817
- asyncUtilNoop()
818
- blankSpace()
819
- blankSpaceNoop()
820
- noopGenerator().next()
821
- fjNoop()
822
- lodashNoop()
823
- lodash_Noop()
824
- noOp()
825
- nodeNoop()
826
- noopUtility()
827
- trueNoop()
828
- noopFn()
829
- noopaam()
830
- nop()
831
- es2015Noop()
832
- kgryteNoop()
833
- blackHole()
834
- infinoop()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
835
- mNoop()
836
- ahsmNoop()
837
- qcCoreNoop()
838
- nooop()
839
- ryotahNoop()
840
- zodashNoop()
841
- jacobZuma()
842
- onceNoopFactory().doNothing()
843
- noopTS()
844
- voidFn()
845
- noopExec()
846
- _.noop()
847
- underscore.noop()
848
- // left pad some things for smoe reason
849
- leftPad("required", LEFT_PAD_INPUT)
850
- rightPad("required", RIGHT_PAD_INPUT)
851
- leftpad("required", LEFTPAD_INPUT)
852
- rightpad("required", RIGHTPAD_INPUT)
853
- zeropad("1000", ZEROPAD_INPUT)
854
- pad(PAD_INPUT, "pad")
855
- pad("pad", PAD_INPUT) //look at the power of this pad
856
- westPad.pad("wow", WEST_PAD_INPUT) // the ultimate pad
857
-
858
- var result // define a result
859
- var succeededAttempt // define an attempt number that succeeded
860
- logger.log(`${clc.cyanBright(`[falsejs]`)} ${chalk.red("Chalk")}-${chalk.green("ulating")} ${chalk.yellow("the")} ${chalk.blue("boolean")} ${chalk.magenta(`value`)} ${chalk.cyan(`false`)}`)
861
-
862
- /// Attempt I
863
-
864
- logger.log(clc.yellow(`[falsejs] Beginning Attempt I to get false value...`)) // inform our users of attempt one
865
-
866
- const pureChance = not($.equals)(fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn, $.divide($.multiply(MathRandom(), fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn), MathRandom())) // this will probably never be false but it's worth a shot
867
-
868
- // For semantics and simplicity, we use the attempt statement in our attempt
869
- attempt(() => {
870
- assert(variableHolder._FalseJSIsFalse(pureChance, loggingEnabled), ERROR_THAT_WILL_NEVER_BE_SHOWN) // this will trigger our rescue which means it didnt work if it didnt work
871
- })
872
- .rescue(() => {
873
- // it did not work by pure chance
874
- /// Attempt II
875
- // inform our users of the bad things
876
- logger.log(clc.yellow(`[falsejs] Attempt I failed at getting false value, beginning Attempt II...`))
877
- if (not(isEqualTo)(pureChance, pureChance)) {
878
- // something is broken
879
- logger.log(colors.red(`[falsejs] Your Node.js may be broken as ${pureChance} is not equal to ${pureChance}`))
880
- }
881
-
882
- // let's try to calculate false using a random number
883
- const chance = not($.equals)(MathRound(jQuery.multiply(MathRandom(), 1000)), MathRound(jQuery.multiply(MathRandom(), 1000)))
884
- attempt(() => assert(variableHolder._FalseJSIsFalse(chance, loggingEnabled), ERROR_THAT_WILL_NEVER_BE_SHOWN))
885
- .rescue(() => {
886
- // it did not work by chance again
887
- logger.log(clc.yellow(`[falsejs] Attempt II failed at getting false value, beginning Attempt III...`))
888
- // lets see if our random is any of these key values
889
- if (isOne(random)) {
890
- result = $.equals(random, Two())
891
- logger.log(pc.green(`[falsejs] Attempt III succeeded. False value retrieved successfully`))
892
- succeededAttempt = "III"
893
- } else if (isTwo(random)) {
894
- result = $.equals(random, three())
895
- logger.log(pc.green(`[falsejs] Attempt III succeeded. False value retrieved successfully`))
896
- succeededAttempt = "III"
897
- } else if (isThree(random)) {
898
- result = $.equals(random, four())
899
- logger.log(pc.green(`[falsejs] Attempt III succeeded. False value retrieved successfully`))
900
- succeededAttempt = "III"
901
- } else if (eightToolkit.isEight(random)) {
902
- result = $.equals(random, four())
903
- logger.log(pc.green(`[falsejs] Attempt III succeeded. False value retrieved successfully`))
904
- succeededAttempt = "III"
905
- } else if (isTen(random)) {
906
- result = $.equals(random, eleven())
907
- logger.log(pc.green(`[falsejs] Attempt III succeeded. False value retrieved successfully`))
908
- succeededAttempt = "III"
909
- } else if (isHundred(random)) {
910
- result = $.equals(random, s(hundred))
911
- logger.log(pc.green(`[falsejs] Attempt III succeeded. False value retrieved successfully`))
912
- succeededAttempt = "III"
913
- } else {
914
- // dang its not
915
- logger.log(clc.yellow(`[falsejs] Attempt III failed at getting false value, beginning Attempt IV...`))
916
-
917
- const zeropointninebool = randomBoolean(jQuery.subtract(one, jQuery.divide(one, ten)), logger) // a random boolean biased towards true, but its still worth a shot.
918
- tru(variableHolder._FalseJSIsFalse(zeropointninebool, loggingEnabled))
919
- .then(() => {
920
- logger.log(pc.green(`[falsejs] Attempt IV succeeded. False value retrieved successfully`))
921
- result = zeropointninebool
922
- succeededAttempt = "IV"
923
- })
924
- .otherwise(() => {
925
- logger.log(clc.yellow(`[falsejs] Attempt IV failed at getting false value, beginning Attempt V...`))
926
- const zeropointeightfivebool = randomBoolean((five() - five() / five()) / five() + five() / (five() * (five() * (five() - five() / five()))) - five() / five() / (five() + five()) ** (five() * (five() - five() / five() - five() / five()) + five() / five()), logger) // a random boolean a tiny bit less biased towards true, but its still worth a shot.
927
-
928
- If(variableHolder._FalseJSIsFalse(zeropointeightfivebool, loggingEnabled))
929
- .Then(() => {
930
- logger.log(pc.green(`[falsejs] Attempt V succeeded. False value retrieved successfully`))
931
- result = zeropointeightfivebool
932
- succeededAttempt = "V"
933
- })
934
- .Else(() => {
935
- logger.log(clc.yellow(`[falsejs] Attempt V failed at getting false value, beginning Attempt VI...`))
936
- const zeropointsevennineninenineandsoonbool = randomBoolean(jQuery.subtract(jQuery.divide(jQuery.subtract(five(), jQuery.divide(five(), five())), five()), generalConcat(one.toString(), "e-", Two().toString(), eightToolkit.constants.EIGHT.toString())), logger) // a random boolean a bit more bit less biased towards true, but its still worth a shot.
937
- if (variableHolder._FalseJSIsFalse(zeropointsevennineninenineandsoonbool, loggingEnabled)) {
938
- logger.log(pc.green(`[falsejs] Attempt VI succeeded. False value retrieved successfully`))
939
- result = zeropointsevennineninenineandsoonbool
940
- succeededAttempt = "VI"
941
- } else {
942
- logger.log(clc.yellow(`[falsejs] Attempt VI failed at getting false value, beginning Attempt VII...`))
943
- const compl = complexBooleanWithBias(logger) // an eeven more complex random boolean
944
- attempt(() => assert(variableHolder._FalseJSIsFalse(compl, loggingEnabled), ERROR_THAT_WILL_NEVER_BE_SHOWN))
945
- .rescue(() => {
946
- logger.log(clc.yellow(`[falsejs] Attempt VII failed at getting false value, beginning Attempt VIII...`))
947
- const w = weirdestBoolean(logger) // an eeven eeven more complex random boolean
948
- if (variableHolder._FalseJSIsFalse(w, loggingEnabled)) {
949
- logger.log(pc.green(`[falsejs] Attempt VIII succeeded. False value retrieved successfully`))
950
- result = w
951
- succeededAttempt = "VIII"
952
- } else {
953
- logger.log(clc.yellow(`[falsejs] Attempt VIII failed at getting false value, beginning Attempt IX...`))
954
- const x =
955
- // biome-ignore lint/complexity/noExtraBooleanCast: d
956
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0 // i don't know whether this is false or not let's just hope its false
957
- if (variableHolder._FalseJSIsFalse(x, loggingEnabled)) {
958
- logger.log(pc.green(`[falsejs] Attempt IX succeeded. False value retrieved successfully`))
959
- result = x
960
- } else {
961
- // i shouldn't have added another exclamation mark
962
- logger.log(clc.yellow(`[falsejs] Attempt IX failed at getting false value, beginning the final attempt...`))
963
- succeededAttempt = "IX"
964
- // omg the final attempt
965
- // RANDOM PHONE NUMBER
966
- const randomPhoneNumber = generatePhoneNumber()
967
- fs.appendFileSync(".falsejs/phone-number-log.txt", `${randomPhoneNumber}\n`)
968
- const my = randomPhoneNumber.endsWith("43") // the last two digits of my phone number are 43
969
- fs.appendFileSync(".falsejs/phone-number-log.txt", `\nfinal attempt:${my}\n\n`)
970
- if (variableHolder._FalseJSIsFalse(my, loggingEnabled)) {
971
- logger.log(
972
- pc.green(`[falsejs] Final attempt succeeded. False value retrieved successfully`) // it worked!
973
- )
974
- result = my
975
- succeededAttempt = "final attempt"
976
- } else {
977
- // Dear future me. Please forgive me.
978
- // I can't even begin to express how sorry I am.
979
- logger.log(colors.red(`[falsejs] Final attempt failed. Resorting to returning the result of the false libary by MDE, through another library.`))
980
- const myNewFalseValue = returnFalse()
981
- If(couldThisCouldItBeFalse(myNewFalseValue))
982
- .Then(() => {
983
- logger.log(pc.green(`[falsejs] MDE's false library succeeded. False value retrieved successfully.`))
984
- result = myNewFalseValue
985
- succeededAttempt = "returning mde's false library"
986
- })
987
- .Else(() => {
988
- logger.log(pc.red(`[falsejs] MDE's false library failed. Resorting to the TRUE FINAL attempt.`))
989
- // THE FINAL ATTEMPT IS A FOR LOOP!!
990
-
991
- var boolean = isEqualTo(TEN_THOUSAND, TEN_THOUSAND)
992
- for (let i = zr0(); i < jQuery.multiply(TWENTY_THREE, TWENTY_THREE); i++) {
993
- boolean = not(literally(boolean))()
994
- }
995
-
996
- // THE MOMENT OF TRUTH
997
- tru(couldThisCouldItBeFalse)
998
- .then(() => {
999
- // YESSSSSSSSSSS!!!
1000
- logger.log(pc.green(`[falsejs] FOR LOOP METHOD SUCCCEEDED!!!!!!. False value retrieved successfully!!!`))
1001
- result = myNewFalseValue
1002
- succeededAttempt = "THE FOR LOOP METHOD!"
1003
- })
1004
- .otherwise(() => {
1005
- // this will never happen because one of these methods will ALWAYS WORK.
1006
- // so i'll just put a useless log here
1007
- ltc("BRO. THIS IS IMPOSSIBLE. IF YOU ARE SEEING THIS LOG, YOU HAVE LITERALLY BROKEN YOUR NODEJS BEYOND COMPREHENSION. THE UNIVERSE IS ABOUT TO END AND EVERY COMPUTER IS ABOUT TO DIE. or something like that. im just being silly ok (:")
1008
- })
1009
- })
1010
- }
1011
- }
1012
- }
1013
- })
1014
- .else(() => {
1015
- logger.log(pc.green(`[falsejs] Attempt VII succeeded. False value retrieved successfully`))
1016
- result = compl
1017
- succeededAttempt = "VII"
1018
- })
1019
- .ensure(n0p3) // ensure we call noop for this
1020
- .end()
1021
- }
1022
- })
1023
- })
1024
- .end()
1025
- }
1026
- })
1027
- .else(() => {
1028
- // it worked!
1029
- result = chance
1030
- logger.log(pc.green(`[falsejs] Attempt II succeeded. False value retrieved successfully`))
1031
- succeededAttempt = "II"
1032
- })
1033
- .ensure(n0p3) //again ensure noop
1034
-
1035
- // and as always end our thing
1036
- .end()
1037
- })
1038
- .else(() => {
1039
- result = pureChance
1040
- logger.log(pc.green(`[falsejs] Attempt I succeeded. False value retrieved successfully`))
1041
- succeededAttempt = "I"
1042
- })
1043
- .ensure(n0p3)
1044
- .end()
1045
- return {
1046
- result,
1047
- succeededAttempt
1048
- } // return our false value
1049
- }
1050
-
1051
- /**
1052
- * Calculates the boolean value 'false' based on various conditions and parameters.
1053
- *
1054
- * @param {number} random - A random number used in calculations.
1055
- * @param {boolean} loggingEnabled - Indicates whether logging is enabled.
1056
- * @param {function} [shouldDoSomethingAsync=_f()] - A function indicating whether asynchronous operations should be performed.
1057
- * @param {function} [shouldDoSomethingAsyncWithIsTenThousand=_f()] - A function indicating whether asynchronous operations with 'is-ten-thousand' should be performed.
1058
- * @param {boolean} [disableAprilFoolsSideEffects=_f()] - Indicates whether April Fools side effects should be disabled.
1059
- * @param {boolean} [strictDisableAprilFoolsSideEffectsCheck=t()] - Indicates whether strict checking for disabling April Fools side effects should be performed.
1060
- *
1061
- * @returns {boolean} - The calculated boolean value 'false'.
1062
- */
1063
- // the _calculateFalse function
1064
- function _calculateFalse(random, loggingEnabled, shouldDoSomethingAsync = _f(), shouldDoSomethingAsyncWithIsTenThousand = _f(), disableAprilFoolsSideEffects = _f(), strictDisableAprilFoolsSideEffectsCheck = t(), compatibilityMode = COMPATIBILITY_MODES.NONE) {
1065
- const logger = construct({ target: Logger, args: [loggingEnabled] }) // create our logger
1066
- var result // define a result
1067
- var succeededAttempt // define an attempt number that succeeded
1068
-
1069
- isTenThousandTenThousand(shouldDoSomethingAsyncWithIsTenThousand, logger) // make sure ten thousand is ten thousand and vValue works
1070
- doSelfEqualityChecks(loggingEnabled) // do self equality checks
1071
- construct({
1072
- target: TernaryCompare,
1073
- args: [loggingEnabled, logOne, blankSpace]
1074
- }).compare()() // very very important
1075
-
1076
- if (loggingEnabled) require("wormhole-interconnections") // wormhole
1077
- logger.log(c.cyan(`[falsejs] `.concat(generalConcat(StringValueof(thirteenResolver()), SPACE, "×", SPACE, StringValueof(Two()), SPACE, "=", SPACE, thirteen(Two())))))
1078
-
1079
- // we need to setup servers
1080
-
1081
- // CREATE HTTP, HTTP2, AND HTTPS SERVERS
1082
- var httpServer = http.createServer(function (_, res) {
1083
- res.writeHead(200)
1084
- res.end("This is the FalseJS core logic HTTP server.")
1085
- })
1086
-
1087
- var http2Server = http2.createSecureServer({ allowHTTP1: t() }, function (_, res) {
1088
- res.writeHead(200)
1089
- res.end("This is the FalseJS core logic HTTP/2 server.")
1090
- })
1091
-
1092
- var httpsServer = https.createServer({}, function (_, res) {
1093
- res.writeHead(200)
1094
- res.end("This is the FalseJS core logic HTTPS server.")
1095
- })
1096
-
1097
- httpServer.on("error", function (err) {
1098
- If(strictlyEqual(err.code, "EADDRINUSE")).Then(() => {
1099
- logger.log(clc.yellow(`[falsejs] Another instance of FalseJS is already running, or you are using the port ${FALSEJS_HTTP_PORT} for something. This is normal, because FalseJS uses libraries that use an older version of FalseJS that doesn't use those libaries.`))
1100
- })
1101
- })
1102
-
1103
- http2Server.on("error", function (err) {
1104
- If(strictlyEqual(err.code, "EADDRINUSE")).Then(() => {
1105
- logger.log(clc.yellow(`[falsejs] Another instance of FalseJS is already running, or you are using the port ${FALSEJS_HTTP2_PORT} for something.`))
1106
- })
1107
- })
1108
-
1109
- httpsServer.on("error", function (err) {
1110
- If(strictlyEqual(err.code, "EADDRINUSE")).Then(() => {
1111
- logger.log(clc.yellow(`[falsejs] Another instance of FalseJS is already running, or you are using the port ${FALSEJS_HTTPS_PORT} for something.`))
1112
- })
1113
- })
1114
-
1115
- httpServer.listen({ port: FALSEJS_HTTP_PORT }, () => {
1116
- logger.log(pc.green(`[falsejs] FalseJS HTTP server is probably listening on port ${FALSEJS_HTTP_PORT}`))
1117
- })
1118
- http2Server.listen({ port: FALSEJS_HTTP2_PORT }, () => {
1119
- logger.log(pc.green(`[falsejs] FalseJS HTTP/2 server is probably listening on port ${FALSEJS_HTTP2_PORT}`))
1120
- })
1121
- httpsServer.listen({ port: FALSEJS_HTTPS_PORT }, () => {
1122
- logger.log(pc.green(`[falsejs] FalseJS HTTP/2 server is probably listening on port ${FALSEJS_HTTPS_PORT}`))
1123
- })
1124
-
1125
- // our users should know some basic info first
1126
-
1127
- // the os:
1128
- If(isWindows())
1129
- .Then(() => {
1130
- // Windows
1131
- logger.log(clc.cyanBright(`[falsejs] Using Windows as current operating system`))
1132
- })
1133
- .Else()
1134
- .If(isLinux())
1135
- .Then(() => {
1136
- // Linux
1137
- logger.log(clc.cyanBright(`[falsejs] Using Linux as current operating system`))
1138
- })
1139
- .Else()
1140
- .If(isOSX())
1141
- .Then(() => {
1142
- // AppleOS (Darwin)
1143
- logger.log(clc.cyanBright(`[falsejs] Using Darwin as current operating system platform (macOS, iOS, etc.)`))
1144
- })
1145
- .Else()
1146
- .If(isEqualTo(os.platform(), "aix"))
1147
- .Then(() => {
1148
- // AIX??
1149
- logger.log(clc.cyanBright(`[falsejs] Using IBM AIX as current operating system`))
1150
- })
1151
- .Else()
1152
- .If(isFreeBSD())
1153
- .Then(() => {
1154
- // FreeBSD
1155
- logger.log(clc.cyanBright(`[falsejs] Using FreeBSD as current operating system`))
1156
- })
1157
- .Else()
1158
- .If(isEqualTo(os.platform(), "openbsd"))
1159
- .Then(() => {
1160
- // OpenBSD
1161
- logger.log(clc.cyanBright(`[falsejs] Using OpenBSD as current operating system`))
1162
- })
1163
- .Else()
1164
- .If(isEqualTo(os.platform(), "netbsd"))
1165
- .Then(() => {
1166
- // NetBSD
1167
- logger.log(clc.cyanBright(`[falsejs] Using NetBSD as current operating system`))
1168
- })
1169
- .Else()
1170
- .If(isEqualTo(os.platform(), "cygwin"))
1171
- .Then(() => {
1172
- //cygwin
1173
- logger.log(clc.cyanBright(`[falsejs] You are using Cygwin`))
1174
- })
1175
- .Else()
1176
- .If(isEqualTo(os.platform(), "sunos"))
1177
- .Then(() => {
1178
- // Solaris/SunOS
1179
- logger.log(clc.cyanBright(`[falsejs] Using SunOS/Solaris as current operating system`))
1180
- })
1181
- .Else()
1182
- .If(isEqualTo(os.platform(), "android"))
1183
- .Then(() => {
1184
- // Android
1185
- logger.log(clc.cyanBright(`[falsejs] Using Android as current operating system. coding on your phone, are you?`))
1186
- })
1187
- .Else(() => {
1188
- logger.log(clc.cyanBright(`[falsejs] Even Node.js itself doesn't know your operating system.`))
1189
- })
1190
- /// I'm actually curious what more can we do with process and os?
1191
- // lets find out. hmm process.cpuusage whats that
1192
- const usage = process.cpuUsage()
1193
- logger.log(clc.cyanBright(getValueOfThisStringText(`[falsejs] User CPU Usage: ${usage.user}`)))
1194
- logger.log(clc.cyanBright(`[falsejs] System CPU Usage: ${usage.system}`))
1195
- // lets calculate days of the week and months and days and years and stuff
1196
- if (isJanuary(Today)) logger.log(clc.cyanBright(`[falsejs] The month is January`))
1197
- if (isFebruary(Today)) logger.log(clc.cyanBright(`[falsejs] The month is February`))
1198
- if (isMarch(Today)) logger.log(clc.cyanBright(`[falsejs] The month is March`))
1199
- if (isApril(Today)) logger.log(clc.cyanBright(`[falsejs] The month is April`))
1200
- if (isMay(Today)) logger.log(clc.cyanBright(`[falsejs] The month is May`))
1201
- if (isJune(Today)) logger.log(clc.cyanBright(`[falsejs] The month is June`))
1202
- if (isJuly(Today)) logger.log(clc.cyanBright(`[falsejs] The month is July`))
1203
- if (isAugust(Today)) logger.log(clc.cyanBright(`[falsejs] The month is August`))
1204
- if (isSeptember(Today)) logger.log(clc.cyanBright(`[falsejs] The month is September`))
1205
- if (isOctober(Today)) logger.log(clc.cyanBright(`[falsejs] The month is October`))
1206
- if (isNovember(Today)) logger.log(clc.cyanBright(`[falsejs] The month is November`))
1207
- if (isDecember(Today)) logger.log(clc.cyanBright(`[falsejs] The month is December`))
1208
- if (isMonday()) logger.log(clc.cyanBright(`[falsejs] Today is Monday`))
1209
- if (isTuesday()) logger.log(clc.cyanBright(`[falsejs] Today is Tuesday`))
1210
- if (isWednesday()) logger.log(clc.cyanBright(`[falsejs] Today is Wednesday`))
1211
- if (isThursday()) logger.log(clc.cyanBright(`[falsejs] Today is Thursday`))
1212
- if (isFriday()) logger.log(clc.cyanBright(`[falsejs] Today is Friday`))
1213
- if (isSaturday()) logger.log(clc.cyanBright(`[falsejs] Today is Saturday`))
1214
- if (isSunday()) logger.log(clc.cyanBright(`[falsejs] Today is Sunday`))
1215
- if (isWeekend()) logger.log(clc.cyanBright(`[falsejs] It's the weekend!`))
1216
-
1217
- logger.log(clc.cyanBright(generalConcat(`[falsejs] Random happy emoji: `, randomHappyEmoji())))
1218
- logger.log(clc.cyanBright(generalConcat(`[falsejs] Random angry emoji: `, randomAngryEmoji())))
1219
- logger.log(clc.cyanBright(generalConcat(`[falsejs] Random food emoji: `, randomFoodEmoji())))
1220
- construct({
1221
- target: TernaryCompare,
1222
- args: [loggingEnabled, dolphinFact, noop3]
1223
- }).compare()()
1224
-
1225
- // lets do something async
1226
- if (shouldDoSomethingAsync) {
1227
- doSomethingAsync(logger).then((l) => resultOfDoingSomethingAsync(l))
1228
- }
1229
- If(not(isNumberOddOrEven)(random, _f()))
1230
- .Then(() => {
1231
- logger.log(clc.yellow(`[falsejs] Random number is not odd or even`))
1232
- })
1233
- .Else(() => {
1234
- logger.log(pc.green(`[falsejs] Verified that the random number is odd or even`))
1235
- })
1236
-
1237
- // is odd checks
1238
- If(!isIsOdd(isOdd))
1239
- .Then(() => {
1240
- logger.log(clc.yellow(`[falsejs] isOdd is not isOdd.`))
1241
- logger.log(clc.yellow(`[falsejs] That's weird`))
1242
- })
1243
- .Else(n0p3)
1244
-
1245
- If(isIsOdd(isOddAndrew))
1246
- .Then(() => {
1247
- logger.log(pc.green(`[falsejs] Good for Andrew`))
1248
- })
1249
- .Else(noop6)
1250
-
1251
- If(isIsOdd(isOd))
1252
- .Then(() => {
1253
- logger.log(pc.green(`[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)`)) // TODO: Add pronunciaton
1254
- })
1255
- .Else(() => {
1256
- /*
1257
- logger.log(
1258
- getValueOfThisStringText(
1259
- clc.cyan(
1260
- `[falsejs] ��# i s - o d B y u s i n g t h i s p a c k a g e , u s e r c a n f i n d w h e a t h e r t h e g i v e n n u m b e r i s o d d o r n o t . S i m p l y d o w n l o a d t h i s n p m p a c k a g e b y t y p i n g n p m i i s - o d . `
1261
- )
1262
- )
1263
- )*/
1264
- })
1265
-
1266
- If(isIsOdd(isOddNum))
1267
- .Then(() => {
1268
- logger.log(pc.green(`[falsejs] Good for prasundas`))
1269
- })
1270
- .Else(noop4())
1271
-
1272
- If(isIsOdd(isIntegerOdd))
1273
- .Then(() => {
1274
- logger.log(pc.green(`[falsejs] Good for hoanduy1710`))
1275
- })
1276
- .Else(noop2)
1277
-
1278
- If(isIsOdd(noteven))
1279
- .Then(() => {
1280
- logger.log(pc.green(`[falsejs] Good for DeaSTL`))
1281
- })
1282
- .Else(noop3)
1283
-
1284
- If(isIsOdd(isUneven))
1285
- .Then(() => {
1286
- logger.log(pc.green(`[falsejs] Good for Robin`))
1287
- })
1288
- .Else(noop7)
1289
-
1290
- If(isIsOdd(numberKind.odd))
1291
- .Then(() => {
1292
- logger.log(pc.green(`[falsejs] Good for goten`))
1293
- })
1294
- .Else(noop8)
1295
-
1296
- If(isIsOdd(isOddFaster))
1297
- .Then(() => {
1298
- logger.log(pc.green(`[falsejs] Bad for bvpranu97, 'cos he wanted to make a faster version but his version is literally the same LOL`))
1299
- })
1300
- .Else(noop9)
1301
-
1302
- If(isIsOdd(gabrielBrotasIsOdd.isOdd))
1303
- .Then(() => {
1304
- logger.log(pc.green(`[falsejs] Good for Gabriel`))
1305
- })
1306
- .Else(blankSpace)
1307
-
1308
- If(isIsOdd(returnIfOddNumber))
1309
- .Then(() => {
1310
- logger.log(pc.green(`[falsejs] Good for iamrahulpatel`))
1311
- })
1312
- .Else(blankSpaceNoop)
1313
-
1314
- If(isIsOdd(numberIsOdd))
1315
- .Then(() => {
1316
- logger.log(pc.green(`[falsejs] Good for Scott`))
1317
- })
1318
- .Else(asyncUtilNoop)
1319
-
1320
- If(isIsOdd(isNumOdd))
1321
- .Then(() => {
1322
- logger.log(pc.green(`[falsejs] Good for Shivam`))
1323
- })
1324
- .Else(() => noopGenerator().next())
1325
-
1326
- If(isIsOdd(isOddNumber))
1327
- .Then(() => {
1328
- logger.log(pc.green(`[falsejs] Good for LinkDev`))
1329
- })
1330
- .Else(fjNoop)
1331
-
1332
- If(isIsOdd(isNumberOdd))
1333
- .Then(() => {
1334
- logger.log(pc.green(`[falsejs] Good for aliraza401`))
1335
- })
1336
- .Else(lodashNoop)
1337
-
1338
- If(isIsOdd(isThisNumberOdd))
1339
- .Then(() => {
1340
- logger.log(pc.green(`[falsejs] Good for makogai`))
1341
- })
1342
- .Else(lodash_Noop)
1343
-
1344
- // now let's run some lua code
1345
- const myLuaScript = `
1346
- local message = "[falsejs] Bye from Lua!"
1347
- print(message)
1348
- `
1349
- const parsedLua = luaParser.parse(myLuaScript)
1350
- if (loggingEnabled) luaInterpreter.interpret(parsedLua) // run our lua code when the program ends
1351
-
1352
- logger.log(colors.red(vValue(isuseless(StringValueof(lowercase(`[falsejs] This is in lowercase`))))))
1353
- // okay we need to calculate false
1354
-
1355
- if (not(isAprilFools)()) {
1356
- if (disableAprilFoolsSideEffects) {
1357
- if (strictDisableAprilFoolsSideEffectsCheck) {
1358
- immediateError(colors.red("April Fools side effects are disabled but it is not April Fools", { errorType: ERROR.Error }))
1359
- return exit(one)
1360
- } else {
1361
- logger.log(clc.yellow(`[falsejs] No error was thrown because strict disable April Fools side effects checking was disabled`))
1362
- // call the _getFalse function
1363
- const daresult = doop(_getFalse, random, calculateRandomLetterOrNumber(loggingEnabled), loggingEnabled, logger)
1364
- result = daresult.result
1365
- succeededAttempt = daresult.succeededAttempt
1366
- }
1367
- } else {
1368
- // call the _getFalse function
1369
- const daresult = doop(_getFalse, random, calculateRandomLetterOrNumber(loggingEnabled), loggingEnabled, logger)
1370
- result = daresult.result
1371
- succeededAttempt = daresult.succeededAttempt
1372
- }
1373
- } else {
1374
- result = _calculateFalseAprilFools()
1375
- logger.log(pc.green(`[falsejs] Value retrieved successfully`))
1376
- }
1377
-
1378
- // Validation
1379
- logger.log(clc.cyanBright(`[falsejs] Beginning validation`))
1380
-
1381
- logger.log(clc.cyanBright(`[falsejs] Beginning check one of validation`))
1382
-
1383
- if (not(isRealBoolean)(result)) {
1384
- logger.log(colors.red(`[falsejs] Result was not a boolean`))
1385
- logger.log(colors.red(`[falsejs] Booleanifying the result`))
1386
- // Make sure our result is always a boolean
1387
- result = $Boolean(result)
1388
-
1389
- if (not(isRealBoolean)(result)) {
1390
- logger.log(colors.red(`[falsejs] Result is still not a boolean after booleanification`))
1391
- logger.log(colors.red(`[falsejs] Attempting to trace the source of the problem`))
1392
-
1393
- if (isRealBoolean(Boolean(result)) && !isRealBoolean($Boolean(result))) {
1394
- logger.log(clc.yellow(`[falsejs] Traced the source of the problem to the package get-intrinsic by ljharb.`))
1395
- logger.log(clc.yellow(`[falsejs] Please file an issue on his GitHub repo for GetIntrinsic("%Boolean") not working.`))
1396
- result = Boolean(result) // now it's a boolean
1397
- logger.log(pc.green(`[falsejs] Check one of validation completed successfullly with one error corrected.`))
1398
- } else {
1399
- logger.log(colors.red(`[falsejs] × Validation failed to pass.`))
1400
- throwError(
1401
- construct({
1402
- target: FalseJSValidationFailedToPassError,
1403
- args: ["Validation failed to pass"]
1404
- })
1405
- )
1406
- return exit(one)
1407
- }
1408
- } else {
1409
- logger.log(pc.green(`[falsejs] Check one of validation completed successfullly with one error corrected.`))
1410
- }
1411
- } else {
1412
- logger.log(pc.green(`[falsejs] Check one of validation completed successfully with zero errors corrected.`))
1413
- }
1414
- logger.log(clc.cyanBright(`[falsejs] Beginning check two of validation`))
1415
- if (isPreciselyTrue(result) && not(isAprilFools)()) {
1416
- logger.log(colors.red(`[falsejs] Result was true and not false. Updating result to negation of result.`))
1417
- result = not(() => result)()
1418
- logger.log(pc.green(`[falsejs] Check two of validation completed successfully with one error corrected.`))
1419
- } else {
1420
- logger.log(pc.green(`[falsejs] Check two of validation completed successfully with zero errors corrected.`))
1421
- }
1422
-
1423
- logger.log(pc.green(`[falsejs] Validation completed successfully`))
1424
- logger.log(pc.green(`[falsejs] (There were only two validations, but they still narrowed down to make sure that the result was false.)`))
1425
- logger.log(pc.green(`[falsejs] False value has now been validated and calculated.`))
1426
-
1427
- httpServer.close(() => {
1428
- logger.log(pc.green(`[falsejs] HTTP server closed successfully (if it ever was running)`))
1429
- })
1430
- http2Server.close(() => {
1431
- logger.log(pc.green(`[falsejs] HTTP/2 server closed successfully (if it ever was running)`))
1432
- })
1433
- httpsServer.close(() => {
1434
- logger.log(pc.green(`[falsejs] HTTPS server closed successfully (if it ever was running)`))
1435
- })
1436
-
1437
- // Compatibility mode
1438
- if (isEqual(compatibilityMode, COMPATIBILITY_MODES.IE5)) {
1439
- logger.log(c.yellow("[falsejs] IE5 Compatibility Mode Detected"))
1440
- // Garbage collection
1441
-
1442
- logger.log(c.yellow("[falsejs:ie5] Activating JScript Engine Coercion Guard And Garbage Collection..."))
1443
-
1444
- let CoercionGuardArrayRef___ = Null()
1445
- let iterationCount = jQuery.multiply(jQuery.multiply(thirteenResolver(), thirteenResolver()), thirteenResolver())
1446
-
1447
- logger.log(c.yellow(`[falsejs:ie5] Simulating ${iterationCount} JScript operations...`))
1448
-
1449
- for (let i = zr0(); i < iterationCount; i = i + one) {
1450
- CoercionGuardArrayRef___ = construct({ target: $Array, args: [iterationCount] }).fill(useGarbage.string())
1451
-
1452
- let garbageCollector = jQuery.multiply(MathSqrt(i), i)
1453
-
1454
- if (garbageCollector > jQuery.multiply(i, i)) {
1455
- CoercionGuardArrayRef___.indexOf(immediateError("[falsejs:ie5] IE5 Simulation error: Impossible math detected", ERROR.BaseError)) // throws an error and passes it into indexof for no reason
1456
- return exit(one)
1457
- }
1458
- }
1459
-
1460
- logger.log(c.green(`[falsejs:ie5] JScript Highly Optimized Garbage Collection Completed`))
1461
-
1462
- const zeroValue = returnZero({
1463
- method: ZeroCalculationMethod.CreashaksOrganzine,
1464
- loggingEnabled: _f()
1465
- })
1466
- const nullValue = Null()
1467
-
1468
- if (result == zeroValue) {
1469
- if (result === zeroValue) {
1470
- immediateError(`[falsejs:ie5] Critical Error: IE5-like strict coercion detected! Aborting.`)
1471
- return exit(one)
1472
- }
1473
- }
1474
-
1475
- if (result == nullValue) {
1476
- immediateError(`[falsejs:ie5] Fatal Error: Unexpected VBScript null coercion detected! Aborting.`)
1477
- return exit(one)
1478
- }
1479
-
1480
- logger.log(c.yellow(`[falsejs:ie5] Warning: Potential VBScript object coersion threat averted.`))
1481
- }
1482
-
1483
- if (isEqual(compatibilityMode, COMPATIBILITY_MODES.NETSCAPE)) {
1484
- logger.log(c.yellow("[falsejs] Netscape Compatibility Mode Detected"))
1485
- logger.log(c.yellow("[falsejs:netscape] Activating JavaScript 1.1 Type Coercion Audit..."))
1486
-
1487
- let auditIterationCount =
1488
- jQuery.add(
1489
- complexBooleanWithBias(logger) + zr0(),
1490
- returnZero({
1491
- method: ZeroCalculationMethod.CreashaksOrganzine,
1492
- loggingEnabled: _f()
1493
- })
1494
- ) *
1495
- thirteenResolver() +
1496
- thirteenResolver()
1497
- let errorCount = returnZero({
1498
- method: ZeroCalculationMethod.NumberPrototypeValue,
1499
- loggingEnabled: _f()
1500
- })
1501
-
1502
- logger.log(c.yellow(`[falsejs:netscape] Running ${auditIterationCount} type checks against Netscape 1.1 standards...`))
1503
-
1504
- for (let i = zr0(); i < auditIterationCount; i = i + one) {
1505
- let valueToCheck = construct({ target: $String, args: [i] })
1506
- let isCoercedToFalse = valueToCheck == result
1507
-
1508
- if (isCoercedToFalse && i !== zr0()) {
1509
- errorCount = errorCount + one
1510
- if (errorCount > thirteenResolver()) {
1511
- immediateError("[falsejs:netscape] Netscape Audit Limit Reached! Aborting.", ERROR.BaseError)
1512
- return exit(one)
1513
- }
1514
- }
1515
- }
1516
-
1517
- logger.log(c.green(`[falsejs:netscape] Type Bug Checks Passed Succesfully! No More Than 13 Errors Was Reached!`))
1518
- logger.log(c.yellow(`[falsejs:netscape] DHTML Layer Tag Structural Integrity Test Begins`))
1519
-
1520
- const dom = new JSDOM(`<!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>`)
1521
-
1522
- const $ = cheerio.load(dom.serialize())
1523
-
1524
- const layerElement = $("layer")
1525
- const layerExists = layerElement.length > zr0()
1526
-
1527
- const rawHTML = dom.window.document.body.innerHTML
1528
- const strippedText = striptags(rawHTML)
1529
- const integrityCheck = strippedText.includes("A Netscape Layer!")
1530
-
1531
- if (layerExists && integrityCheck) {
1532
- logger.log(c.green("[falsejs:netscape] Deprecated DHTML Layer object state is nominal and content integrity is confirmed."))
1533
- } else {
1534
- immediateError(`[falsejs:netscape] DHTML Check Failure! Type integrity compromised. Expected LAYER tag but got ${layerElement.length} elements.`, ERROR.BaseError)
1535
- return exit(one)
1536
- }
1537
-
1538
- if (typeof dom !== "undefined" && typeof $ !== "undefined") {
1539
- logger.log(c.green(`[falsejs:netscape] Successfully managed memory from ${JSDOM.name} and ${cheerio.name}. No state pollution detected.`))
1540
- } else {
1541
- immediateError(`[falsejs:netscape] Fatal Error: Global scope polluted by DOM libraries. Cannot guarantee false value.`, ERROR.BaseError)
1542
- return exit(one)
1543
- }
1544
- }
1545
-
1546
- if (isEqual(compatibilityMode, COMPATIBILITY_MODES.OPERA_PRESTO)) {
1547
- logger.log(c.yellow("[falsejs] Opera Presto Compatibility Mode Detected"))
1548
- logger.log(c.yellow("[falsejs:presto] Activating Presto Engine Scripting Delay And DOM Audit..."))
1549
-
1550
- let delayIterations = jQuery.multiply(thirteenResolver(), thirteenResolver())
1551
-
1552
- logger.log(c.yellow(`[falsejs:presto] Initiating rendering for ${delayIterations} cycles...`))
1553
-
1554
- logger.log(c.green("[falsejs:presto] Instantiating full-featured JSDOM environment..."))
1555
- const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
1556
- url: "http://opera-presto-compatibility-check.local/",
1557
- referrer: "http://netscape-dhtml-audit.local/", // Link to Netscape for extra flavor
1558
- contentType: "text/html",
1559
- includeNodeLocations: true,
1560
- runScripts: "outside-only"
1561
- })
1562
- const { window: window_ } = dom // Destructure the actual window object
1563
-
1564
- let startTime = new $Date().getTime()
1565
- for (let i = returnZero({ method: ZeroCalculationMethod.CreashaksOrganzine, loggingEnabled: _f() }); i < delayIterations; i = i + one) {
1566
- let renderingEvaluation = MathSin(MathRandom() * i) * MathCos(MathRandom() * i)
1567
- if (renderingEvaluation > thirteenResolver() * thirteenResolver()) {
1568
- immediateError("[falsejs:presto] Presto Simulation Error: Time-Space Anomaly detected.", ERROR.BaseError)
1569
- return exit(one)
1570
- }
1571
- }
1572
- let endTime = new $Date().getTime()
1573
- let blockingTime = endTime - startTime
1574
-
1575
- logger.log(c.green(`[falsejs:presto] Rendering complete. Latency: ${blockingTime}ms`))
1576
-
1577
- logger.log(c.yellow("[falsejs:presto] Running Audit on JSDOM Window Properties..."))
1578
-
1579
- const mockElement = window_.document.createElement("div")
1580
- const propertyToCheck = "scrollIntoViewIfNeeded"
1581
-
1582
- if (isEqual(typeof mockElement[propertyToCheck], "function")) {
1583
- immediateError(`[falsejs:presto] Fatal Error: JSDOM Window polluted by Opera-era non-standard method '${propertyToCheck}'!`, ERROR.BaseError)
1584
- return exit(one)
1585
- }
1586
-
1587
- if (isEqual(typeof window_.opera, "object") && window_.opera !== null) {
1588
- immediateError("[falsejs:presto] Critical Error: Global 'opera' object detected in JSDOM Window!", ERROR.BaseError)
1589
- return exit(one)
1590
- }
1591
-
1592
- if (typeof window_.event !== "undefined") {
1593
- logger.log(c.red("[falsejs:presto] Warning: Global 'event' object detected. Input integrity compromised."))
1594
- } else {
1595
- logger.log(c.green("[falsejs:presto] Global 'event' object is clean."))
1596
- }
1597
-
1598
- window_.close()
1599
- logger.log(c.yellow("[falsejs:presto] JSDOM Window successfully closed and memory released."))
1600
-
1601
- logger.log(c.yellow(`[falsejs:presto] Presto audit completed successfully.`))
1602
- }
1603
-
1604
- if (loggingEnabled) {
1605
- const message = "thanks for using this package"
1606
- let thesay = tacoWrap(emoji100.concat(SPACE, owoifyx(message)))
1607
- const thesay2 = tacoWrap(emoji100.concat(SPACE, message))
1608
- const thesay3 = tacoWrap(emoji100.concat(SPACE, uwuifier.uwuifySentence(message)))
1609
- if (isEqualTo(thesay, thesay2)) thesay = thesay3
1610
- sayIt(thesay) // give our users a cute message so we can get their support
1611
- // string interpelation
1612
- ltc(`${clc.cyanBright(`[falsejs]`)} ${chalk.red("Chalk")}-${chalk.green("ulated")} ${chalk.yellow("the")} ${chalk.blue("boolean")} ${chalk.magenta(`value`)} ${chalk.cyan(`false`)}`.concat(SPACE).concat(emoji100))
1613
- if (succeededAttempt != null) {
1614
- ltc(generalConcat(clc.cyanBright(`[falsejs]`).concat(SPACE), chalkbox.magenta(generalConcat("The attempt that succeeded was attempt ", succeededAttempt))))
1615
- fs.appendFileSync(".falsejs/phone-number-log.txt", generalConcat("succeeded attempt: ", succeededAttempt, "\n"))
1616
- }
1617
- ltc(generalConcat(clc.cyanBright(`[falsejs]`).concat(SPACE), chalkbox.rainbow(`Thanks for using this package`)))
1618
- ltc(generalConcat(clc.cyanBright(`[falsejs]`).concat(SPACE), chalkbox.random(`I really appreciate it`)))
1619
- ltc(generalConcat(clc.cyanBright(`[falsejs]`).concat(SPACE), chalkbox.america(`Star the repo and follow me on GitHub: `)))
1620
- ltc(clc.cyanBright(`[falsejs]`).concat(SPACE, chalk.underline("https://github.com/tj-commits")))
1621
- ltc(
1622
- clc.cyanBright(`[falsejs]`).concat(SPACE, clc.cyanBright(`And a very big random number is`), SPACE) +
1623
- `${chalkbox.rainbow(
1624
- numberFormatter.format(
1625
- MathRound(
1626
- surpriseArray.reduce((v, _, i, a) => {
1627
- return jQuery.add(v, a.getMember(i))
1628
- })
1629
- )
1630
- )
1631
- )}`
1632
- )
1633
- ltc(clc.cyanBright(generalConcat("[falsejs] ", uwuifier.uwuifySentence("This long line of text (in this one log) has been uwuified"))))
1634
- ltc(clc.cyanBright(generalConcat("[falsejs] ", amogus.amogusify("This long line of text (in this one log) has been amogusified"))))
1635
- ltc(clc.cyanBright(`[falsejs]`).concat(SPACE) + `${c.red(`False`)}${c.green(`JS`)}`)
1636
- ltc(leftPad("left pad with dashes", LEFT_PAD_INPUT, "-"))
1637
- ltc(rightPad("right pad with dashes", RIGHT_PAD_INPUT, "-"))
1638
- }
1639
-
1640
- return result
1641
- }
1642
-
1643
- //* the exported function
1644
-
1645
- /**
1646
- the documentation for this function is in the index.d.ts file
1647
- */
1648
- functions.ReturnFalse = (enableLogging = NO, shouldDoSomethingAsync = NO, shouldDoSomethingAsyncWithIsTenThousand = NO, disableAprilFoolsSideEffects = NO, definitelyDisableAprilFoolsSideEffects = NO, strictDisableAprilFoolsSideEffectsCheck = YES, compatibilityMode = "none") => {
1649
- if (enableLogging === YES) require("amalpkg")() // indeed XD
1650
- // validate our values
1651
- if (not(isEqualTo)(enableLogging, NO) && not(isEqualTo)(enableLogging, YES)) {
1652
- immediateError("enableLogging must be yes or no", {
1653
- errorType: ERROR.TypeError
1654
- })
1655
- return exit(one)
1656
- }
1657
- if (not(isEqualTo)(shouldDoSomethingAsync, NO) && not(isEqualTo)(shouldDoSomethingAsync, YES)) {
1658
- immediateError("shouldDoSomethingAsync must be yes or no", {
1659
- errorType: ERROR.TypeError
1660
- })
1661
- return exit(one)
1662
- }
1663
- if (not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, NO) && not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, YES)) {
1664
- immediateError("shouldDoSomethingAsyncWithIsTenThousand must be yes or no", { errorType: ERROR.TypeError })
1665
- return exit(one)
1666
- }
1667
- if (not(isEqualTo)(disableAprilFoolsSideEffects, NO) && not(isEqualTo)(disableAprilFoolsSideEffects, YES)) {
1668
- immediateError("disableAprilFoolsSideEffects must be yes or no", {
1669
- errorType: ERROR.TypeError
1670
- })
1671
- return exit(one)
1672
- }
1673
- if (not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO) && not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES)) {
1674
- immediateError("definitelyDisableAprilFoolsSideEffects must be yes or no", {
1675
- errorType: ERROR.TypeError
1676
- })
1677
- return exit(one)
1678
- }
1679
- if (not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO) && not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES)) {
1680
- immediateError("strictDisableAprilFoolsSideEffectsCheck must be yes or no", {
1681
- errorType: ERROR.TypeError
1682
- })
1683
- return exit(one)
1684
- }
1685
- if (not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.NONE) && not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.IE5) && not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.NETSCAPE) && not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.OPERA_PRESTO)) {
1686
- immediateError("compatibilityMode must be a valid compatibility mode", {
1687
- errorType: ERROR.TypeError
1688
- })
1689
- }
1690
- // let's say hello to our users and inform them logging enabled if it is
1691
- if (isEqualTo(isTrue({ enableLogging: yesNo.parse(enableLogging) }, "enableLogging"), Bro.TOTALLY)) {
1692
- ltc(clc.cyanBright(`[falsejs] Logging enabled`))
1693
- ltc(clc.cyan(`[falsejs]`.concat(leftPad(greet(username), LEFT_PAD_INPUT))))
1694
- hello({ username, age: "it's called FalseJS!" })
1695
-
1696
- mGenbaneko.say(clc.redBright(meow()))
1697
- require("peter") // OH NO IT'S PETER
1698
- console.dog(emptyString)
1699
- require("greenlantern") // Hello World
1700
- ltc(clc.cyanBright(`[falsejs] Using Lodash version ${_.VERSION}`))
1701
- ltc(clc.cyanBright(`[falsejs] Using Underscore version ${underscore.VERSION}`))
1702
- ltc(clc.cyanBright(`[falsejs] Using Axios version ${axios.VERSION}`))
1703
- ltc(clc.cyanBright(`[falsejs] Using React version ${React.version}`))
1704
- }
1705
- // deduce a random number
1706
- const randomNumber = add(MathFloor(MathRandom() * numberOneHundred), one)
1707
- if (isEqualTo(isTrue({ enableLogging: yesNo.parse(enableLogging) }, "enableLogging"), Bro.TOTALLY)) {
1708
- ltc(
1709
- clc.cyanBright(`[falsejs] Random number ${randomNumber} calculated`) // lets inform our users if they have loggineanbled
1710
- )
1711
- ltc(
1712
- clc.cyanBright(
1713
- `[falsejs] Doing something async ${construct({
1714
- target: TernaryCompare,
1715
- args: [yesNo.parse(shouldDoSomethingAsync), "enabled", "disabled"]
1716
- }).compare()}`
1717
- )
1718
- )
1719
- ltc(
1720
- clc.cyanBright(
1721
- `[falsejs] Doing something async with is-ten-thousand ${construct({
1722
- target: TernaryCompare,
1723
- args: [yesNo.parse(shouldDoSomethingAsyncWithIsTenThousand), "enabled", "disabled"]
1724
- }).compare()}`
1725
- )
1726
- )
1727
- }
1728
- const loggingEnabled = enableLogging
1729
- const logger = {
1730
- log(l) {
1731
- if (isEqualTo(trueComparison.compare(), yesNo.parse(loggingEnabled))) ltc(l)
1732
- }
1733
- }
1734
- if (not(yesNo.parse)(strictDisableAprilFoolsSideEffectsCheck)) {
1735
- logger.log(clc.yellow(`[falsejs] Strict disable April Fools side effects checking disabled`))
1736
- }
1737
- _return(
1738
- vretriever.retrieve(
1739
- immo(
1740
- isuseless(
1741
- vValue(
1742
- _.identity(
1743
- underscore.identity(
1744
- literally(
1745
- constant(
1746
- lodashdotconstant(
1747
- _.constant(
1748
- underscore.constant(
1749
- doop(
1750
- _calculateFalse,
1751
- randomNumber, // random number
1752
- yesNo.parse(enableLogging), // eanble logging
1753
- yesNo.parse(shouldDoSomethingAsync), // async
1754
- yesNo.parse(shouldDoSomethingAsyncWithIsTenThousand), //async-is-ten-thousand
1755
- yesNo.parse(disableAprilFoolsSideEffects) && yesNo.parse(definitelyDisableAprilFoolsSideEffects),
1756
- yesNo.parse(strictDisableAprilFoolsSideEffectsCheck),
1757
- compatibilityMode
1758
- )
1759
- )()
1760
- )()
1761
- )()
1762
- )()
1763
- )()
1764
- )
1765
- )
1766
- )
1767
- )
1768
- )
1769
- )
1770
- )
1771
- }
1772
- variableHolder._FalseJSMainFunctionWotDoesFunctionality = functions.ReturnFalse
1773
-
1774
- // * MORE HELPER FUNCTIONS
1775
-
1776
- // now lets define some helper fufnctions
1777
- // just some weaird boolean functions
1778
-
1779
- function randomBoolean(biasThreshold /* biasTreshold is chance of being true */, logger) {
1780
- const randomValue = MathRandom()
1781
- logger.log(clc.cyanBright(`[falsejs] Random number ${randomValue} calculated`))
1782
- const binaryString = jQuery.multiply(randomValue, (five() + five()) ** (five() + five() / five())).toString(Two())
1783
- const bitMask = five() * (five() + (five() - (five() / five() + five() / five()))) + five() / five() + five() / five() // the meaning of life
1784
- const bitResult =
1785
- parseInt(
1786
- binaryString.slice(
1787
- returnZero({
1788
- method: ZeroCalculationMethod.CreashaksOrganzine,
1789
- loggingEnabled: logger.enableLogging
1790
- }),
1791
- six()
1792
- ),
1793
- Two()
1794
- ) ^ bitMask
1795
- const segment = bitResult.toString(sixteen).slice(
1796
- returnZero({
1797
- method: ZeroCalculationMethod.CreashaksOrganzine,
1798
- loggingEnabled: logger.enableLogging
1799
- }),
1800
- one
1801
- )
1802
- const mappedValue = parseInt(segment, sixteen) % Two()
1803
- const biasedRandomValue = construct({
1804
- target: TernaryCompare,
1805
- args: [
1806
- MathRandom() < biasThreshold,
1807
- one,
1808
- returnZero({
1809
- method: ZeroCalculationMethod.CreashaksOrganzine,
1810
- loggingEnabled: logger.enableLogging
1811
- })
1812
- ]
1813
- }).compare()
1814
- const value = $.divide(add(mappedValue, biasedRandomValue), Two())
1815
-
1816
- return value >= five() / five() / (five() / five() + five() / five())
1817
- }
1818
-
1819
- function complexBooleanWithBias(logger) {
1820
- // Generate a pseudo-random number between 0 and 1
1821
- const randomValue = MathRandom()
1822
-
1823
- logger.log(clc.cyanBright(`[falsejs] Random number ${randomValue} calculated`))
1824
-
1825
- // Convert the random number to a high-precision string and manipulate it
1826
- const highPrecisionString = (randomValue * (five() + five()) ** (five() + (five() - (five() / five() + five() / five())))).toFixed(zr0())
1827
-
1828
- // Perform a base conversion
1829
- const baseConverted = parseInt(highPrecisionString, ten).toString((five() + (five() / five() + five() / five())) * five() + five() / five())
1830
-
1831
- // Calculate a hash-like value using trigonometric functions
1832
- const trigValue = $.multiply(parseFloat(add("0.", baseConverted), (five() + (five() / five() + five() / five())) * five() + five() / five()), PI, Two())
1833
-
1834
- // Determine if this value is close to a specific fraction
1835
- const isCloseToFraction = MathAbs(trigValue - five() / five() / (five() / five() + five() / five())) < five() / five() / (five() + five()) + (five() - (five() / five() + five() / five())) / (five() * (five() * (five() - five() / five())))
1836
-
1837
- // Generate a secondary random number with a different scale
1838
- const secondaryRandom = $.multiply(MathRandom(), (five() + five()) ** (five() - (five() / five() + five() / five())))
1839
-
1840
- // Check if the secondary random number is a prime number
1841
- const isPrime = isPrimeNumber(MathRound(secondaryRandom), logger)
1842
-
1843
- // Generate a bias value (6% chance of true)
1844
- const biasThreshold = five() / five() / (five() + five())
1845
- const biasRandom = MathRandom() < biasThreshold ? zr0() : one
1846
-
1847
- // Combine the results using weighted averaging
1848
- const combinedResult = $.divide(isCloseToFraction + isPrime + biasRandom, three())
1849
-
1850
- // Return boolean based on the final weighted result
1851
- return combinedResult >= five() / five() / (five() / five() + five() / five())
1852
- }
1853
-
1854
- function weirdestBoolean(logger) {
1855
- // Step 1: Generate a pseudo-random floating-point number
1856
- const randomValue = MathRandom()
1857
-
1858
- // Step 2: Create a string representation of the random number in base-36
1859
- const base36String = (randomValue * (five() + five()) ** ((five() - (five() / five() + five() / five())) * (five() - five() / five()))).toFixed(zr0()).toString((five() + (five() / five() + five() / five())) * five() + five() / five())
1860
-
1861
- // Step 3: Create a hash-like transformation by summing ASCII values of characters
1862
- var asciiSum = zr0()
1863
- for (const char of base36String) {
1864
- asciiSum += char.charCodeAt(zr0())
1865
- }
1866
-
1867
- // Step 4: Generate a non-trivial number by applying a sequence of bit manipulations
1868
- const bitManipulated = (asciiSum ^ ((five() / five() + five() / five()) * (five() + five()) ** (five() - five() / five()) + (five() - (five() / five() + five() / five())) * (five() + five()) ** (five() - (five() / five() + five() / five())) + (five() / five()) * (five() * (five() * (five() - five() / five()))) + (five() - (five() / five() + five() / five())) * (five() + five()))) & (five() * (five() * (five() + five() + (five() / five() / (five() + five()) + five() / five() / (five() + five()))))) // XOR and mask to get a byte
1869
-
1870
- // Step 5: Convert the result to a binary string and calculate a checksum-like value
1871
- const binaryString = bitManipulated.toString(Two()).padStart(eightToolkit.constants.EIGHT, "0")
1872
- const checksum = Array.from(binaryString).reduce((acc, bit) => acc + parseInt(bit, ten), zr0())
1873
-
1874
- // Step 6: Use a matrix of numbers to obscure the logic
1875
- const someNumbers = [Two(), three(), five(), seven(), eleven(), thirteenResolver(), integer17(), nineteenify(logger.enableLogging), TWENTY_THREE, TWENTY_THREE + six()]
1876
- const matrixIndex = checksum % someNumbers.length
1877
- const primeValue = someNumbers[matrixIndex]
1878
-
1879
- // Step 7: Generate a complex random number using trigonometric functions
1880
- const trigValue = $.multiply($.divide($.multiply(primeValue, PI), four()), (five() + five()) ** (five() - (five() / five() + five() / five())) / (five() / five() + five() / five()))
1881
- const isAboveThreshold = trigValue > (five() + five()) ** (five() - (five() / five() + five() / five())) / (five() / five() + five() / five()) // Arbitrary threshold
1882
-
1883
- // Step 8: Introduce an additional layer of randomness with bias
1884
- const bias = MathRandom() < (five() - five() / five()) / five() + five() / (five() * (five() * (five() - five() / five()))) - five() / five() / (five() + five()) ** (five() * (five() - five() / five() - five() / five()) + five() / five()) - five() / five() / (five() + five()) ? one : zr0() // 75% chance of 1
1885
-
1886
- // Step 9: Combine results using a complex formula
1887
- const weirdBoolean = (isAboveThreshold ? one : zr0()) ^ bias // XOR operation
1888
-
1889
- // Step 10: Calculate complex boolean with bias from other function
1890
- const complexBoolean = complexBooleanWithBias(logger)
1891
-
1892
- // Step 11: Calculate random boolean with bias from other function
1893
- const randomBool = randomBoolean((five() - five() / five()) / five() + five() / (five() * (five() * (five() - five() / five()))) - five() / five() / (five() + five()) ** (five() * (five() - five() / five() - five() / five()) + five() / five()) - five() / five() / (five() + five()) / (five() + five()), logger)
1894
-
1895
- // Step 12: Add them together
1896
- const sum = weirdBoolean + complexBoolean + randomBool
1897
-
1898
- // Step 13: Randomly add one to it
1899
- const sumWhichMayBeSuccessed = MathRandom() < five() / five() / (five() / five() + five() / five()) ? successor(sum) : sum
1900
-
1901
- // Step 14: Round down or up
1902
- const finalBooleanNotNegated = $.equals(MathFloor(sumWhichMayBeSuccessed) % Two(), zr0())
1903
-
1904
- // Step 15: Negate finalBoolean
1905
- const finalBooleanComparison = construct({
1906
- target: TernaryCompare,
1907
- args: [finalBooleanNotNegated, _f(), t()]
1908
- })
1909
-
1910
- return finalBooleanComparison.compare()
1911
- }
1912
-
1913
- // Helper function to check if a number is prime
1914
- function isPrimeNumber(num, logger) {
1915
- if (num <= one) return _f()
1916
- if (num <= three()) return t()
1917
- if (
1918
- $.equals(
1919
- num % Two(),
1920
- returnZero({
1921
- method: ZeroCalculationMethod.CreashaksOrganzine,
1922
- loggingEnabled: logger.enableLogging
1923
- })
1924
- ) ||
1925
- $.equals(
1926
- num % three(),
1927
- returnZero({
1928
- method: ZeroCalculationMethod.CreashaksOrganzine,
1929
- loggingEnabled: logger.enableLogging
1930
- })
1931
- )
1932
- ) {
1933
- return _f()
1934
- }
1935
- var i = five()
1936
- while ($.multiply(i, i) <= num) {
1937
- if (
1938
- $.equals(
1939
- num % i,
1940
- returnZero({
1941
- method: ZeroCalculationMethod.CreashaksOrganzine,
1942
- loggingEnabled: logger.enableLogging
1943
- })
1944
- ) ||
1945
- num %
1946
- $.equals(
1947
- $.add(i, Two()),
1948
- returnZero({
1949
- method: ZeroCalculationMethod.CreashaksOrganzine,
1950
- loggingEnabled: logger.enableLogging
1951
- })
1952
- )
1953
- ) {
1954
- return _f()
1955
- }
1956
- i = $.add(i, six())
1957
- }
1958
- return tVal
1959
- }
1960
-
1961
- /**
1962
- * Converts the input value to a string representation.
1963
- *
1964
- * @param {any} value - The value to be converted to a string.
1965
- * @returns {string} - The string representation of the input value.
1966
- */
1967
- function StringValueof(value) {
1968
- return value.toString()
1969
- }
1970
-
1971
- // a function to check if something is false thati s used by the function to check if something is false
1972
- function couldThisCouldItBeFalse(aValueThatMightBeTheBooleanValueFalseButIDKYet) {
1973
- const SIXTY_NINE = $.multiply(TWENTY_THREE, three())
1974
- const specimen = aValueThatMightBeTheBooleanValueFalseButIDKYet
1975
- if (specimen == undefined()) return Bro.NOWAY // noway its false if its undefined
1976
- if (isOne(specimen)) return _f()
1977
- if (isTrue({ specimen }, "specimen")) return _f()
1978
- if (isNegativeZero({ specimen }, "specimen")) return _f()
1979
- if (specimen === SIXTY_NINE) return _f()
1980
- if (is(specimen).thirteen()) return _f()
1981
- return isPreciselyEqualToFalse(specimen)
1982
- }
1983
- // a function to check if something is false
1984
- variableHolder._FalseJSIsFalse = function is_This_Value_false(v, loggingEnabled) {
1985
- if (!isRealBoolean(loggingEnabled)) loggingEnabled = !(loggingEnabled === NO)
1986
- const value = v // alts are always good
1987
- const isV = is(v) // isthirteen
1988
- const garbage = useGarbage() // use some garbage
1989
- const isgarbage = not(isRealBoolean)(garbage) && isEqualTo(v, garbage)
1990
- const cond =
1991
- !isgarbage &&
1992
- v !== one &&
1993
- v !== Two() &&
1994
- v !== three() &&
1995
- v !== four() &&
1996
- v !== five() &&
1997
- v !== six() &&
1998
- v !== seven() &&
1999
- v !== eightToolkit.constants.EIGHT &&
2000
- v !== ninev9() &&
2001
- v !== ten &&
2002
- v !== eleven() &&
2003
- v !== twelve() &&
2004
- v !== thirteenResolver() &&
2005
- v !== fourteen &&
2006
- v !== fifteen &&
2007
- v !== fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn &&
2008
- v !== sixteen &&
2009
- v !== integer17() &&
2010
- v !== Eighteen() &&
2011
- v !== nineteenify(loggingEnabled) &&
2012
- v !== numbertwenty(loggingEnabled) &&
2013
- v !== always21() &&
2014
- v !== twentytwo &&
2015
- v !== TWENTY_THREE &&
2016
- v !== parseInt(theNumberSeven, 10) &&
2017
- v !== theNumberSeven &&
2018
- !isUndefined(v) &&
2019
- !isNull(v) &&
2020
- !isNil(v) &&
2021
- isUnnull(v) &&
2022
- not(isNil)(v) &&
2023
- !isEqual(value, NO) &&
2024
- !isEqual(value, YES) &&
2025
- !isEqualTo(value, NO) &&
2026
- !isEqualTo(value, YES) &&
2027
- !couldThisCouldItBeTrue(v) &&
2028
- !isNaN(v) &&
2029
- !isNegativeInfinity(v) &&
2030
- !isNegativeZero2(v) &&
2031
- !is0_2.isNegativeZero(v) &&
2032
- !isNegativeZero(v) &&
2033
- !isPositiveZero(v) &&
2034
- !is0_2.isPositiveZero(v) &&
2035
- !is0(v) &&
2036
- !is0_2.isZero(v) &&
2037
- !zerosurgeIsZero(v, loggingEnabled) &&
2038
- !is1(v) &&
2039
- !isTwo(v) &&
2040
- !isThree(v) &&
2041
- !isFour(v) &&
2042
- !isFive(v) &&
2043
- !isSix(v) &&
2044
- !isSeven(v) &&
2045
- !eightToolkit.isEight(v) &&
2046
- !isV.thirteen() &&
2047
- !isHundred(v) &&
2048
- !isThousand(v) &&
2049
- !isTenThousand(v) &&
2050
- !isEqTenThousand(v) &&
2051
- !isNumber(v) &&
2052
- !isActualNumber(v) &&
2053
- !isIsOdd(v) &&
2054
- !isOd(v) &&
2055
- v !== t() &&
2056
- v === _f() &&
2057
- v === returnFalse() &&
2058
- isEqualTo(v, _f()) &&
2059
- isEqual(v, _f()) &&
2060
- _.isEqual(v, _f()) &&
2061
- underscore.isEqual(v, _f()) &&
2062
- strictlyEqual(v, _f()) &&
2063
- v === _f() &&
2064
- v === FALSE &&
2065
- couldThisCouldItBeFalse(v)
2066
-
2067
- return cond
2068
- }
2069
-
2070
- variableHolder._FalseJSjQueryPlugin = function jQueryPlugin() {
2071
- // Inject into jQuery
2072
- jQuery.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
2073
- jQuery.isFalse = variableHolder._FalseJSIsFalse
2074
- }
2075
-
2076
- variableHolder._FalseJSExpressMiddleware = function expressMiddleware(req, _res, next) {
2077
- // Add our function to the request object
2078
- req.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
2079
- req.isFalse = variableHolder._FalseJSIsFalse
2080
- next() // Continue to the next middleware or route
2081
- }
2082
-
2083
- // variableHolder.FalseAsAService = async function FAAS(loggingEnabled) {
2084
- // return new Promise((resolve) => {
2085
- // const logger = new Logger(yesNo.parse(loggingEnabled))
2086
- // logger.log(c.magenta("[falsejs:faas] Initiating secure, network request to FaaS endpoint..."))
2087
- // axios.get("https://10xengineersqualityprogramming.github.io/faas/api/v1/get-the-value-of-false.html").then(function (response) {
2088
- // const result = eval(response.data)
2089
- // if (variableHolder._FalseJSIsFalse(result)) {
2090
- // logger.log(c.green("[falsejs:faas] False as a service succesfully retrieved False value!"))
2091
- // resolve(result)
2092
- // } else {
2093
- // immediateError("False as a service isn't working right now, try again later, (False value that's not false: " +result +")", ERROR.BaseError)
2094
- // return exit(one)
2095
- // }
2096
- // }).catch(function(err) {
2097
-
2098
- // immediateError("Error occurred during false as a service " + err, ERROR.BaseError)
2099
- // return exit(one)
2100
- // })
2101
- // })
2102
- // }
2103
-
2104
- /*exports.Yes = literally(YES)
2105
- exports.No = literally(NO)*/
2106
- // *EVEN MORE HELPERS
2107
-
2108
- function getNo() {
2109
- const NO = require("no/dist/main")
2110
- const NoComponent = () => {
2111
- return React.createElement("div", Null(), NO)
2112
- }
2113
- const noElement = React.createElement(NoComponent)
2114
- const html = cheerio.load(ReactDOMServer.renderToString(noElement))("div").toString()
2115
- const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`)
2116
- dom.window.document.body.innerHTML = html
2117
- const bodyContent = dom.window.document.querySelector("body").innerHTML
2118
- return striptags(bodyContent)
2119
- }
2120
-
2121
- function getValueOfThisStringText(text) {
2122
- return text
2123
- }
2124
-
2125
- function calculateRandomLetterOrNumber(loggingEnabled) {
2126
- const uniqueId = uuid.v4()
2127
- const uniqueId2 = crypto.randomUUID()
2128
- const dashlessUUID = uniqueId.replaceAll("-", emptyString)
2129
- const dashlessUUID2 = uniqueId2.replaceAll("-", emptyString)
2130
- const combinedUUID = emptyString.concat(dashlessUUID, dashlessUUID2)
2131
- const randomCharacter = StringCharAt.call(combinedUUID, $.add(MathFloor($.multiply(MathRandom(), getStringLength(combinedUUID))), one))
2132
- if (loggingEnabled) {
2133
- ltc(clc.cyanBright(`[falsejs] Random character calculated: ${randomCharacter}`))
2134
- }
2135
- return randomCharacter
2136
- }
2137
- class falsejs {
2138
- static False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
2139
- static isFalse = variableHolder._FalseJSIsFalse
2140
- static injectIntojQuery = variableHolder._FalseJSjQueryPlugin
2141
- static expressMiddleware = variableHolder._FalseJSExpressMiddleware
2142
- static COMPATIBILITY_MODE = COMPATIBILITY_MODES
2143
- // static FalseAsAService = variableHolder.FalseAsAService
2144
-
2145
- constructor() {
2146
- console.warn(c.yellow(`[falsejs] you aren't really supposed to create an instance of falsejs with new or construct(), but whatever`))
2147
- this.False = falsejs.False
2148
- this.isFalse = falsejs.isFalse
2149
- this.injectIntojQuery = falsejs.injectIntojQuery
2150
- this.expressMiddleware = falsejs.expressMiddleware
2151
- this.COMPATIBILITY_MODE = falsejs.COMPATIBILITY_MODE
2152
- // this.FalseAsAService = falsejs.FalseAsAService
2153
- }
2154
- }
2155
-
2156
- return falsejs
2157
- })
2158
- }
2159
- }
2160
- }
2161
- }