@falsejs/falsejs 1.1.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,3104 +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(
31
- "no point doing anything if computer is not on, exiting node",
32
- )
33
- } else {
34
- const isComputerOnFire = require("is-computer-on-fire").isComputerOnFire
35
- if (isComputerOnFire()) {
36
- /** 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. */
37
- throw new Error(
38
- "OH MY GOSH YOUR COMPUTER IS ON FIRE WHY ARE YOU WASTING TIME USING A JOKE POINTLESS NPM PACKAGE GET YOUR FIRE EXTINGUISHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
39
- )
40
- } else {
41
- const isNodeRunning = require("node-script-running")
42
- if (!isNodeRunning()) {
43
- /** There is no point doing anything if node is not running. Therefore, do nothing.
44
- There's no point throwing an error because it wont do anything. */
45
- } else {
46
- /** The below requires are very important. Some of them optimize the code, and some are useful libraries like get-member. */
47
- require("vanilla-javascript") // * because we are making something awesome!
48
- require("vapor-js-npm") // the most awesome and flexible javascript framework
49
- require("none")() // this improves load times and performance
50
- require("-") // very, very, important
51
- require("whatev") // also very, very, important
52
- require("get-member")() // no silent undefined values
53
- require("array-get-member")() // no silent undefined values for arrays
54
- require("make-jquery-global")() // i <3 jQuery
55
- require("jquery-basic-arithmetic-plugin") // why not exploit jQuery for math
56
- require("console.dog") // bark
57
- require("user")() // idk why this has so many downloads
58
- require("ecto1")() // the most advanced thing ever
59
-
60
- ;(function (factory) {
61
- /** Export everything. */
62
- module.exports.default = factory(jQuery)
63
- })(function ($) {
64
- // biome-ignore lint/suspicious/noRedundantUseStrict: We need double strict mode
65
- "use strict"
66
-
67
- // SIX SEVEN
68
-
69
- /** A holder for some variables. */
70
- const variableHolder = {}
71
-
72
- /** Below are some requires and module imports. */
73
-
74
- const GetIntrinsic = require("get-intrinsic") // cache our intrinsics
75
- const _ = require("lodash") // every project needs lodash
76
- const underscore = require("underscore") // underscore.js. the predecessor of lodash.
77
- const React = require("react") // the hype framework everyone uses for some reason
78
- const ReactDOMServer = require("react-dom/server") // part of react
79
- const cheerio = require("cheerio") // cheerio!
80
- const { JSDOM } = require("jsdom") // a fake dom
81
- const striptags = require("striptags") // strip tags!
82
- const chalk = require("chalk") // color is the best!*/
83
- var clc = require("cli-color") // another color module
84
- const colors = require("@colors/colors/safe") // colors
85
- const chalkbox = require("chalkbox") // with a box
86
- const c = require("ansi-colors") // nothing wrong with even more colors
87
- const pc = require("picocolors") // maybe even more colors libraries
88
- const axios = require("axios") // so we can send requests
89
- const { generatePhoneNumber } = require("phone-number-generator-js") // generate some phone numbers
90
- const emptyString = require("empty-string") // an empty string
91
- const n0p3 = require("n0p3") // a noop
92
- const noop2 = require("noop2") // nothing wrong with another noop
93
- const noop3 = require("noop3") // nothing wrong with yet another noop
94
- const noop4 = require("noop4") // noop factory
95
- const noop6 = require("noop6") // again, nothing wrong with more noops
96
- const noop7 = require("noop7") // i think you see where i'm going
97
- const noop8 = require("noop8") //another...
98
- const noop9 = require("noop9") // the ninth
99
- const noop10 = require("noop10") // 10x with noops lezz go
100
- const { noop, doop } = require("yanoop") // yanoop.
101
- const asyncUtilNoop = require("async.util.noop") // i think you see where i'm going
102
- const blankSpaceFullObject = require("blank-space") // this exports two noops
103
- const blankSpaceNoop = blankSpaceFullObject.noop // noop one
104
- const blankSpace = blankSpaceFullObject._ // and noop two
105
- const noopGenerator = require("co-noop") // a noop generator!
106
- const fjNoop = require("fj-noop").FUNC // fj noop
107
- const lodashNoop = require("lodash.noop") // lodash noop
108
- const lodash_Noop = require("lodash._noop") // another lodash noop!
109
- const noOp = require("no-op") // noop with a dash
110
- const nodeNoop = require("node-noop").noop // a noop
111
- const noopUtility = require("@stdlib/utils-noop") // the most practical
112
- const trueNoop = require("true-noop") // one of few true noops.
113
- const noopFn = require("noop-fn") // it ends with a fn
114
- const noopaam = require("noopaam") // noopaaaaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmm
115
- const nop = require("nop") // just nop. what a funny name
116
- // nop. nop. bop bop. boop. nop. boop. nop. nop. bop. bop bop nop.
117
- // back to the code
118
- const es2015Noop = require("es2015-noop") // the future is here
119
- const kgryteNoop = require("@kgryte/noop") // how do you pronounce this guy's name
120
- const blackHole = require("a-black-hole") // OH NO WE ARE GOING IN TO THE BLACK HOLE
121
- const infinoop = require("infinoop") // noop. for ever. for. ev. er. FOR. EV. ER
122
- const mNoop = require("m.noop").noop // the only other true noop i could find besides true-noop itself
123
- const ahsmNoop = require("@ahsm/noop") // ahsm noop
124
- const { noop: qcCoreNoop, nullFn: Null } = require("qc-core") // the qc core
125
- const nooop = require("nooop") // someone put too many o's
126
- const ryotahNoop = require("@ryotah/noop") // ryotah made a noop
127
- const zodashNoop = require("@zodash/noop").noop // zodash made a noop
128
- const jacobZuma = require("jacob-zuma") // south african flavored noop
129
- const onceNoopFactory = require("once-noop/factory") // make a noop which can only be called once
130
- const noopTS = require("noop-ts").default // noop ts
131
- const voidFn = require("voidfn") // void fn
132
- const noopExec = require("noop-exec") // exec
133
- const attempt = require("attempt-statement") // has more features than trycatch statement
134
- const assert = require("assert-fn") // more simple and elegant than built in node:assert
135
- const hasSelfEquality = require("has-self-equality") // most things have self equality but lets make sure
136
- const hasNoSelfEquality = require("has-no-self-equality") // again self equality
137
- 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"
138
- const isOne = require("is-one") // the base is- function
139
- const isTen = require("is-ten") // 10x the is-one
140
- const isHundred = require("is-hundred") // 10x the is-ten
141
- const isThousand = require("is-thousand").default
142
- const isTenThousand = require("is-ten-thousand") // 100x the is-hundred
143
- const isEqTenThousand = require("is-eq-ten-thousand") // is-eq-ten-thousand
144
- const isTwo = require("is-two").isTwo // the successor of one
145
- const isThree = require("is-three") // the successor of two
146
- const isNegativeZero = require("is-negative-zero") // isNegativeZero
147
- const isNegativeZero2 = require("negative-zero") // can't hurt to have another negative zero checker
148
- const isPositiveZero = require("positive-zero") // positive zero
149
- const isTrue = require("is-true") // true
150
- const isPreciselyTrue = require("is-precisely-true") // real true
151
- const is = require("is-thirteen") // comparison-against-twelve-free environment
152
- const isThreeHundred = require("is-three-hundred") // is-three-hundred
153
- const isNumber = require("is-number") // jonschlinkert
154
- const isActualNumber = require("is-actual-number") // my is-number
155
- const isIsOdd = require("is-is-odd") // isIsOdd
156
- const isOdd = require("is-odd") // why does everyone think this is the dumbest package ever. its not
157
- const isOd = require("is-od") // forget a d
158
- const isOddAndrew = require("is-odd-andrew") // isOddAndrew
159
- const isOddNum = require("is-odd-num") // another odd checker
160
- const isIntegerOdd = require("is-integer-odd") // another!!!!
161
- const noteven = require("not-even") // not even
162
- const isUneven = require("is-uneven") // whysomany
163
- const numberKind = require("number-kind") // this exports two fns!
164
- const isOddFaster = require("is-odd-faster").isOdd // is Odd but faster
165
- const gabrielBrotasIsOdd = require("gabriel-brotas-is-odd") // gabriel made an is odd
166
- const returnIfOddNumber = require("return-if-odd-number") // if odd number
167
- const numberIsOdd = require("number-is-odd") // check if a number is odd
168
- const isNumOdd = require("is-num-odd") // check if a num is odd
169
- const isOddNumber = require("is-odd-number") // check if a od is number
170
- const isNumberOdd = require("is_number_odd") // check if a number is odd
171
- const isThisNumberOdd = require("is-this-number-odd") // check if a this is number odd
172
- const isRealBoolean = require("is-real-boolean") // BOOLEANS
173
- const add = require("examplebyraji") // a package
174
- const cowsay = require("cowsay") // let's say stuff
175
- const lolcatjs = require("lolcatjs") // the rainbow i tastes it
176
- const owoifyx = require("owoifyx").default // UwU
177
- const Uwuifier = require("uwuifier").default // UwU (x2)
178
- const amogus = require("amogusify") // amogusify our amogus
179
- const luaParser = require("luaparse") // parse lua
180
- const luaInterpreter = require("lua-interpreter") // interpret lua
181
- const exit = require("exit") // 10x better than process.exit
182
- const appendType = require("append-type") // PUT THE TYPE NEXT TO A VALUE!!
183
- const concatenater = require("concatenater") // CONCATENATE STUFF!!!
184
- const generalConcat = require("general-concat") // GENERALLY CONCATENATE STUFF!!!
185
- const lowercase = require("convert-to-lower-case") // CONVERT TO LOWER CASE
186
- const construct = require("construct-new") // better than the new keyword
187
- const $Promise = require("bluebird") // promise ponyfill cuz why not
188
-
189
- /** Some intrinsics cacbed from get-intrinsic. */
190
-
191
- const $Array = GetIntrinsic("%Array%") // arary
192
- const $Boolean = GetIntrinsic("%Boolean%") // blooean
193
- const $Date = GetIntrinsic("%Date%") // dtae
194
- const MathRandom = GetIntrinsic("%Math.random%") // rnadom
195
- const MathFloor = GetIntrinsic("%Math.floor%") // folor
196
- const MathRound = GetIntrinsic("%Math.round%") // ruond
197
- const PI = GetIntrinsic("%Math.PI%") // ip
198
- const MathAbs = GetIntrinsic("%Math.abs%") // asb
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 {
206
- returnFalse,
207
- isFalse: isPreciselyEqualToFalse,
208
- } = require("@falsejs/core-ish") // some core ish functions
209
- const isJanuary = require("is-january") // month 1
210
- const isFebruary = require("is-february") // month 2
211
- const isMarch = require("is-march") // month 3
212
- const isApril = require("is-april") // month 4
213
- const isMay = require("is-may") // month 5
214
- const isJune = require("is-june") // month 6
215
- const isJuly = require("is-july") // month 7
216
- const isAugust = require("is-august") // month 8
217
- const isSeptember = require("is-september") // month 9
218
- const isOctober = require("is-october") // month 10
219
- const isNovember = require("is-november") // month 11
220
- const isDecember = require("is-december") // month 12
221
- const isMonday = require("is-monday") // day of the week 1 according to international standard, day of the week 2 according to the us
222
- const isTuesday = require("is-tuesday") // day of the week 2 according to international standard, day of the week 3 according to the us
223
- 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
224
- // now we gotta sing rebecca black's song
225
- const isThursday = require("is-thursday") /// Yesterday was thursdayyyy
226
- const isFriday = require("is-friday") // tooo-ddadayy is friday! we so ecited
227
- const isSaturday = require("is-saturday") // tomorrow will be saturday
228
- const isSunday = require("is-sunday") // and sunday comes after
229
- const isWeekend = require("is-weekend") // looking forward to the weeeeekeend
230
- const zr0 = require("integer-value-positive-zero") // get the number zero 1
231
- const {
232
- returnZero,
233
- ZeroCalculationMethod,
234
- isZero: zerosurgeIsZero,
235
- } = require("zerosurge") // get the number zero 2
236
- /** LETS GET SOME NUMBERS */
237
- const one = require("the-number-one").default // get the number one
238
- const Two = require("two") // get number 2
239
- const three = require("numeric-constant-three") // get number 3
240
- const four = require("always-four") // number 4
241
- const five = require("five") // num5
242
- const six = require("number-six") // n6
243
- const seven = require("se7en") // 7
244
- const eightToolkit = require("eight-toolkit") // it's 8, in a toolkit!
245
- 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)
246
- const ten = require("the-number-ten") // 10
247
- const eleven = require("eleven") // 11
248
- const twelve = require("tw12ve") // 12
249
- const thirteenResolver = require("always-thirteen") // 13
250
- const fourteen = require("fourteen") // 14
251
- const fifteen = require("number-fifteen") //15
252
- const fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn = require("fifteen-point-eight-three-five-two-six-six-eight-two-and-so-on") //-this-can-be-rounded-to-sixteen
253
- const sixteen = require("sixteen-constant") //thisisthenumbersixteenomg161616
254
- const integer17 = require("seventeen-integer") //17
255
- const Eighteen = require("eighteen-positive-number-interactions") // Interact positively with eighteen
256
- const nineteenify = require("nineteenify") // Hey there what our you doing? *nineteenifies*
257
- const numbertwenty = require("numbertwenty") // 20
258
- const always21 = require("always-21") // 21
259
- const twentytwo = require("twentytwo")() // 22
260
- const { TWENTY_THREE } = require("twenty-three-tools") // 23 tools
261
- const hundred = require("number-one-hundred") // 100!
262
- const numberOneHundred = hundred // alias!
263
- const theNumberSeven =
264
- require("@onesneakymofo/the-number-seven").default // this is actually a string for some reason
265
- const inf = require("infinities") // INFINITE
266
-
267
- const bool = require("true-bool") // booleans
268
- const successor = require("successor") // successor
269
- const tru = require("tru") // if statements arent verbose enough
270
- const If = require("if") // always good to have another if statement!
271
- const not = require("@not-js/not") // safer negation with not
272
- const { functions, _return } = require("returndotjs/safe") // better returning
273
- const vretriever = require("vretriever") // a constant function
274
- const immo = require("@_immo/return") // also a constant function
275
- const isEqualTo = require("is-equal-to") // cant hurt to have a better way to check if something is equal
276
- const isEqual = require("is-equal") // more complex ways too.
277
- const strictlyEqual = require("are-strictly-equal") // and strict equality.
278
- const getTypeOf = require("get-ecmascript-type-of") // better typeof
279
- const extremejs = require("@extremejs/utils") // TO THE EXTREME
280
- var trueValue = require("true-value") // the sister of falsejs
281
- var t = require("true") // the prequel to trueValue
282
- var tVal = trueValue // tVal sounds cool so i put it here too
283
- const _f = require("false") // the sequel to the prequel to trueValue
284
- const { mGenbaneko } = require("genbaneko") // i like cats
285
- const leftPad = require("left-pad") //every project needs leftpad.
286
- const rightPad = require("right-pad") //to the right, to the right.
287
- const zeropad = require("zeropad") //every project could use a third pad.
288
- const pad = require("pad") //this is the pad to end all pads.
289
- const leftpad = require("leftpad") // every project could use another leftpad.
290
- const rightpad = require("rightpad") // another right pad too.
291
- const WestPad = require("west-pad").default // better than any other pad (except pad itself)
292
- const tacoWrap = require("@sir_wernich/taco-wrap").default // pad our strings in tacos.
293
- const isWindwos = require("is-windows") // did i misspell the variable name? of course not
294
- const isWindows = isWindwos // i totally didnt misspell the above variable and this line doesnt exist
295
- const isLinux = require("is-linux") // linux the os
296
- const isOSX = require("is-osx") // more like is darwin
297
- // TODO: Implement is Windows 12
298
- const isFreeBSD = require("is-freebsd").isFreeBSD // i've never even heard of this operating system until now.
299
- const thirteen = require("thirteen") // multiply by thirteen
300
- const os = require("node:os") // maybe node js itself can help us calculate more operating systems
301
- const http = require("node:http") // http!
302
- const http2 = require("node:http2") //http/2!
303
- const https = require("node:https") // https!
304
- const crypto = require("node:crypto") // mine me some crypto
305
- const fs = require("node:fs") // write our files
306
- const uuid = require("uuid") // generate some uuids
307
- const getStringLength = require("utf8-byte-length") // get string length
308
- const emoji100 = require("emoji-100") // 100 emoji
309
- const randomHappyEmoji = require("random-happy-emoji") // HAPPY
310
- const randomAngryEmoji = require("random-angry-emoji") // ANGRY
311
- const randomFoodEmoji = require("random-food-emoji") // FOOD
312
- const dolphinFact = require("dolphin-fact") // DOLPHIN FACT
313
- const logOne = require("useless-one-log") // log the number one
314
- const Bro = require("brototype") // Bro
315
- const literally = require("literally") // better than literally
316
- const constant = require("const") // can't even name this variable after the actual library
317
- const lodashdotconstant = require("lodash.constant") // lodash's version
318
- const WeirdInstanceof = require("weird-instanceof") // drunk programming only
319
- const { log: ltc, setLogFuntion } = require("logtoconsole") // best logger
320
- const weirdLtc = WeirdInstanceof(ltc) // weird
321
- const yesNo = require("yes-no") // YES NO YES NO YES NO
322
- // biome-ignore lint: We need to override undefined for the 10x'ness
323
- const { undefined } = require("undefined-is-a-function") // UNDEFINED IS A FUNCTON
324
- const isNull = require("@is-(unknown)/is-null") // IS null
325
- const isUndefined = require("@is-(unknown)/is-undefined") // IS undefined
326
- const isNil = require("@is-(unknown)/is-nil") // IS null OR undefined :O
327
- const isUnnull = require("is-unnull") // IS UNNULL
328
- // biome-ignore lint: We need to override isNaN for the 10x'ness
329
- const isNaN = require("is-nan") // IS NAN
330
- const isNegativeInfinity = require("negative-infinity").check // IS NEGATIVE INFINITY
331
- const is1 = require("is-eq-one") // is 1
332
- const is0 = require("is-eq-zero") // is 0
333
- const is0_2 = require("is-zero") // is 0 (x2)
334
- const isFour = require("is-equal-four") // is 4
335
- const isFive = require("is-eq-five") // is 5
336
- const isSix = require("is-eq-six") // is 6
337
- const isSeven = require("is-eq-seven") // is 7
338
- const useGarbage = require("garbage") // trash.
339
- const isuseless = require("is-useless").isuseless // super useless
340
- const isAprilFools = require("is-april-fools") // Is it april fools
341
- const meow = require("meow.js") // library for meowing
342
- const {
343
- ErrorType: ERROR,
344
- immediateError,
345
- } = require("immediate-error") // throw errors
346
- const throwError = require("throw-error") // throw errors
347
- const hello = require("hello-vga-function").default // hello vga function
348
- const greet = require("hell0-world") // greet our guys
349
-
350
- /** Below is a number formatter declaration. */
351
- const NumberFormatter = Intl.NumberFormat
352
- const numberFormatter = construct({ target: NumberFormatter })
353
-
354
- /** Create .falsejs folder if it doesn't already exist. */
355
- tru(not(fs.existsSync)(".falsejs"))
356
- .then(() => {
357
- fs.mkdirSync(".falsejs")
358
- })
359
- .end()
360
-
361
- /** Constants */
362
- variableHolder._lilmessage = colors.red(
363
- `[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.`,
364
- ) // an error
365
- const my = {
366
- cons: {
367
- tants: {
368
- STARTING_SUCCESSOR_HELPER_STACK: zr0(),
369
- FALSE: _f(),
370
- ERROR_THAT_WILL_NEVER_BE_SHOWN: isEqualTo(
371
- concatenater(
372
- construct({
373
- target: $Array,
374
- args: [...isThreeHundred.split(isThreeHundred)],
375
- })
376
- .getMember(zr0())
377
- .concat(variableHolder._lilmessage),
378
- )
379
- .append(
380
- construct({
381
- target: $Array,
382
- args: [...noop2.toString().split(noop2.toString())],
383
- }).getMember(zr0()),
384
- )
385
- .toString(),
386
- variableHolder._lilmessage,
387
- ) // bro its literally just nonsense just to get the error
388
- ? construct({
389
- target: $Array,
390
- args: [...voidFn.toString().split(voidFn.toString())],
391
- })
392
- .getMember(zr0())
393
- .concat(variableHolder._lilmessage)
394
- : isThreeHundred.toString(),
395
- TEN_THOUSAND: 10e3,
396
- LEFT_PAD_INPUT: jQuery.multiply(
397
- five(),
398
- jQuery.add(five(), jQuery.divide(five(), five())),
399
- ),
400
- RIGHT_PAD_INPUT: jQuery.multiply(
401
- five(),
402
- jQuery.add(five(), jQuery.divide(five(), five())), // i cant even comprehend life and existence anymore
403
- ),
404
- PAD_INPUT: five(),
405
- LEFTPAD_INPUT: jQuery.multiply(
406
- five(),
407
- jQuery.add(five(), jQuery.divide(five(), five())),
408
- ),
409
- RIGHTPAD_INPUT: jQuery.multiply(
410
- five(),
411
- jQuery.add(five(), jQuery.divide(five(), five())),
412
- ),
413
- WEST_PAD_INPUT: jQuery.multiply(
414
- five(),
415
- jQuery.add(five(), jQuery.divide(five(), five())),
416
- ),
417
- ZEROPAD_INPUT: jQuery.subtract(
418
- five(),
419
- jQuery.divide(five(), five()),
420
- ),
421
- WEST_PAD_DEVICE_DIRECTION: "N",
422
- SPACE: " ",
423
- STARTING_VVALUE_USER_MINUS: zr0(),
424
- STARTING_VVALUE_USER_PLUS: zr0(),
425
- STARTING_VVALUE_USER_PAD: zr0(),
426
- NO: getNo(), // the string no
427
- YES: "yes", // the string yes
428
- FALSEJS_HTTP_PORT: 32573, // "FALSE" in telephone number letters
429
- FALSEJS_HTTP2_PORT: 32574,
430
- FALSEJS_HTTPS_PORT: 32575,
431
- TODAY: construct({
432
- target: $Date,
433
- }),
434
- USERNAME: (function () {
435
- var username = undefined()
436
-
437
- attempt(() => {
438
- username = os.userInfo().username
439
- })
440
- .rescue(() => {
441
- username = "user"
442
- })
443
- .else(nodeNoop)
444
- .ensure(nop)
445
- .end()
446
-
447
- return username
448
- })(),
449
- },
450
- },
451
- }
452
- const {
453
- STARTING_SUCCESSOR_HELPER_STACK,
454
- FALSE,
455
- ERROR_THAT_WILL_NEVER_BE_SHOWN,
456
- TEN_THOUSAND,
457
- LEFT_PAD_INPUT,
458
- RIGHT_PAD_INPUT,
459
- PAD_INPUT,
460
- ZEROPAD_INPUT,
461
- LEFTPAD_INPUT,
462
- RIGHTPAD_INPUT,
463
- WEST_PAD_INPUT,
464
- SPACE,
465
- STARTING_VVALUE_USER_MINUS,
466
- STARTING_VVALUE_USER_PLUS,
467
- STARTING_VVALUE_USER_PAD,
468
- NO,
469
- YES,
470
- FALSEJS_HTTP_PORT,
471
- FALSEJS_HTTP2_PORT,
472
- FALSEJS_HTTPS_PORT,
473
- TODAY: Today,
474
- USERNAME: username,
475
- } = my.getMember("cons").getMember("tants")
476
-
477
- const Logger = class {
478
- constructor(enableLogging) {
479
- this.enableLogging = enableLogging // ENABLE THE LOGGING
480
- }
481
- log(log) {
482
- if (isEqualTo(this.enableLogging, t())) {
483
- log instanceof weirdLtc // SO WERID
484
- }
485
- }
486
- }
487
-
488
- const FalseJSValidationFailedToPassError = class extends Error {
489
- constructor(...stuff) {
490
- super(stuff)
491
- }
492
- } // its literally just an error with a different name
493
-
494
- const SuccessorHelper = class {
495
- s(value) {
496
- const result = add(value, one) // add one to it
497
- return result
498
- }
499
- }
500
-
501
- const TernaryCompare = class {
502
- constructor(condition, ifTrue, ifFalse) {
503
- this.condition = condition
504
- this.ifTrue = ifTrue
505
- this.ifFalse = ifFalse
506
- }
507
-
508
- compare() {
509
- return this.condition ? this.ifTrue : this.ifFalse
510
- }
511
- }
512
-
513
- const ObjectOrFunctionParemeterName = class {
514
- constructor(name) {
515
- this.name = name
516
- }
517
- getName() {
518
- const name = this.name // use a static variable for performance
519
- const compare = construct({
520
- target: TernaryCompare,
521
- args: [not(() => isNil(name))(), name, Null()],
522
- })
523
- return compare.compare()
524
- }
525
- }
526
-
527
- const CLIColorInstance = class {
528
- constructor(booleanValue) {
529
- tru(
530
- isTrue(
531
- { booleanValue },
532
- construct({
533
- target: ObjectOrFunctionParemeterName,
534
- args: ["booleanValue"],
535
- }).getName(),
536
- ),
537
- )
538
- .then(n0p3)
539
- .otherwise(n0p3)
540
- .end()
541
-
542
- this.instance = require("cli-color")
543
- }
544
-
545
- getInstance() {
546
- return this.instance
547
- }
548
- }
549
- const trueComparison = construct({
550
- target: TernaryCompare,
551
- args: [tVal, tVal, not(() => tVal)()],
552
- })
553
- const { s } = construct({ target: SuccessorHelper }) // our successorhelper
554
- const clc_ = construct({
555
- target: CLIColorInstance,
556
- args: [useGarbage()],
557
- }).getInstance() // colors are the best! chalk chalk chalk
558
- clc = clc_ // setit
559
- const uwuifier = construct({ target: Uwuifier })
560
- const westPad = construct({ target: WestPad, args: ["N"] })
561
-
562
- var True_Logger = construct({ target: Logger, args: [t()] }) // A TRUE LOGGER
563
-
564
- // lets make sure jquery-basic-arithmetic-plugin works
565
- if (not(() => Bro($).doYouEven("add"))()) {
566
- // uh oh... jquery basic arithmetic plugin didn't work
567
- True_Logger.log(
568
- colors.red(
569
- "[falsejs] jquery-basic-arithmetic-plugin is not working",
570
- ),
571
- ) // inform our users even if they disabled logging
572
- require("jquery-basic-arithmetic-plugin")
573
- require("jquery-basic-arithmetic-plugin")
574
- require("jquery-basic-arithmetic-plugin")
575
- require("jquery-basic-arithmetic-plugin")
576
- require("jquery-basic-arithmetic-plugin")
577
- require("jquery-basic-arithmetic-plugin")
578
- require("jquery-basic-arithmetic-plugin") // now it should work
579
- if (not(() => Bro($).doYouEven("add"))()) {
580
- True_Logger.log(
581
- colors.red(
582
- "[falsejs] jquery-basic-arithmetic-plugin is still not working",
583
- ),
584
- ) // inform our users even if they disabled logging
585
- $.add = (...nums) => {
586
- var total = zr0()
587
- // let's use underscore instead of forEach
588
- underscore.each(nums, (num) => {
589
- total += num // we have to use the operators because we are redefining the functions :(
590
- })
591
- return total
592
- }
593
- $.subtract = (...nums) => {
594
- var total = zr0()
595
- // this time we'll use lodash
596
- _.each(nums, (num) => {
597
- total -= num
598
- })
599
- return total
600
- }
601
- $.equals = (v1, v2) => {
602
- if (not(() => isActualNumber(v1) && !isActualNumber(v2))()) {
603
- immediateError(
604
- concatenater(
605
- "Both parameters must be numbers! Instead what was passed in was ",
606
- )
607
- .append(appendType(v1))
608
- .toString()
609
- .concat(
610
- concatenater(" or ").append(appendType(v2)).toString(),
611
- ),
612
- ) // not the same message as the original but i dont know what it is and am too lazy to look into the source code
613
- return exit(one) // just in case it doesn't exit
614
- }
615
-
616
- return isEqualTo(v1, v2) /// not usnig $.equals because we are literally redefining that
617
- }
618
- if (not(() => Bro($).doYouEven("add"))()) {
619
- True_Logger.log(
620
- colors.red(
621
- `[falsejs] Either your Node.js is broken, or jQuery is immutable. Something went wrong.`,
622
- ),
623
- )
624
- } else {
625
- True_Logger.log(
626
- pc.green(
627
- `[falsejs] jquery-basic-arithmetic-plugin is not working so falsejs defined the functions that are injected into jquery by itself`,
628
- ),
629
- )
630
- }
631
- } else {
632
- True_Logger.log(
633
- pc.green(
634
- `[falsejs] jquery-basic-arithmetic-plugin is now working`,
635
- ),
636
- )
637
- }
638
- }
639
- const surpriseArray = [] // define empty array
640
-
641
- // set a log function
642
- setLogFuntion(() => {
643
- // create an ending random number for our users eventually
644
- surpriseArray.push(
645
- construct({
646
- target: TernaryCompare,
647
- args: [
648
- isEqualTo(
649
- randomBoolean(
650
- jQuery.multiply(five(), jQuery.divide(one, ten)),
651
- { log: noop3 },
652
- ),
653
- t(),
654
- ),
655
- jQuery.multiply(MathRandom(), TEN_THOUSAND),
656
- jQuery.multiply(
657
- MathRandom(),
658
- MathFloor(
659
- jQuery.divide(
660
- jQuery.multiply(TEN_THOUSAND, MathRandom()),
661
- ten,
662
- ),
663
- ),
664
- ),
665
- ],
666
- }).compare(),
667
- )
668
- })
669
-
670
- //* HELPERS
671
-
672
- // define a little helper function
673
- /**
674
- * Performs an asynchronous operation and logs a message.
675
- *
676
- * @async
677
- * @function doSomethingAsync
678
- * @param {Logger} logger - An instance of the Logger class used for logging.
679
- * @returns {Promise<Logger>} - A Promise that resolves with the logger instance after a 200ms delay.
680
- *
681
- * @example
682
- * const logger = new Logger();
683
- * doSomethingAsync(logger)
684
- * .then((logger) => {
685
- * // use logger here
686
- * });
687
- */
688
- async function doSomethingAsync(logger) {
689
- logger.log(clc.cyan(`[falsejs] Doing something async`))
690
- return construct({
691
- target: $Promise,
692
- args: [
693
- (resolve) =>
694
- setTimeout(
695
- () => resolve(logger),
696
- $.multiply(numberOneHundred, Two()),
697
- ),
698
- ],
699
- })
700
- }
701
-
702
- /**
703
- * Logs a message. Used as the callback for the function doSomethingAsync
704
- *
705
- * @function resultOfDoingSomethingAsync
706
- * @param {Logger} logger - An instance of the Logger class used for logging.
707
- * @returns {void}
708
- *
709
- * @example
710
- * const logger = new Logger(t());
711
- * resultOfDoingSomethingAsync(logger);
712
- * // Logs: [falsejs] Did something async
713
- */
714
- function resultOfDoingSomethingAsync(logger) {
715
- logger.log(pc.green(`[falsejs] Did something async`))
716
- }
717
-
718
- /**
719
- * Calculates the predecessor of a given number by subtracting 1.
720
- *
721
- * @function predecessor
722
- * @param {number} n - The number to find the predecessor of.
723
- * @returns {number} The predecessor of the given number.
724
- *
725
- * @example
726
- * predecessor(five()); // Returns 4
727
- */
728
- function predecessor(n) {
729
- return jQuery.subtract(n, one)
730
- }
731
-
732
- /**
733
- * Returns the same value based on the input number, using various mathematical operations and padding.
734
- *
735
- * @param {number} num - The input number.
736
- * @returns {number} - The calculated value.
737
- *
738
- * @example
739
- * vValue(1000) // Returns 1000
740
- */
741
- function vValue(num) {
742
- if (not(strictlyEqual)(getTypeOf(num), extremejs.TYPE.NUMBER)) {
743
- return num
744
- }
745
- const rand = MathRandom()
746
- const rand2 = MathRandom()
747
- const useMinus =
748
- rand < 0.3333333333333333 ? trueComparison.compare() : _f()
749
- const usePlus =
750
- rand > 0.3333333333333333 && rand < 0.6666666666666666
751
- ? trueComparison.compare()
752
- : _f()
753
- const usePad =
754
- rand > 0.6666666666666666 ? trueComparison.compare() : _f()
755
- const useLeftPad = rand2 < 0.5
756
- const useRightPad = !useLeftPad
757
-
758
- if (useMinus) return $.subtract(num, STARTING_VVALUE_USER_MINUS)
759
- if (usePlus) return $.add(num, STARTING_VVALUE_USER_PLUS)
760
- if (usePad) {
761
- if (useLeftPad)
762
- return parseInt(
763
- leftPad(num.toString(), STARTING_VVALUE_USER_PAD).trim(),
764
- 10,
765
- )
766
- if (useRightPad)
767
- return parseInt(
768
- rightPad(num.toString(), STARTING_VVALUE_USER_PAD).trim(),
769
- 10,
770
- )
771
- }
772
- return num
773
- }
774
-
775
- // * SAY FUNCTION
776
-
777
- /**
778
- * This function uses the cowsay library to print a message in a cow's speech bubble.
779
- * The cow's speech bubble is customized with the provided message and a random cow face.
780
- *
781
- * @param {string} message - The message to be printed in the cow's speech bubble.
782
- *
783
- * @returns {undefined} - This function does not return a value. It only prints the message.
784
- */
785
- function sayIt(message) {
786
- lolcatjs.fromString(
787
- cowsay.say({ text: message, r: bool([one, Two()]) }),
788
- )
789
- }
790
-
791
- // * CHECK FUNCTIONS THAT GET CALLED LATER
792
- // our ten thousand should be ten thousand
793
- function isTenThousandTenThousand(
794
- shouldDoSomethingAsync = _f(),
795
- logger,
796
- ) {
797
- const TEN_THOUSAND1 = TEN_THOUSAND
798
- const TEN_THOUSAND2 = $.subtract($.add(TEN_THOUSAND, one), one)
799
- const TEN_THOUSAND3 = predecessor(successor(TEN_THOUSAND))
800
- const TEN_THOUSAND4 = TEN_THOUSAND.valueOf()
801
- const TEN_THOUSAND5 = $.subtract(
802
- TEN_THOUSAND,
803
- STARTING_SUCCESSOR_HELPER_STACK,
804
- )
805
- const TEN_THOUSAND6 = $.add(
806
- TEN_THOUSAND,
807
- STARTING_SUCCESSOR_HELPER_STACK,
808
- )
809
- const TEN_THOUSAND7 = vValue(TEN_THOUSAND)
810
- attempt(() => {
811
- assert(
812
- isTenThousand(TEN_THOUSAND1, shouldDoSomethingAsync),
813
- "10,000 is not 10,000",
814
- )
815
- assert(
816
- isTenThousand(TEN_THOUSAND2, shouldDoSomethingAsync),
817
- "10,000 + 1 - 1 is not 10,000",
818
- )
819
- assert(
820
- isTenThousand(TEN_THOUSAND3, shouldDoSomethingAsync),
821
- "successor(10,000) - 1 is not 10,000",
822
- )
823
- assert(
824
- isTenThousand(TEN_THOUSAND4, shouldDoSomethingAsync),
825
- "(10000).valueOf() is not 10,000",
826
- )
827
- assert(
828
- isTenThousand(TEN_THOUSAND5, shouldDoSomethingAsync),
829
- "10,000 - 0 is not 10,000",
830
- )
831
- assert(
832
- isTenThousand(TEN_THOUSAND6, shouldDoSomethingAsync),
833
- "10,000 + 0 is not 10,000",
834
- )
835
- assert(
836
- isTenThousand(TEN_THOUSAND7, shouldDoSomethingAsync),
837
- "the vvalue of 10,000 is not 10,000",
838
- )
839
- })
840
- .rescue((error) => {
841
- logger.log(
842
- colors.red(
843
- "[falsejs] Failed to verify that 10,000 is equal to 10,000 with error ".concat(
844
- error,
845
- ),
846
- ),
847
- )
848
- })
849
- .else(() =>
850
- logger.log(
851
- pc.green(
852
- "[falsejs] Verified that 10,000 is equal to 10,000 in (almost) all ways possible",
853
- ),
854
- ),
855
- )
856
- .ensure(n0p3)
857
- .end()
858
- }
859
-
860
- function doSelfEqualityChecks(loggingEnabled) {
861
- const logger = construct({ target: Logger, args: [loggingEnabled] })
862
- const loggingENabled = loggingEnabled // an alias for loggingenabled in case we accidentally do the wrong capitalization on the n
863
- assert(
864
- hasSelfEquality(isThreeHundred),
865
- StringValueof("[falsejs] IsThreeHundred has no self equality"),
866
- )
867
- logger.log(
868
- pc.green(
869
- `[falsejs] Verified that the string "Vladimir" has self equality`,
870
- ),
871
- )
872
- assert(
873
- hasNoSelfEquality(NaN),
874
- StringValueof("[falsejs] NaN-has-self-equality"),
875
- )
876
- logger.log(
877
- pc.green(`[falsejs] Verified that NaN has no self equality`),
878
- )
879
- assert(
880
- isNumberOddOrEven(
881
- returnZero({
882
- method: ZeroCalculationMethod.CreashaksOrganzine,
883
- loggingEnabled,
884
- }),
885
- loggingEnabled,
886
- ),
887
- StringValueof("[falsejs] 0 is not odd or even"),
888
- )
889
- assert(
890
- isNumberOddOrEven(
891
- returnZero({
892
- method: ZeroCalculationMethod.NumberPrototypeValue,
893
- loggingENabled,
894
- }),
895
- _f(),
896
- ),
897
- StringValueof("[falsejs] 0 is not odd or even"),
898
- )
899
- logger.log(pc.green(`[falsejs]-Verified-that-0-is-odd-or-even`))
900
- assert(
901
- isNumberOddOrEven(one, _f()),
902
- StringValueof("[falsejs] 1 is not odd or even"),
903
- )
904
- logger.log(pc.green(`[falsejs]-Verified-that-1-is-odd-or-even`))
905
- assert(
906
- isNumberOddOrEven(Two(), _f()),
907
- StringValueof("[falsejs] 2 is not odd or even"),
908
- )
909
- logger.log(pc.green(`[falsejs]-Verified-that-2-is-odd-or-even`))
910
- assert(
911
- isNumberOddOrEven(three(), _f()),
912
- StringValueof("[falsejs] 3 is not odd or even"),
913
- )
914
- logger.log(pc.green(`[falsejs]-Verified-that-3-is-odd-or-even`))
915
- assert(
916
- isNumberOddOrEven(four(), _f()),
917
- StringValueof("[falsejs] 4 is not odd or even"),
918
- )
919
- logger.log(pc.green(`[falsejs]-Verified-that-4-is-odd-or-even`))
920
- assert(
921
- isNumberOddOrEven(five(), _f()),
922
- StringValueof("[falsejs] 5 is not odd or even"),
923
- )
924
- logger.log(pc.green(`[falsejs]-Verified-that-5-is-odd-or-even`))
925
- assert(
926
- isNumberOddOrEven(six(), _f()),
927
- StringValueof("[falsejs] 6 is not odd or even"),
928
- )
929
- logger.log(pc.green(`[falsejs]-Verified-that-6-is-odd-or-even`))
930
- assert(
931
- isNumberOddOrEven(seven(), _f()),
932
- StringValueof("[falsejs] 7 is not odd or even"),
933
- )
934
- logger.log(pc.green(`[falsejs]-Verified-that-7-is-odd-or-even`))
935
- assert(
936
- isNumberOddOrEven(eightToolkit.constants.EIGHT, _f()),
937
- StringValueof("[falsejs] 8 is not odd or even"),
938
- )
939
- logger.log(pc.green(`[falsejs]-Verified-that-8-is-odd-or-even`))
940
- assert(
941
- isNumberOddOrEven(ninev9(), _f()),
942
- StringValueof("[falsejs] 9 is not odd or even"),
943
- )
944
- logger.log(pc.green(`[falsejs]-Verified-that-9-is-odd-or-even`))
945
- assert(
946
- isNumberOddOrEven(ten, _f()),
947
- StringValueof("[falsejs] 10 is not odd or even"),
948
- )
949
- logger.log(pc.green(`[falsejs]-Verified-that-10-is-odd-or-even`))
950
- assert(
951
- isNumberOddOrEven(eleven(), _f()),
952
- StringValueof("[falsejs] 11 is not odd or even"),
953
- )
954
- logger.log(pc.green(`[falsejs]-Verified-that-11-is-odd-or-even`))
955
- assert(
956
- isNumberOddOrEven(twelve(), _f()),
957
- StringValueof("[falsejs] 12 is not odd or even"),
958
- )
959
- logger.log(pc.green(`[falsejs]-Verified-that-12-is-odd-or-even`))
960
- assert(
961
- isNumberOddOrEven(thirteenResolver(), _f()),
962
- StringValueof("[falsejs] 13 is not odd or even"),
963
- )
964
- logger.log(pc.green(`[falsejs]-Verified-that-13-is-odd-or-even`))
965
- assert(
966
- isNumberOddOrEven(fourteen, _f()),
967
- StringValueof("[falsejs] 14 is not odd or even"),
968
- )
969
- logger.log(pc.green(`[falsejs]-Verified-that-14-is-odd-or-even`))
970
- assert(
971
- isNumberOddOrEven(fifteen, _f()),
972
- StringValueof("[falsejs] 15 is not odd or even"),
973
- )
974
- logger.log(pc.green(`[falsejs]-Verified-that-15-is-odd-or-even`))
975
- assert(
976
- isNumberOddOrEven(sixteen, _f()),
977
- StringValueof("[falsejs] 16 is not odd or even"),
978
- )
979
- logger.log(pc.green(`[falsejs]-Verified-that-16-is-odd-or-even`))
980
- assert(
981
- isNumberOddOrEven(integer17(), _f()),
982
- StringValueof("[falsejs] 17 is not odd or even"),
983
- )
984
- logger.log(pc.green(`[falsejs]-Verified-that-17-is-odd-or-even`))
985
- assert(
986
- isNumberOddOrEven(Eighteen(), _f()),
987
- StringValueof("[falsejs] 18 is not odd or even"),
988
- )
989
- logger.log(pc.green(`[falsejs]-Verified-that-18-is-odd-or-even`))
990
- assert(
991
- isNumberOddOrEven(nineteenify(loggingEnabled), _f()),
992
- StringValueof("[falsejs] 19 is not odd or even"),
993
- )
994
- logger.log(pc.green(`[falsejs]-Verified-that-19-is-odd-or-even`))
995
- assert(
996
- isNumberOddOrEven(numbertwenty(loggingEnabled), _f()),
997
- StringValueof("[falsejs] 20 is not odd or even"),
998
- )
999
- logger.log(pc.green(`[falsejs]-Verified-that-20-is-odd-or-even`))
1000
- assert(
1001
- isNumberOddOrEven(always21(), _f()),
1002
- StringValueof("[falsejs] 21 is not odd or even"),
1003
- )
1004
- logger.log(pc.green(`[falsejs]-Verified-that-21-is-odd-or-even`))
1005
- assert(
1006
- isNumberOddOrEven(twentytwo, _f()),
1007
- StringValueof("[falsejs] 22 is not odd or even"),
1008
- )
1009
- logger.log(pc.green(`[falsejs]-Verified-that-22-is-odd-or-even`))
1010
- assert(
1011
- isNumberOddOrEven(TWENTY_THREE, _f()),
1012
- StringValueof("[falsejs] 23 is not odd or even"),
1013
- )
1014
- logger.log(pc.green(`[falsejs]-Verified-that-23-is-odd-or-even`))
1015
- assert(
1016
- !isNumberOddOrEven(inf.positiveInfinity(), _f()),
1017
- StringValueof("[falsejs] Infinity is odd or even"),
1018
- )
1019
- logger.log(
1020
- pc.green(`[falsejs]-Verified-that-Infinity-is-not-odd-or-even`),
1021
- )
1022
- }
1023
-
1024
- // * FALSEJS LOGIC
1025
- // the _getFalse Function
1026
- // :O :O :O
1027
- /**
1028
- * Calculates the boolean value false using various techniques.
1029
- *
1030
- * @param {number} random - A random number used in the calculation.
1031
- * @param {boolean} loggingEnabled - Indicates whether logging is enabled.
1032
- * @param {function} shouldDoSomethingAsync - A function that determines whether an asynchronous operation should be performed.
1033
- * @param {function} shouldDoSomethingAsyncWithIsTenThousand - A function that determines whether an asynchronous operation should be performed based on a condition.
1034
- * @param {object} logger - An object used for logging messages.
1035
- *
1036
- * @returns {boolean} - The calculated boolean value false.
1037
- */
1038
- function _getFalse(
1039
- random,
1040
- _randomLetterOrNumber,
1041
- loggingEnabled,
1042
- logger,
1043
- ) {
1044
- // call some noops 4 some reason
1045
- n0p3()
1046
- noop()
1047
- noop2()
1048
- noop3()
1049
- noop4()()
1050
- noop6()
1051
- noop7()
1052
- noop8()
1053
- noop9()
1054
- noop10()
1055
- asyncUtilNoop()
1056
- blankSpace()
1057
- blankSpaceNoop()
1058
- noopGenerator().next()
1059
- fjNoop()
1060
- lodashNoop()
1061
- lodash_Noop()
1062
- noOp()
1063
- nodeNoop()
1064
- noopUtility()
1065
- trueNoop()
1066
- noopFn()
1067
- noopaam()
1068
- nop()
1069
- es2015Noop()
1070
- kgryteNoop()
1071
- blackHole()
1072
- infinoop()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
1073
- mNoop()
1074
- ahsmNoop()
1075
- qcCoreNoop()
1076
- nooop()
1077
- ryotahNoop()
1078
- zodashNoop()
1079
- jacobZuma()
1080
- onceNoopFactory().doNothing()
1081
- noopTS()
1082
- voidFn()
1083
- noopExec()
1084
- _.noop()
1085
- underscore.noop()
1086
- // left pad some things for smoe reason
1087
- leftPad("required", LEFT_PAD_INPUT)
1088
- rightPad("required", RIGHT_PAD_INPUT)
1089
- leftpad("required", LEFTPAD_INPUT)
1090
- rightpad("required", RIGHTPAD_INPUT)
1091
- zeropad("1000", ZEROPAD_INPUT)
1092
- pad(PAD_INPUT, "pad")
1093
- pad("pad", PAD_INPUT) //look at the power of this pad
1094
- westPad.pad("wow", WEST_PAD_INPUT) // the ultimate pad
1095
-
1096
- var result // define a result
1097
- var succeededAttempt // define an attempt number that succeeded
1098
- logger.log(
1099
- `${clc.cyanBright(`[falsejs]`)} ${chalk.red(
1100
- "Chalk",
1101
- )}-${chalk.green("ulating")} ${chalk.yellow("the")} ${chalk.blue(
1102
- "boolean",
1103
- )} ${chalk.magenta(`value`)} ${chalk.cyan(`false`)}`,
1104
- )
1105
-
1106
- /// Attempt I
1107
-
1108
- logger.log(
1109
- clc.yellow(`[falsejs] Beginning Attempt I to get false value...`),
1110
- ) // inform our users of attempt one
1111
-
1112
- const pureChance = not($.equals)(
1113
- fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn,
1114
- $.divide(
1115
- $.multiply(
1116
- MathRandom(),
1117
- fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn,
1118
- ),
1119
- MathRandom(),
1120
- ),
1121
- ) // this will probably never be false but it's worth a shot
1122
-
1123
- // For semantics and simplicity, we use the attempt statement in our attempt
1124
- attempt(() => {
1125
- assert(
1126
- variableHolder._FalseJSIsFalse(pureChance, loggingEnabled),
1127
- ERROR_THAT_WILL_NEVER_BE_SHOWN,
1128
- ) // this will trigger our rescue which means it didnt work if it didnt work
1129
- })
1130
- .rescue(() => {
1131
- // it did not work by pure chance
1132
- /// Attempt II
1133
- // inform our users of the bad things
1134
- logger.log(
1135
- clc.yellow(
1136
- `[falsejs] Attempt I failed at getting false value, beginning Attempt II...`,
1137
- ),
1138
- )
1139
- if (not(isEqualTo)(pureChance, pureChance)) {
1140
- // something is broken
1141
- logger.log(
1142
- colors.red(
1143
- `[falsejs] Your Node.js may be broken as ${pureChance} is not equal to ${pureChance}`,
1144
- ),
1145
- )
1146
- }
1147
-
1148
- // let's try to calculate false using a random number
1149
- const chance = not($.equals)(
1150
- MathRound(jQuery.multiply(MathRandom(), 1000)),
1151
- MathRound(jQuery.multiply(MathRandom(), 1000)),
1152
- )
1153
- attempt(() =>
1154
- assert(
1155
- variableHolder._FalseJSIsFalse(chance, loggingEnabled),
1156
- ERROR_THAT_WILL_NEVER_BE_SHOWN,
1157
- ),
1158
- )
1159
- .rescue(() => {
1160
- // it did not work by chance again
1161
- logger.log(
1162
- clc.yellow(
1163
- `[falsejs] Attempt II failed at getting false value, beginning Attempt III...`,
1164
- ),
1165
- )
1166
- // lets see if our random is any of these key values
1167
- if (isOne(random)) {
1168
- result = $.equals(random, Two())
1169
- logger.log(
1170
- pc.green(
1171
- `[falsejs] Attempt III succeeded. False value retrieved successfully`,
1172
- ),
1173
- )
1174
- succeededAttempt = "III"
1175
- } else if (isTwo(random)) {
1176
- result = $.equals(random, three())
1177
- logger.log(
1178
- pc.green(
1179
- `[falsejs] Attempt III succeeded. False value retrieved successfully`,
1180
- ),
1181
- )
1182
- succeededAttempt = "III"
1183
- } else if (isThree(random)) {
1184
- result = $.equals(random, four())
1185
- logger.log(
1186
- pc.green(
1187
- `[falsejs] Attempt III succeeded. False value retrieved successfully`,
1188
- ),
1189
- )
1190
- succeededAttempt = "III"
1191
- } else if (eightToolkit.isEight(random)) {
1192
- result = $.equals(random, four())
1193
- logger.log(
1194
- pc.green(
1195
- `[falsejs] Attempt III succeeded. False value retrieved successfully`,
1196
- ),
1197
- )
1198
- succeededAttempt = "III"
1199
- } else if (isTen(random)) {
1200
- result = $.equals(random, eleven())
1201
- logger.log(
1202
- pc.green(
1203
- `[falsejs] Attempt III succeeded. False value retrieved successfully`,
1204
- ),
1205
- )
1206
- succeededAttempt = "III"
1207
- } else if (isHundred(random)) {
1208
- result = $.equals(random, s(hundred))
1209
- logger.log(
1210
- pc.green(
1211
- `[falsejs] Attempt III succeeded. False value retrieved successfully`,
1212
- ),
1213
- )
1214
- succeededAttempt = "III"
1215
- } else {
1216
- // dang its not
1217
- logger.log(
1218
- clc.yellow(
1219
- `[falsejs] Attempt III failed at getting false value, beginning Attempt IV...`,
1220
- ),
1221
- )
1222
-
1223
- const zeropointninebool = randomBoolean(
1224
- jQuery.subtract(one, jQuery.divide(one, ten)),
1225
- logger,
1226
- ) // a random boolean biased towards true, but its still worth a shot.
1227
- tru(
1228
- variableHolder._FalseJSIsFalse(
1229
- zeropointninebool,
1230
- loggingEnabled,
1231
- ),
1232
- )
1233
- .then(() => {
1234
- logger.log(
1235
- pc.green(
1236
- `[falsejs] Attempt IV succeeded. False value retrieved successfully`,
1237
- ),
1238
- )
1239
- result = zeropointninebool
1240
- succeededAttempt = "IV"
1241
- })
1242
- .otherwise(() => {
1243
- logger.log(
1244
- clc.yellow(
1245
- `[falsejs] Attempt IV failed at getting false value, beginning Attempt V...`,
1246
- ),
1247
- )
1248
- const zeropointeightfivebool = randomBoolean(
1249
- (five() - five() / five()) / five() +
1250
- five() /
1251
- (five() *
1252
- (five() * (five() - five() / five()))) -
1253
- five() /
1254
- five() /
1255
- (five() + five()) **
1256
- (five() *
1257
- (five() -
1258
- five() / five() -
1259
- five() / five()) +
1260
- five() / five()),
1261
- logger,
1262
- ) // a random boolean a tiny bit less biased towards true, but its still worth a shot.
1263
-
1264
- If(
1265
- variableHolder._FalseJSIsFalse(
1266
- zeropointeightfivebool,
1267
- loggingEnabled,
1268
- ),
1269
- )
1270
- .Then(() => {
1271
- logger.log(
1272
- pc.green(
1273
- `[falsejs] Attempt V succeeded. False value retrieved successfully`,
1274
- ),
1275
- )
1276
- result = zeropointeightfivebool
1277
- succeededAttempt = "V"
1278
- })
1279
- .Else(() => {
1280
- logger.log(
1281
- clc.yellow(
1282
- `[falsejs] Attempt V failed at getting false value, beginning Attempt VI...`,
1283
- ),
1284
- )
1285
- const zeropointsevennineninenineandsoonbool =
1286
- randomBoolean(
1287
- jQuery.subtract(
1288
- jQuery.divide(
1289
- jQuery.subtract(
1290
- five(),
1291
- jQuery.divide(five(), five()),
1292
- ),
1293
- five(),
1294
- ),
1295
- generalConcat(
1296
- one.toString(),
1297
- "e-",
1298
- Two().toString(),
1299
- eightToolkit.constants.EIGHT.toString(),
1300
- ),
1301
- ),
1302
- logger,
1303
- ) // a random boolean a bit more bit less biased towards true, but its still worth a shot.
1304
- if (
1305
- variableHolder._FalseJSIsFalse(
1306
- zeropointsevennineninenineandsoonbool,
1307
- loggingEnabled,
1308
- )
1309
- ) {
1310
- logger.log(
1311
- pc.green(
1312
- `[falsejs] Attempt VI succeeded. False value retrieved successfully`,
1313
- ),
1314
- )
1315
- result = zeropointsevennineninenineandsoonbool
1316
- succeededAttempt = "VI"
1317
- } else {
1318
- logger.log(
1319
- clc.yellow(
1320
- `[falsejs] Attempt VI failed at getting false value, beginning Attempt VII...`,
1321
- ),
1322
- )
1323
- const compl = complexBooleanWithBias(logger) // an eeven more complex random boolean
1324
- attempt(() =>
1325
- assert(
1326
- variableHolder._FalseJSIsFalse(
1327
- compl,
1328
- loggingEnabled,
1329
- ),
1330
- ERROR_THAT_WILL_NEVER_BE_SHOWN,
1331
- ),
1332
- )
1333
- .rescue(() => {
1334
- logger.log(
1335
- clc.yellow(
1336
- `[falsejs] Attempt VII failed at getting false value, beginning Attempt VIII...`,
1337
- ),
1338
- )
1339
- const w = weirdestBoolean(logger) // an eeven eeven more complex random boolean
1340
- if (
1341
- variableHolder._FalseJSIsFalse(
1342
- w,
1343
- loggingEnabled,
1344
- )
1345
- ) {
1346
- logger.log(
1347
- pc.green(
1348
- `[falsejs] Attempt VIII succeeded. False value retrieved successfully`,
1349
- ),
1350
- )
1351
- result = w
1352
- succeededAttempt = "VIII"
1353
- } else {
1354
- logger.log(
1355
- clc.yellow(
1356
- `[falsejs] Attempt VIII failed at getting false value, beginning Attempt IX...`,
1357
- ),
1358
- )
1359
- const x =
1360
- // biome-ignore lint/complexity/noExtraBooleanCast: d
1361
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0 // i don't know whether this is false or not let's just hope its false
1362
- if (
1363
- variableHolder._FalseJSIsFalse(
1364
- x,
1365
- loggingEnabled,
1366
- )
1367
- ) {
1368
- logger.log(
1369
- pc.green(
1370
- `[falsejs] Attempt IX succeeded. False value retrieved successfully`,
1371
- ),
1372
- )
1373
- result = x
1374
- } else {
1375
- // i shouldn't have added another exclamation mark
1376
- logger.log(
1377
- clc.yellow(
1378
- `[falsejs] Attempt IX failed at getting false value, beginning the final attempt...`,
1379
- ),
1380
- )
1381
- succeededAttempt = "IX"
1382
- // omg the final attempt
1383
- // RANDOM PHONE NUMBER
1384
- const randomPhoneNumber =
1385
- generatePhoneNumber()
1386
- fs.appendFileSync(
1387
- ".falsejs/phone-number-log.txt",
1388
- `${randomPhoneNumber}\n`,
1389
- )
1390
- const my =
1391
- randomPhoneNumber.endsWith("43") // the last two digits of my phone number are 43
1392
- fs.appendFileSync(
1393
- ".falsejs/phone-number-log.txt",
1394
- `\nfinal attempt:${my}\n\n`,
1395
- )
1396
- if (
1397
- variableHolder._FalseJSIsFalse(
1398
- my,
1399
- loggingEnabled,
1400
- )
1401
- ) {
1402
- logger.log(
1403
- pc.green(
1404
- `[falsejs] Final attempt succeeded. False value retrieved successfully`,
1405
- ), // it worked!
1406
- )
1407
- result = my
1408
- succeededAttempt = "final attempt"
1409
- } else {
1410
- // Dear future me. Please forgive me.
1411
- // I can't even begin to express how sorry I am.
1412
- logger.log(
1413
- colors.red(
1414
- `[falsejs] Final attempt failed. Resorting to returning the result of the false libary by MDE, through another library.`,
1415
- ),
1416
- )
1417
- const myNewFalseValue = returnFalse()
1418
- If(
1419
- couldThisCouldItBeFalse(
1420
- myNewFalseValue,
1421
- ),
1422
- )
1423
- .Then(() => {
1424
- logger.log(
1425
- pc.green(
1426
- `[falsejs] MDE's false library succeeded. False value retrieved successfully.`,
1427
- ),
1428
- )
1429
- result = myNewFalseValue
1430
- succeededAttempt =
1431
- "returning mde's false library"
1432
- })
1433
- .Else(() => {
1434
- logger.log(
1435
- pc.red(
1436
- `[falsejs] MDE's false library failed. Resorting to the TRUE FINAL attempt.`,
1437
- ),
1438
- )
1439
- // THE FINAL ATTEMPT IS A FOR LOOP!!
1440
-
1441
- var boolean = isEqualTo(
1442
- TEN_THOUSAND,
1443
- TEN_THOUSAND,
1444
- )
1445
- for (
1446
- let i = zr0();
1447
- i <
1448
- jQuery.multiply(
1449
- TWENTY_THREE,
1450
- TWENTY_THREE,
1451
- );
1452
- i++
1453
- ) {
1454
- boolean = not(
1455
- literally(boolean),
1456
- )()
1457
- }
1458
-
1459
- // THE MOMENT OF TRUTH
1460
- tru(couldThisCouldItBeFalse)
1461
- .then(() => {
1462
- // YESSSSSSSSSSS!!!
1463
- logger.log(
1464
- pc.green(
1465
- `[falsejs] FOR LOOP METHOD SUCCCEEDED!!!!!!. False value retrieved successfully!!!`,
1466
- ),
1467
- )
1468
- result = myNewFalseValue
1469
- succeededAttempt =
1470
- "THE FOR LOOP METHOD!"
1471
- })
1472
- .otherwise(() => {
1473
- // this will never happen because one of these methods will ALWAYS WORK.
1474
- // so i'll just put a useless log here
1475
- ltc(
1476
- "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 (:",
1477
- )
1478
- })
1479
- })
1480
- }
1481
- }
1482
- }
1483
- })
1484
- .else(() => {
1485
- logger.log(
1486
- pc.green(
1487
- `[falsejs] Attempt VII succeeded. False value retrieved successfully`,
1488
- ),
1489
- )
1490
- result = compl
1491
- succeededAttempt = "VII"
1492
- })
1493
- .ensure(n0p3) // ensure we call noop for this
1494
- .end()
1495
- }
1496
- })
1497
- })
1498
- .end()
1499
- }
1500
- })
1501
- .else(() => {
1502
- // it worked!
1503
- result = chance
1504
- logger.log(
1505
- pc.green(
1506
- `[falsejs] Attempt II succeeded. False value retrieved successfully`,
1507
- ),
1508
- )
1509
- succeededAttempt = "II"
1510
- })
1511
- .ensure(n0p3) //again ensure noop
1512
-
1513
- // and as always end our thing
1514
- .end()
1515
- })
1516
- .else(() => {
1517
- result = pureChance
1518
- logger.log(
1519
- pc.green(
1520
- `[falsejs] Attempt I succeeded. False value retrieved successfully`,
1521
- ),
1522
- )
1523
- succeededAttempt = "I"
1524
- })
1525
- .ensure(n0p3)
1526
- .end()
1527
- return {
1528
- result,
1529
- succeededAttempt,
1530
- } // return our false value
1531
- }
1532
-
1533
- /**
1534
- * Calculates the boolean value 'false' based on various conditions and parameters.
1535
- *
1536
- * @param {number} random - A random number used in calculations.
1537
- * @param {boolean} loggingEnabled - Indicates whether logging is enabled.
1538
- * @param {function} [shouldDoSomethingAsync=_f()] - A function indicating whether asynchronous operations should be performed.
1539
- * @param {function} [shouldDoSomethingAsyncWithIsTenThousand=_f()] - A function indicating whether asynchronous operations with 'is-ten-thousand' should be performed.
1540
- * @param {boolean} [disableAprilFoolsSideEffects=_f()] - Indicates whether April Fools side effects should be disabled.
1541
- * @param {boolean} [strictDisableAprilFoolsSideEffectsCheck=t()] - Indicates whether strict checking for disabling April Fools side effects should be performed.
1542
- *
1543
- * @returns {boolean} - The calculated boolean value 'false'.
1544
- */
1545
- // the _calculateFalse function
1546
- function _calculateFalse(
1547
- random,
1548
- loggingEnabled,
1549
- shouldDoSomethingAsync = _f(),
1550
- shouldDoSomethingAsyncWithIsTenThousand = _f(),
1551
- disableAprilFoolsSideEffects = _f(),
1552
- strictDisableAprilFoolsSideEffectsCheck = t()
1553
- ) {
1554
- // the below code is commented out by saying if a is equal to b
1555
- if (isEqualTo("a", "b")) {
1556
- if (loggingEnabled) printTheAlphabetSeparatedBySpaces() // for fun
1557
- }
1558
-
1559
- // over
1560
-
1561
- const logger = construct({ target: Logger, args: [loggingEnabled] }) // create our logger
1562
- var result // define a result
1563
- var succeededAttempt // define an attempt number that succeeded
1564
-
1565
- isTenThousandTenThousand(
1566
- shouldDoSomethingAsyncWithIsTenThousand,
1567
- logger,
1568
- ) // make sure ten thousand is ten thousand and vValue works
1569
- doSelfEqualityChecks(loggingEnabled) // do self equality checks
1570
- construct({
1571
- target: TernaryCompare,
1572
- args: [loggingEnabled, logOne, blankSpace],
1573
- }).compare()() // very very important
1574
-
1575
- if (loggingEnabled) require("wormhole-interconnections") // wormhole
1576
- logger.log(
1577
- c.cyan(
1578
- `[falsejs] `.concat(
1579
- generalConcat(
1580
- StringValueof(thirteenResolver()),
1581
- SPACE,
1582
- "×",
1583
- SPACE,
1584
- StringValueof(Two()),
1585
- SPACE,
1586
- "=",
1587
- SPACE,
1588
- thirteen(Two()),
1589
- ),
1590
- ),
1591
- ),
1592
- )
1593
-
1594
- // we need to setup servers
1595
-
1596
- // CREATE HTTP, HTTP2, AND HTTPS SERVERS
1597
- var httpServer = http.createServer(function (_, res) {
1598
- res.writeHead(200)
1599
- res.end("This is the FalseJS core logic HTTP server.")
1600
- })
1601
-
1602
- var http2Server = http2.createSecureServer(
1603
- { allowHTTP1: t() },
1604
- function (_, res) {
1605
- res.writeHead(200)
1606
- res.end("This is the FalseJS core logic HTTP/2 server.")
1607
- },
1608
- )
1609
-
1610
- var httpsServer = https.createServer({}, function (_, res) {
1611
- res.writeHead(200)
1612
- res.end("This is the FalseJS core logic HTTPS server.")
1613
- })
1614
-
1615
- httpServer.on("error", function (err) {
1616
- If(strictlyEqual(err.code, "EADDRINUSE")).Then(() => {
1617
- logger.log(
1618
- clc.yellow(
1619
- `[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.`,
1620
- ),
1621
- )
1622
- })
1623
- })
1624
-
1625
- http2Server.on("error", function (err) {
1626
- If(strictlyEqual(err.code, "EADDRINUSE")).Then(() => {
1627
- logger.log(
1628
- clc.yellow(
1629
- `[falsejs] Another instance of FalseJS is already running, or you are using the port ${FALSEJS_HTTP2_PORT} for something.`,
1630
- ),
1631
- )
1632
- })
1633
- })
1634
-
1635
- httpsServer.on("error", function (err) {
1636
- If(strictlyEqual(err.code, "EADDRINUSE")).Then(() => {
1637
- logger.log(
1638
- clc.yellow(
1639
- `[falsejs] Another instance of FalseJS is already running, or you are using the port ${FALSEJS_HTTPS_PORT} for something.`,
1640
- ),
1641
- )
1642
- })
1643
- })
1644
-
1645
- httpServer.listen({ port: FALSEJS_HTTP_PORT }, () => {
1646
- logger.log(
1647
- pc.green(
1648
- `[falsejs] FalseJS HTTP server is probably listening on port ${FALSEJS_HTTP_PORT}`,
1649
- ),
1650
- )
1651
- })
1652
- http2Server.listen({ port: FALSEJS_HTTP2_PORT }, () => {
1653
- logger.log(
1654
- pc.green(
1655
- `[falsejs] FalseJS HTTP/2 server is probably listening on port ${FALSEJS_HTTP2_PORT}`,
1656
- ),
1657
- )
1658
- })
1659
- httpsServer.listen({ port: FALSEJS_HTTPS_PORT }, () => {
1660
- logger.log(
1661
- pc.green(
1662
- `[falsejs] FalseJS HTTP/2 server is probably listening on port ${FALSEJS_HTTPS_PORT}`,
1663
- ),
1664
- )
1665
- })
1666
-
1667
- // our users should know some basic info first
1668
-
1669
- // the os:
1670
- If(isWindows())
1671
- .Then(() => {
1672
- // Windows
1673
- logger.log(
1674
- clc.cyanBright(
1675
- `[falsejs] Using Windows as current operating system`,
1676
- ),
1677
- )
1678
- })
1679
- .Else()
1680
- .If(isLinux())
1681
- .Then(() => {
1682
- // Linux
1683
- logger.log(
1684
- clc.cyanBright(
1685
- `[falsejs] Using Linux as current operating system`,
1686
- ),
1687
- )
1688
- })
1689
- .Else()
1690
- .If(isOSX())
1691
- .Then(() => {
1692
- // AppleOS (Darwin)
1693
- logger.log(
1694
- clc.cyanBright(
1695
- `[falsejs] Using Darwin as current operating system platform (macOS, iOS, etc.)`,
1696
- ),
1697
- )
1698
- })
1699
- .Else()
1700
- .If(isEqualTo(os.platform(), "aix"))
1701
- .Then(() => {
1702
- // AIX??
1703
- logger.log(
1704
- clc.cyanBright(
1705
- `[falsejs] Using IBM AIX as current operating system`,
1706
- ),
1707
- )
1708
- })
1709
- .Else()
1710
- .If(isFreeBSD())
1711
- .Then(() => {
1712
- // FreeBSD
1713
- logger.log(
1714
- clc.cyanBright(
1715
- `[falsejs] Using FreeBSD as current operating system`,
1716
- ),
1717
- )
1718
- })
1719
- .Else()
1720
- .If(isEqualTo(os.platform(), "openbsd"))
1721
- .Then(() => {
1722
- // OpenBSD
1723
- logger.log(
1724
- clc.cyanBright(
1725
- `[falsejs] Using OpenBSD as current operating system`,
1726
- ),
1727
- )
1728
- })
1729
- .Else()
1730
- .If(isEqualTo(os.platform(), "netbsd"))
1731
- .Then(() => {
1732
- // NetBSD
1733
- logger.log(
1734
- clc.cyanBright(
1735
- `[falsejs] Using NetBSD as current operating system`,
1736
- ),
1737
- )
1738
- })
1739
- .Else()
1740
- .If(isEqualTo(os.platform(), "cygwin"))
1741
- .Then(() => {
1742
- //cygwin
1743
- logger.log(clc.cyanBright(`[falsejs] You are using Cygwin`))
1744
- })
1745
- .Else()
1746
- .If(isEqualTo(os.platform(), "sunos"))
1747
- .Then(() => {
1748
- // Solaris/SunOS
1749
- logger.log(
1750
- clc.cyanBright(
1751
- `[falsejs] Using SunOS/Solaris as current operating system`,
1752
- ),
1753
- )
1754
- })
1755
- .Else()
1756
- .If(isEqualTo(os.platform(), "android"))
1757
- .Then(() => {
1758
- // Android
1759
- logger.log(
1760
- clc.cyanBright(
1761
- `[falsejs] Using Android as current operating system. coding on your phone, are you?`,
1762
- ),
1763
- )
1764
- })
1765
- .Else(() => {
1766
- logger.log(
1767
- clc.cyanBright(
1768
- `[falsejs] Even Node.js itself doesn't know your operating system.`,
1769
- ),
1770
- )
1771
- })
1772
- /// I'm actually curious what more can we do with process and os?
1773
- // lets find out. hmm process.cpuusage whats that
1774
- const usage = process.cpuUsage()
1775
- logger.log(
1776
- clc.cyanBright(
1777
- getValueOfThisStringText(
1778
- `[falsejs] User CPU Usage: ${usage.user}`,
1779
- ),
1780
- ),
1781
- )
1782
- logger.log(
1783
- clc.cyanBright(`[falsejs] System CPU Usage: ${usage.system}`),
1784
- )
1785
- // lets calculate days of the week and months and days and years and stuff
1786
- if (isJanuary(Today))
1787
- logger.log(clc.cyanBright(`[falsejs] The month is January`))
1788
- if (isFebruary(Today))
1789
- logger.log(clc.cyanBright(`[falsejs] The month is February`))
1790
- if (isMarch(Today))
1791
- logger.log(clc.cyanBright(`[falsejs] The month is March`))
1792
- if (isApril(Today))
1793
- logger.log(clc.cyanBright(`[falsejs] The month is April`))
1794
- if (isMay(Today))
1795
- logger.log(clc.cyanBright(`[falsejs] The month is May`))
1796
- if (isJune(Today))
1797
- logger.log(clc.cyanBright(`[falsejs] The month is June`))
1798
- if (isJuly(Today))
1799
- logger.log(clc.cyanBright(`[falsejs] The month is July`))
1800
- if (isAugust(Today))
1801
- logger.log(clc.cyanBright(`[falsejs] The month is August`))
1802
- if (isSeptember(Today))
1803
- logger.log(clc.cyanBright(`[falsejs] The month is September`))
1804
- if (isOctober(Today))
1805
- logger.log(clc.cyanBright(`[falsejs] The month is October`))
1806
- if (isNovember(Today))
1807
- logger.log(clc.cyanBright(`[falsejs] The month is November`))
1808
- if (isDecember(Today))
1809
- logger.log(clc.cyanBright(`[falsejs] The month is December`))
1810
- if (isMonday())
1811
- logger.log(clc.cyanBright(`[falsejs] Today is Monday`))
1812
- if (isTuesday())
1813
- logger.log(clc.cyanBright(`[falsejs] Today is Tuesday`))
1814
- if (isWednesday())
1815
- logger.log(clc.cyanBright(`[falsejs] Today is Wednesday`))
1816
- if (isThursday())
1817
- logger.log(clc.cyanBright(`[falsejs] Today is Thursday`))
1818
- if (isFriday())
1819
- logger.log(clc.cyanBright(`[falsejs] Today is Friday`))
1820
- if (isSaturday())
1821
- logger.log(clc.cyanBright(`[falsejs] Today is Saturday`))
1822
- if (isSunday())
1823
- logger.log(clc.cyanBright(`[falsejs] Today is Sunday`))
1824
- if (isWeekend())
1825
- logger.log(clc.cyanBright(`[falsejs] It's the weekend!`))
1826
-
1827
- logger.log(
1828
- clc.cyanBright(
1829
- generalConcat(
1830
- `[falsejs] Random happy emoji: `,
1831
- randomHappyEmoji(),
1832
- ),
1833
- ),
1834
- )
1835
- logger.log(
1836
- clc.cyanBright(
1837
- generalConcat(
1838
- `[falsejs] Random angry emoji: `,
1839
- randomAngryEmoji(),
1840
- ),
1841
- ),
1842
- )
1843
- logger.log(
1844
- clc.cyanBright(
1845
- generalConcat(
1846
- `[falsejs] Random food emoji: `,
1847
- randomFoodEmoji(),
1848
- ),
1849
- ),
1850
- )
1851
- construct({
1852
- target: TernaryCompare,
1853
- args: [loggingEnabled, dolphinFact, noop3],
1854
- }).compare()()
1855
-
1856
- // lets do something async
1857
- if (shouldDoSomethingAsync) {
1858
- doSomethingAsync(logger).then((l) =>
1859
- resultOfDoingSomethingAsync(l),
1860
- )
1861
- }
1862
- If(not(isNumberOddOrEven)(random, _f()))
1863
- .Then(() => {
1864
- logger.log(
1865
- clc.yellow(`[falsejs] Random number is not odd or even`),
1866
- )
1867
- })
1868
- .Else(() => {
1869
- logger.log(
1870
- pc.green(
1871
- `[falsejs] Verified that the random number is odd or even`,
1872
- ),
1873
- )
1874
- })
1875
-
1876
- // is odd checks
1877
- If(!isIsOdd(isOdd))
1878
- .Then(() => {
1879
- logger.log(clc.yellow(`[falsejs] isOdd is not isOdd.`))
1880
- logger.log(clc.yellow(`[falsejs] That's weird`))
1881
- })
1882
- .Else(n0p3)
1883
-
1884
- If(isIsOdd(isOddAndrew))
1885
- .Then(() => {
1886
- logger.log(pc.green(`[falsejs] Good for Andrew`))
1887
- })
1888
- .Else(noop6)
1889
-
1890
- If(isIsOdd(isOd))
1891
- .Then(() => {
1892
- logger.log(
1893
- pc.green(
1894
- `[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)`,
1895
- ),
1896
- ) // TODO: Add pronunciaton
1897
- })
1898
- .Else(() => {
1899
- /*
1900
- logger.log(
1901
- getValueOfThisStringText(
1902
- clc.cyan(
1903
- `[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 . `
1904
- )
1905
- )
1906
- )*/
1907
- })
1908
-
1909
- If(isIsOdd(isOddNum))
1910
- .Then(() => {
1911
- logger.log(pc.green(`[falsejs] Good for prasundas`))
1912
- })
1913
- .Else(noop4())
1914
-
1915
- If(isIsOdd(isIntegerOdd))
1916
- .Then(() => {
1917
- logger.log(pc.green(`[falsejs] Good for hoanduy1710`))
1918
- })
1919
- .Else(noop2)
1920
-
1921
- If(isIsOdd(noteven))
1922
- .Then(() => {
1923
- logger.log(pc.green(`[falsejs] Good for DeaSTL`))
1924
- })
1925
- .Else(noop3)
1926
-
1927
- If(isIsOdd(isUneven))
1928
- .Then(() => {
1929
- logger.log(pc.green(`[falsejs] Good for Robin`))
1930
- })
1931
- .Else(noop7)
1932
-
1933
- If(isIsOdd(numberKind.odd))
1934
- .Then(() => {
1935
- logger.log(pc.green(`[falsejs] Good for goten`))
1936
- })
1937
- .Else(noop8)
1938
-
1939
- If(isIsOdd(isOddFaster))
1940
- .Then(() => {
1941
- logger.log(
1942
- pc.green(
1943
- `[falsejs] Bad for bvpranu97, 'cos he wanted to make a faster version but his version is literally the same LOL`,
1944
- ),
1945
- )
1946
- })
1947
- .Else(noop9)
1948
-
1949
- If(isIsOdd(gabrielBrotasIsOdd.isOdd))
1950
- .Then(() => {
1951
- logger.log(pc.green(`[falsejs] Good for Gabriel`))
1952
- })
1953
- .Else(blankSpace)
1954
-
1955
- If(isIsOdd(returnIfOddNumber))
1956
- .Then(() => {
1957
- logger.log(pc.green(`[falsejs] Good for iamrahulpatel`))
1958
- })
1959
- .Else(blankSpaceNoop)
1960
-
1961
- If(isIsOdd(numberIsOdd))
1962
- .Then(() => {
1963
- logger.log(pc.green(`[falsejs] Good for Scott`))
1964
- })
1965
- .Else(asyncUtilNoop)
1966
-
1967
- If(isIsOdd(isNumOdd))
1968
- .Then(() => {
1969
- logger.log(pc.green(`[falsejs] Good for Shivam`))
1970
- })
1971
- .Else(() => noopGenerator().next())
1972
-
1973
- If(isIsOdd(isOddNumber))
1974
- .Then(() => {
1975
- logger.log(pc.green(`[falsejs] Good for LinkDev`))
1976
- })
1977
- .Else(fjNoop)
1978
-
1979
- If(isIsOdd(isNumberOdd))
1980
- .Then(() => {
1981
- logger.log(pc.green(`[falsejs] Good for aliraza401`))
1982
- })
1983
- .Else(lodashNoop)
1984
-
1985
- If(isIsOdd(isThisNumberOdd))
1986
- .Then(() => {
1987
- logger.log(pc.green(`[falsejs] Good for makogai`))
1988
- })
1989
- .Else(lodash_Noop)
1990
-
1991
- // now let's run some lua code
1992
- const myLuaScript = `
1993
- local message = "[falsejs] Bye from Lua!"
1994
- print(message)
1995
- `
1996
- const parsedLua = luaParser.parse(myLuaScript)
1997
- if (loggingEnabled) luaInterpreter.interpret(parsedLua) // run our lua code when the program ends
1998
-
1999
- logger.log(
2000
- colors.red(
2001
- vValue(
2002
- isuseless(
2003
- StringValueof(lowercase(`[falsejs] This is in lowercase`)),
2004
- ),
2005
- ),
2006
- ),
2007
- )
2008
- // okay we need to calculate false
2009
-
2010
- if (not(isAprilFools)()) {
2011
- if (disableAprilFoolsSideEffects) {
2012
- if (strictDisableAprilFoolsSideEffectsCheck) {
2013
- immediateError(
2014
- colors.red(
2015
- "April Fools side effects are disabled but it is not April Fools",
2016
- { errorType: ERROR.Error },
2017
- ),
2018
- )
2019
- return exit(one)
2020
- } else {
2021
- logger.log(
2022
- clc.yellow(
2023
- `[falsejs] No error was thrown because strict disable April Fools side effects checking was disabled`,
2024
- ),
2025
- )
2026
- // call the _getFalse function
2027
- const daresult = doop(
2028
- _getFalse,
2029
- random,
2030
- calculateRandomLetterOrNumber(loggingEnabled),
2031
- loggingEnabled,
2032
- logger,
2033
- )
2034
- result = daresult.result
2035
- succeededAttempt = daresult.succeededAttempt
2036
- }
2037
- } else {
2038
- // call the _getFalse function
2039
- const daresult = doop(
2040
- _getFalse,
2041
- random,
2042
- calculateRandomLetterOrNumber(loggingEnabled),
2043
- loggingEnabled,
2044
- logger,
2045
- )
2046
- result = daresult.result
2047
- succeededAttempt = daresult.succeededAttempt
2048
- }
2049
- } else {
2050
- result = _calculateFalseAprilFools()
2051
- logger.log(pc.green(`[falsejs] Value retrieved successfully`))
2052
- }
2053
-
2054
- // Validation
2055
- logger.log(clc.cyanBright(`[falsejs] Beginning validation`))
2056
-
2057
- logger.log(
2058
- clc.cyanBright(`[falsejs] Beginning check one of validation`),
2059
- )
2060
-
2061
- if (not(isRealBoolean)(result)) {
2062
- logger.log(colors.red(`[falsejs] Result was not a boolean`))
2063
- logger.log(colors.red(`[falsejs] Booleanifying the result`))
2064
- // Make sure our result is always a boolean
2065
- result = $Boolean(result)
2066
-
2067
- if (not(isRealBoolean)(result)) {
2068
- logger.log(
2069
- colors.red(
2070
- `[falsejs] Result is still not a boolean after booleanification`,
2071
- ),
2072
- )
2073
- logger.log(
2074
- colors.red(
2075
- `[falsejs] Attempting to trace the source of the problem`,
2076
- ),
2077
- )
2078
-
2079
- if (
2080
- isRealBoolean(Boolean(result)) &&
2081
- !isRealBoolean($Boolean(result))
2082
- ) {
2083
- logger.log(
2084
- clc.yellow(
2085
- `[falsejs] Traced the source of the problem to the package get-intrinsic by ljharb.`,
2086
- ),
2087
- )
2088
- logger.log(
2089
- clc.yellow(
2090
- `[falsejs] Please file an issue on his GitHub repo for GetIntrinsic("%Boolean") not working.`,
2091
- ),
2092
- )
2093
- result = Boolean(result) // now it's a boolean
2094
- logger.log(
2095
- pc.green(
2096
- `[falsejs] Check one of validation completed successfullly with one error corrected.`,
2097
- ),
2098
- )
2099
- } else {
2100
- logger.log(
2101
- colors.red(`[falsejs] × Validation failed to pass.`),
2102
- )
2103
- throwError(
2104
- construct({
2105
- target: FalseJSValidationFailedToPassError,
2106
- args: ["Validation failed to pass"],
2107
- }),
2108
- )
2109
- return exit(one)
2110
- }
2111
- } else {
2112
- logger.log(
2113
- pc.green(
2114
- `[falsejs] Check one of validation completed successfullly with one error corrected.`,
2115
- ),
2116
- )
2117
- }
2118
- } else {
2119
- logger.log(
2120
- pc.green(
2121
- `[falsejs] Check one of validation completed successfully with zero errors corrected.`,
2122
- ),
2123
- )
2124
- }
2125
- logger.log(
2126
- clc.cyanBright(`[falsejs] Beginning check two of validation`),
2127
- )
2128
- if (isPreciselyTrue(result) && not(isAprilFools)()) {
2129
- logger.log(
2130
- colors.red(
2131
- `[falsejs] Result was true and not false. Updating result to negation of result.`,
2132
- ),
2133
- )
2134
- result = not(() => result)()
2135
- logger.log(
2136
- pc.green(
2137
- `[falsejs] Check two of validation completed successfully with one error corrected.`,
2138
- ),
2139
- )
2140
- } else {
2141
- logger.log(
2142
- pc.green(
2143
- `[falsejs] Check two of validation completed successfully with zero errors corrected.`,
2144
- ),
2145
- )
2146
- }
2147
-
2148
- logger.log(pc.green(`[falsejs] Validation completed successfully`))
2149
- logger.log(
2150
- pc.green(
2151
- `[falsejs] (There were only two validations, but they still narrowed down to make sure that the result was false.)`,
2152
- ),
2153
- )
2154
- logger.log(
2155
- pc.green(
2156
- `[falsejs] False value has now been validated and calculated.`,
2157
- ),
2158
- )
2159
-
2160
- httpServer.close(() => {
2161
- logger.log(
2162
- pc.green(
2163
- `[falsejs] HTTP server closed successfully (if it ever was running)`,
2164
- ),
2165
- )
2166
- })
2167
- http2Server.close(() => {
2168
- logger.log(
2169
- pc.green(
2170
- `[falsejs] HTTP/2 server closed successfully (if it ever was running)`,
2171
- ),
2172
- )
2173
- })
2174
- httpsServer.close(() => {
2175
- logger.log(
2176
- pc.green(
2177
- `[falsejs] HTTPS server closed successfully (if it ever was running)`,
2178
- ),
2179
- )
2180
- })
2181
-
2182
- if (loggingEnabled) {
2183
- const message = "thanks for using this package"
2184
- let thesay = tacoWrap(emoji100.concat(SPACE, owoifyx(message)))
2185
- const thesay2 = tacoWrap(emoji100.concat(SPACE, message))
2186
- const thesay3 = tacoWrap(
2187
- emoji100.concat(SPACE, uwuifier.uwuifySentence(message)),
2188
- )
2189
- if (isEqualTo(thesay, thesay2)) thesay = thesay3
2190
- sayIt(thesay) // give our users a cute message so we can get their support
2191
- // string interpelation
2192
- ltc(
2193
- `${clc.cyanBright(`[falsejs]`)} ${chalk.red(
2194
- "Chalk",
2195
- )}-${chalk.green("ulated")} ${chalk.yellow("the")} ${chalk.blue(
2196
- "boolean",
2197
- )} ${chalk.magenta(`value`)} ${chalk.cyan(`false`)}`
2198
- .concat(SPACE)
2199
- .concat(emoji100),
2200
- )
2201
- if (succeededAttempt != null) {
2202
- ltc(
2203
- generalConcat(
2204
- clc.cyanBright(`[falsejs]`).concat(SPACE),
2205
- chalkbox.magenta(
2206
- generalConcat(
2207
- "The attempt that succeeded was attempt ",
2208
- succeededAttempt,
2209
- ),
2210
- ),
2211
- ),
2212
- )
2213
- fs.appendFileSync(
2214
- ".falsejs/phone-number-log.txt",
2215
- generalConcat("succeeded attempt: ", succeededAttempt, "\n"),
2216
- )
2217
- }
2218
- ltc(
2219
- generalConcat(
2220
- clc.cyanBright(`[falsejs]`).concat(SPACE),
2221
- chalkbox.rainbow(`Thanks for using this package`),
2222
- ),
2223
- )
2224
- ltc(
2225
- generalConcat(
2226
- clc.cyanBright(`[falsejs]`).concat(SPACE),
2227
- chalkbox.random(`I really appreciate it`),
2228
- ),
2229
- )
2230
- ltc(
2231
- generalConcat(
2232
- clc.cyanBright(`[falsejs]`).concat(SPACE),
2233
- chalkbox.america(`Star the repo and follow me on GitHub: `),
2234
- ),
2235
- )
2236
- ltc(
2237
- clc
2238
- .cyanBright(`[falsejs]`)
2239
- .concat(
2240
- SPACE,
2241
- chalk.underline("https://github.com/tj-commits"),
2242
- ),
2243
- )
2244
- ltc(
2245
- clc
2246
- .cyanBright(`[falsejs]`)
2247
- .concat(
2248
- SPACE,
2249
- clc.cyanBright(`And a very big random number is`),
2250
- SPACE,
2251
- ) +
2252
- `${chalkbox.rainbow(
2253
- numberFormatter.format(
2254
- MathRound(
2255
- surpriseArray.reduce((v, _, i, a) => {
2256
- return jQuery.add(v, a.getMember(i))
2257
- }),
2258
- ),
2259
- ),
2260
- )}`,
2261
- )
2262
- ltc(
2263
- clc.cyanBright(
2264
- generalConcat(
2265
- "[falsejs] ",
2266
- uwuifier.uwuifySentence(
2267
- "This long line of text (in this one log) has been uwuified",
2268
- ),
2269
- ),
2270
- ),
2271
- )
2272
- ltc(
2273
- clc.cyanBright(
2274
- generalConcat(
2275
- "[falsejs] ",
2276
- amogus.amogusify(
2277
- "This long line of text (in this one log) has been amogusified",
2278
- ),
2279
- ),
2280
- ),
2281
- )
2282
- ltc(
2283
- clc.cyanBright(`[falsejs]`).concat(SPACE) +
2284
- `${c.red(`False`)}${c.green(`JS`)}`,
2285
- )
2286
- ltc(leftPad("left pad with dashes", LEFT_PAD_INPUT, "-"))
2287
- ltc(rightPad("right pad with dashes", RIGHT_PAD_INPUT, "-"))
2288
- }
2289
-
2290
- return result
2291
- }
2292
-
2293
- //* the exported function
2294
-
2295
- /**
2296
- bro the documentation for this function is in the index.d.ts file
2297
- */
2298
- functions.ReturnFalse = (
2299
- enableLogging = NO,
2300
- shouldDoSomethingAsync = NO,
2301
- shouldDoSomethingAsyncWithIsTenThousand = NO,
2302
- disableAprilFoolsSideEffects = NO,
2303
- definitelyDisableAprilFoolsSideEffects = NO,
2304
- strictDisableAprilFoolsSideEffectsCheck = YES
2305
- ) => {
2306
- if (enableLogging === YES) require("amalpkg")() // indeed XD
2307
- // validate our values
2308
- if (
2309
- not(isEqualTo)(enableLogging, NO) &&
2310
- not(isEqualTo)(enableLogging, YES)
2311
- ) {
2312
- immediateError("enableLogging must be yes or no", {
2313
- errorType: ERROR.TypeError,
2314
- })
2315
- return exit(one)
2316
- }
2317
- if (
2318
- not(isEqualTo)(shouldDoSomethingAsync, NO) &&
2319
- not(isEqualTo)(shouldDoSomethingAsync, YES)
2320
- ) {
2321
- immediateError("shouldDoSomethingAsync must be yes or no", {
2322
- errorType: ERROR.TypeError,
2323
- })
2324
- return exit(one)
2325
- }
2326
- if (
2327
- not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, NO) &&
2328
- not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, YES)
2329
- ) {
2330
- immediateError(
2331
- "shouldDoSomethingAsyncWithIsTenThousand must be yes or no",
2332
- { errorType: ERROR.TypeError },
2333
- )
2334
- return exit(one)
2335
- }
2336
- if (
2337
- not(isEqualTo)(disableAprilFoolsSideEffects, NO) &&
2338
- not(isEqualTo)(disableAprilFoolsSideEffects, YES)
2339
- ) {
2340
- immediateError("disableAprilFoolsSideEffects must be yes or no", {
2341
- errorType: ERROR.TypeError,
2342
- })
2343
- return exit(one)
2344
- }
2345
- if (
2346
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO) &&
2347
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES)
2348
- ) {
2349
- immediateError(
2350
- "definitelyDisableAprilFoolsSideEffects must be yes or no",
2351
- {
2352
- errorType: ERROR.TypeError,
2353
- },
2354
- )
2355
- return exit(one)
2356
- }
2357
- if (
2358
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO) &&
2359
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES)
2360
- ) {
2361
- immediateError(
2362
- "strictDisableAprilFoolsSideEffectsCheck must be yes or no",
2363
- {
2364
- errorType: ERROR.TypeError,
2365
- },
2366
- )
2367
- return exit(one)
2368
- }
2369
- // let's say hello to our users and inform them logging enabled if it is
2370
- if (
2371
- isEqualTo(
2372
- isTrue(
2373
- { enableLogging: yesNo.parse(enableLogging) },
2374
- "enableLogging",
2375
- ),
2376
- Bro.TOTALLY,
2377
- )
2378
- ) {
2379
- ltc(clc.cyanBright(`[falsejs] Logging enabled`))
2380
- ltc(
2381
- clc.cyan(
2382
- `[falsejs]`.concat(leftPad(greet(username), LEFT_PAD_INPUT)),
2383
- ),
2384
- )
2385
- hello({ username, age: "it's called FalseJS!" })
2386
-
2387
- mGenbaneko.say(clc.redBright(meow()))
2388
- require("peter") // OH NO IT'S PETER
2389
- console.dog(emptyString)
2390
- require("greenlantern") // Hello World
2391
- ltc(clc.cyanBright(`[falsejs] Using Lodash version ${_.VERSION}`))
2392
- ltc(
2393
- clc.cyanBright(
2394
- `[falsejs] Using Underscore version ${underscore.VERSION}`,
2395
- ),
2396
- )
2397
- ltc(
2398
- clc.cyanBright(
2399
- `[falsejs] Using Axios version ${axios.VERSION}`,
2400
- ),
2401
- )
2402
- ltc(
2403
- clc.cyanBright(
2404
- `[falsejs] Using React version ${React.version}`,
2405
- ),
2406
- )
2407
- }
2408
- // deduce a random number
2409
- const randomNumber = add(
2410
- MathFloor(MathRandom() * numberOneHundred),
2411
- one,
2412
- )
2413
- if (
2414
- isEqualTo(
2415
- isTrue(
2416
- { enableLogging: yesNo.parse(enableLogging) },
2417
- "enableLogging",
2418
- ),
2419
- Bro.TOTALLY,
2420
- )
2421
- ) {
2422
- ltc(
2423
- clc.cyanBright(
2424
- `[falsejs] Random number ${randomNumber} calculated`,
2425
- ), // lets inform our users if they have loggineanbled
2426
- )
2427
- ltc(
2428
- clc.cyanBright(
2429
- `[falsejs] Doing something async ${construct({
2430
- target: TernaryCompare,
2431
- args: [
2432
- yesNo.parse(shouldDoSomethingAsync),
2433
- "enabled",
2434
- "disabled",
2435
- ],
2436
- }).compare()}`,
2437
- ),
2438
- )
2439
- ltc(
2440
- clc.cyanBright(
2441
- `[falsejs] Doing something async with is-ten-thousand ${construct(
2442
- {
2443
- target: TernaryCompare,
2444
- args: [
2445
- yesNo.parse(shouldDoSomethingAsyncWithIsTenThousand),
2446
- "enabled",
2447
- "disabled",
2448
- ],
2449
- },
2450
- ).compare()}`,
2451
- ),
2452
- )
2453
- }
2454
- const loggingEnabled = enableLogging
2455
- const logger = {
2456
- log(l) {
2457
- if (
2458
- isEqualTo(
2459
- trueComparison.compare(),
2460
- yesNo.parse(loggingEnabled),
2461
- )
2462
- )
2463
- ltc(l)
2464
- },
2465
- }
2466
- if (not(yesNo.parse)(strictDisableAprilFoolsSideEffectsCheck)) {
2467
- logger.log(
2468
- clc.yellow(
2469
- `[falsejs] Strict disable April Fools side effects checking disabled`,
2470
- ),
2471
- )
2472
- }
2473
- _return(
2474
- vretriever.retrieve(
2475
- immo(
2476
- isuseless(
2477
- vValue(
2478
- _.identity(
2479
- underscore.identity(
2480
- literally(
2481
- constant(
2482
- lodashdotconstant(
2483
- _.constant(
2484
- underscore.constant(
2485
- doop(
2486
- _calculateFalse,
2487
- randomNumber, // random number
2488
- yesNo.parse(enableLogging), // eanble logging
2489
- yesNo.parse(shouldDoSomethingAsync), // async
2490
- yesNo.parse(
2491
- shouldDoSomethingAsyncWithIsTenThousand,
2492
- ), //async-is-ten-thousand
2493
- yesNo.parse(
2494
- disableAprilFoolsSideEffects,
2495
- ) &&
2496
- yesNo.parse(
2497
- definitelyDisableAprilFoolsSideEffects,
2498
- ),
2499
- yesNo.parse(
2500
- strictDisableAprilFoolsSideEffectsCheck,
2501
- ),
2502
- ),
2503
- )(),
2504
- )(),
2505
- )(),
2506
- )(),
2507
- )(),
2508
- ),
2509
- ),
2510
- ),
2511
- ),
2512
- ),
2513
- ),
2514
- )
2515
- }
2516
- variableHolder._FalseJSMainFunctionWotDoesFunctionality =
2517
- functions.ReturnFalse
2518
-
2519
- // * MORE HELPER FUNCTIONS
2520
-
2521
- // now lets define some helper fufnctions
2522
- // just some weaird boolean functions
2523
-
2524
- function randomBoolean(
2525
- biasThreshold /* biasTreshold is chance of being true */,
2526
- logger,
2527
- ) {
2528
- const randomValue = MathRandom()
2529
- logger.log(
2530
- clc.cyanBright(
2531
- `[falsejs] Random number ${randomValue} calculated`,
2532
- ),
2533
- )
2534
- const binaryString = jQuery
2535
- .multiply(
2536
- randomValue,
2537
- (five() + five()) ** (five() + five() / five()),
2538
- )
2539
- .toString(Two())
2540
- const bitMask =
2541
- five() *
2542
- (five() + (five() - (five() / five() + five() / five()))) +
2543
- five() / five() +
2544
- five() / five() // the meaning of life
2545
- const bitResult =
2546
- parseInt(
2547
- binaryString.slice(
2548
- returnZero({
2549
- method: ZeroCalculationMethod.CreashaksOrganzine,
2550
- loggingEnabled: logger.enableLogging,
2551
- }),
2552
- six(),
2553
- ),
2554
- Two(),
2555
- ) ^ bitMask
2556
- const segment = bitResult.toString(sixteen).slice(
2557
- returnZero({
2558
- method: ZeroCalculationMethod.CreashaksOrganzine,
2559
- loggingEnabled: logger.enableLogging,
2560
- }),
2561
- one,
2562
- )
2563
- const mappedValue = parseInt(segment, sixteen) % Two()
2564
- const biasedRandomValue = construct({
2565
- target: TernaryCompare,
2566
- args: [
2567
- MathRandom() < biasThreshold,
2568
- one,
2569
- returnZero({
2570
- method: ZeroCalculationMethod.CreashaksOrganzine,
2571
- loggingEnabled: logger.enableLogging,
2572
- }),
2573
- ],
2574
- }).compare()
2575
- const value = $.divide(add(mappedValue, biasedRandomValue), Two())
2576
-
2577
- return (
2578
- value >= five() / five() / (five() / five() + five() / five())
2579
- )
2580
- }
2581
-
2582
- function complexBooleanWithBias(logger) {
2583
- // Generate a pseudo-random number between 0 and 1
2584
- const randomValue = MathRandom()
2585
-
2586
- logger.log(
2587
- clc.cyanBright(
2588
- `[falsejs] Random number ${randomValue} calculated`,
2589
- ),
2590
- )
2591
-
2592
- // Convert the random number to a high-precision string and manipulate it
2593
- const highPrecisionString = (
2594
- randomValue *
2595
- (five() + five()) **
2596
- (five() + (five() - (five() / five() + five() / five())))
2597
- ).toFixed(zr0())
2598
-
2599
- // Perform a base conversion
2600
- const baseConverted = parseInt(highPrecisionString, ten).toString(
2601
- (five() + (five() / five() + five() / five())) * five() +
2602
- five() / five(),
2603
- )
2604
-
2605
- // Calculate a hash-like value using trigonometric functions
2606
- const trigValue = $.multiply(
2607
- parseFloat(
2608
- add("0.", baseConverted),
2609
- (five() + (five() / five() + five() / five())) * five() +
2610
- five() / five(),
2611
- ),
2612
- PI,
2613
- Two(),
2614
- )
2615
-
2616
- // Determine if this value is close to a specific fraction
2617
- const isCloseToFraction =
2618
- MathAbs(
2619
- trigValue -
2620
- five() / five() / (five() / five() + five() / five()),
2621
- ) <
2622
- five() / five() / (five() + five()) +
2623
- (five() - (five() / five() + five() / five())) /
2624
- (five() * (five() * (five() - five() / five())))
2625
-
2626
- // Generate a secondary random number with a different scale
2627
- const secondaryRandom = $.multiply(
2628
- MathRandom(),
2629
- (five() + five()) **
2630
- (five() - (five() / five() + five() / five())),
2631
- )
2632
-
2633
- // Check if the secondary random number is a prime number
2634
- const isPrime = isPrimeNumber(MathRound(secondaryRandom), logger)
2635
-
2636
- // Generate a bias value (6% chance of true)
2637
- const biasThreshold = five() / five() / (five() + five())
2638
- const biasRandom = MathRandom() < biasThreshold ? zr0() : one
2639
-
2640
- // Combine the results using weighted averaging
2641
- const combinedResult = $.divide(
2642
- isCloseToFraction + isPrime + biasRandom,
2643
- three(),
2644
- )
2645
-
2646
- // Return boolean based on the final weighted result
2647
- return (
2648
- combinedResult >=
2649
- five() / five() / (five() / five() + five() / five())
2650
- )
2651
- }
2652
-
2653
- function weirdestBoolean(logger) {
2654
- // Step 1: Generate a pseudo-random floating-point number
2655
- const randomValue = MathRandom()
2656
-
2657
- // Step 2: Create a string representation of the random number in base-36
2658
- const base36String = (
2659
- randomValue *
2660
- (five() + five()) **
2661
- ((five() - (five() / five() + five() / five())) *
2662
- (five() - five() / five()))
2663
- )
2664
- .toFixed(zr0())
2665
- .toString(
2666
- (five() + (five() / five() + five() / five())) * five() +
2667
- five() / five(),
2668
- )
2669
-
2670
- // Step 3: Create a hash-like transformation by summing ASCII values of characters
2671
- var asciiSum = zr0()
2672
- for (const char of base36String) {
2673
- asciiSum += char.charCodeAt(zr0())
2674
- }
2675
-
2676
- // Step 4: Generate a non-trivial number by applying a sequence of bit manipulations
2677
- const bitManipulated =
2678
- (asciiSum ^
2679
- ((five() / five() + five() / five()) *
2680
- (five() + five()) ** (five() - five() / five()) +
2681
- (five() - (five() / five() + five() / five())) *
2682
- (five() + five()) **
2683
- (five() - (five() / five() + five() / five())) +
2684
- (five() / five()) *
2685
- (five() * (five() * (five() - five() / five()))) +
2686
- (five() - (five() / five() + five() / five())) *
2687
- (five() + five()))) &
2688
- (five() *
2689
- (five() *
2690
- (five() +
2691
- five() +
2692
- (five() / five() / (five() + five()) +
2693
- five() / five() / (five() + five()))))) // XOR and mask to get a byte
2694
-
2695
- // Step 5: Convert the result to a binary string and calculate a checksum-like value
2696
- const binaryString = bitManipulated
2697
- .toString(Two())
2698
- .padStart(eightToolkit.constants.EIGHT, "0")
2699
- const checksum = Array.from(binaryString).reduce(
2700
- (acc, bit) => acc + parseInt(bit, ten),
2701
- zr0(),
2702
- )
2703
-
2704
- // Step 6: Use a matrix of numbers to obscure the logic
2705
- const someNumbers = [
2706
- Two(),
2707
- three(),
2708
- five(),
2709
- seven(),
2710
- eleven(),
2711
- thirteenResolver(),
2712
- integer17(),
2713
- nineteenify(logger.enableLogging),
2714
- TWENTY_THREE,
2715
- TWENTY_THREE + six(),
2716
- ]
2717
- const matrixIndex = checksum % someNumbers.length
2718
- const primeValue = someNumbers[matrixIndex]
2719
-
2720
- // Step 7: Generate a complex random number using trigonometric functions
2721
- const trigValue = $.multiply(
2722
- $.divide($.multiply(primeValue, PI), four()),
2723
- (five() + five()) **
2724
- (five() - (five() / five() + five() / five())) /
2725
- (five() / five() + five() / five()),
2726
- )
2727
- const isAboveThreshold =
2728
- trigValue >
2729
- (five() + five()) **
2730
- (five() - (five() / five() + five() / five())) /
2731
- (five() / five() + five() / five()) // Arbitrary threshold
2732
-
2733
- // Step 8: Introduce an additional layer of randomness with bias
2734
- const bias =
2735
- MathRandom() <
2736
- (five() - five() / five()) / five() +
2737
- five() / (five() * (five() * (five() - five() / five()))) -
2738
- five() /
2739
- five() /
2740
- (five() + five()) **
2741
- (five() * (five() - five() / five() - five() / five()) +
2742
- five() / five()) -
2743
- five() / five() / (five() + five())
2744
- ? one
2745
- : zr0() // 75% chance of 1
2746
-
2747
- // Step 9: Combine results using a complex formula
2748
- const weirdBoolean = (isAboveThreshold ? one : zr0()) ^ bias // XOR operation
2749
-
2750
- // Step 10: Calculate complex boolean with bias from other function
2751
- const complexBoolean = complexBooleanWithBias(logger)
2752
-
2753
- // Step 11: Calculate random boolean with bias from other function
2754
- const randomBool = randomBoolean(
2755
- (five() - five() / five()) / five() +
2756
- five() / (five() * (five() * (five() - five() / five()))) -
2757
- five() /
2758
- five() /
2759
- (five() + five()) **
2760
- (five() * (five() - five() / five() - five() / five()) +
2761
- five() / five()) -
2762
- five() / five() / (five() + five()) / (five() + five()),
2763
- logger,
2764
- )
2765
-
2766
- // Step 12: Add them together
2767
- const sum = weirdBoolean + complexBoolean + randomBool
2768
-
2769
- // Step 13: Randomly add one to it
2770
- const sumWhichMayBeSuccessed =
2771
- MathRandom() <
2772
- five() / five() / (five() / five() + five() / five())
2773
- ? successor(sum)
2774
- : sum
2775
-
2776
- // Step 14: Round down or up
2777
- const finalBooleanNotNegated = $.equals(
2778
- MathFloor(sumWhichMayBeSuccessed) % Two(),
2779
- zr0(),
2780
- )
2781
-
2782
- // Step 15: Negate finalBoolean
2783
- const finalBooleanComparison = construct({
2784
- target: TernaryCompare,
2785
- args: [finalBooleanNotNegated, _f(), t()],
2786
- })
2787
-
2788
- return finalBooleanComparison.compare()
2789
- }
2790
-
2791
- // and maybe some mind-blowing alphabet function
2792
-
2793
- function printTheAlphabetSeparatedBySpaces() {
2794
- var s = emptyString
2795
-
2796
- function one() {
2797
- s += "a "
2798
- return {
2799
- get p() {
2800
- s += "e "
2801
- return {
2802
- valueOf: function () {
2803
- s += "g "
2804
- return {}
2805
- },
2806
- toString: function () {
2807
- s += "h "
2808
- return _f()
2809
- },
2810
- }
2811
- },
2812
- set p(_) {
2813
- s += "k l m n o p q r s t u v w x y z"
2814
- },
2815
- }
2816
- }
2817
-
2818
- function Two() {
2819
- s += "b "
2820
- return {
2821
- toString: function () {
2822
- s += "c "
2823
- return {}
2824
- },
2825
- valueOf: function () {
2826
- s += "d "
2827
- return "p"
2828
- },
2829
- }
2830
- }
2831
-
2832
- function three() {
2833
- s += "f "
2834
- return {
2835
- valueOf: function () {
2836
- s += "i "
2837
- return {}
2838
- },
2839
- toString: function () {
2840
- s += "j "
2841
- return _f()
2842
- },
2843
- }
2844
- }
2845
- one()[Two()] += three()
2846
- ltc(s)
2847
- }
2848
-
2849
- // Helper function to check if a number is prime
2850
- function isPrimeNumber(num, logger) {
2851
- if (num <= one) return _f()
2852
- if (num <= three()) return t()
2853
- if (
2854
- $.equals(
2855
- num % Two(),
2856
- returnZero({
2857
- method: ZeroCalculationMethod.CreashaksOrganzine,
2858
- loggingEnabled: logger.enableLogging,
2859
- }),
2860
- ) ||
2861
- $.equals(
2862
- num % three(),
2863
- returnZero({
2864
- method: ZeroCalculationMethod.CreashaksOrganzine,
2865
- loggingEnabled: logger.enableLogging,
2866
- }),
2867
- )
2868
- ) {
2869
- return _f()
2870
- }
2871
- var i = five()
2872
- while ($.multiply(i, i) <= num) {
2873
- if (
2874
- $.equals(
2875
- num % i,
2876
- returnZero({
2877
- method: ZeroCalculationMethod.CreashaksOrganzine,
2878
- loggingEnabled: logger.enableLogging,
2879
- }),
2880
- ) ||
2881
- num %
2882
- $.equals(
2883
- $.add(i, Two()),
2884
- returnZero({
2885
- method: ZeroCalculationMethod.CreashaksOrganzine,
2886
- loggingEnabled: logger.enableLogging,
2887
- }),
2888
- )
2889
- ) {
2890
- return _f()
2891
- }
2892
- i = $.add(i, six())
2893
- }
2894
- return tVal
2895
- }
2896
-
2897
- /**
2898
- * Converts the input value to a string representation.
2899
- *
2900
- * @param {any} value - The value to be converted to a string.
2901
- * @returns {string} - The string representation of the input value.
2902
- */
2903
- function StringValueof(value) {
2904
- return value.toString()
2905
- }
2906
-
2907
- // a function to check if something is false thati s used by the function to check if something is false
2908
- function couldThisCouldItBeFalse(
2909
- aValueThatMightBeTheBooleanValueFalseButIDKYet,
2910
- ) {
2911
- const SIXTY_NINE = $.multiply(TWENTY_THREE, three())
2912
- const specimen = aValueThatMightBeTheBooleanValueFalseButIDKYet
2913
- if (specimen == undefined()) return Bro.NOWAY // noway its false if its undefined
2914
- if (isOne(specimen)) return _f()
2915
- if (isTrue({ specimen }, "specimen")) return _f()
2916
- if (isNegativeZero({ specimen }, "specimen")) return _f()
2917
- if (specimen === SIXTY_NINE) return _f()
2918
- if (is(specimen).thirteen()) return _f()
2919
- return isPreciselyEqualToFalse(specimen)
2920
- }
2921
- // a function to check if something is false
2922
- variableHolder._FalseJSIsFalse = function is_This_Value_false(
2923
- v,
2924
- loggingEnabled,
2925
- ) {
2926
- if (!isRealBoolean(loggingEnabled))
2927
- loggingEnabled = !(loggingEnabled === NO)
2928
- const value = v // alts are always good
2929
- const isV = is(v) // isthirteen
2930
- const garbage = useGarbage() // use some garbage
2931
- const isgarbage =
2932
- not(isRealBoolean)(garbage) && isEqualTo(v, garbage)
2933
- const cond =
2934
- !isgarbage &&
2935
- v !== one &&
2936
- v !== Two() &&
2937
- v !== three() &&
2938
- v !== four() &&
2939
- v !== five() &&
2940
- v !== six() &&
2941
- v !== seven() &&
2942
- v !== eightToolkit.constants.EIGHT &&
2943
- v !== ninev9() &&
2944
- v !== ten &&
2945
- v !== eleven() &&
2946
- v !== twelve() &&
2947
- v !== thirteenResolver() &&
2948
- v !== fourteen &&
2949
- v !== fifteen &&
2950
- v !== fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn &&
2951
- v !== sixteen &&
2952
- v !== integer17() &&
2953
- v !== Eighteen() &&
2954
- v !== nineteenify(loggingEnabled) &&
2955
- v !== numbertwenty(loggingEnabled) &&
2956
- v !== always21() &&
2957
- v !== twentytwo &&
2958
- v !== TWENTY_THREE &&
2959
- v !== parseInt(theNumberSeven, 10) &&
2960
- v !== theNumberSeven &&
2961
- !isUndefined(v) &&
2962
- !isNull(v) &&
2963
- !isNil(v) &&
2964
- isUnnull(v) &&
2965
- not(isNil)(v) &&
2966
- !isEqual(value, NO) &&
2967
- !isEqual(value, YES) &&
2968
- !isEqualTo(value, NO) &&
2969
- !isEqualTo(value, YES) &&
2970
- !couldThisCouldItBeTrue(v) &&
2971
- !isNaN(v) &&
2972
- !isNegativeInfinity(v) &&
2973
- !isNegativeZero2(v) &&
2974
- !is0_2.isNegativeZero(v) &&
2975
- !isNegativeZero(v) &&
2976
- !isPositiveZero(v) &&
2977
- !is0_2.isPositiveZero(v) &&
2978
- !is0(v) &&
2979
- !is0_2.isZero(v) &&
2980
- !zerosurgeIsZero(v, loggingEnabled) &&
2981
- !is1(v) &&
2982
- !isTwo(v) &&
2983
- !isThree(v) &&
2984
- !isFour(v) &&
2985
- !isFive(v) &&
2986
- !isSix(v) &&
2987
- !isSeven(v) &&
2988
- !eightToolkit.isEight(v) &&
2989
- !isV.thirteen() &&
2990
- !isHundred(v) &&
2991
- !isThousand(v) &&
2992
- !isTenThousand(v) &&
2993
- !isEqTenThousand(v) &&
2994
- !isNumber(v) &&
2995
- !isActualNumber(v) &&
2996
- !isIsOdd(v) &&
2997
- !isOd(v) &&
2998
- v !== t() &&
2999
- v === _f() &&
3000
- v === returnFalse() &&
3001
- isEqualTo(v, _f()) &&
3002
- isEqual(v, _f()) &&
3003
- _.isEqual(v, _f()) &&
3004
- underscore.isEqual(v, _f()) &&
3005
- strictlyEqual(v, _f()) &&
3006
- v === _f() &&
3007
- v === FALSE &&
3008
- couldThisCouldItBeFalse(v)
3009
-
3010
- return cond
3011
- }
3012
-
3013
- variableHolder._FalseJSjQueryPlugin = function jQueryPlugin() {
3014
- // Inject into jQuery
3015
- jQuery.False =
3016
- variableHolder._FalseJSMainFunctionWotDoesFunctionality
3017
- jQuery.isFalse = variableHolder._FalseJSIsFalse
3018
- }
3019
-
3020
- variableHolder._FalseJSExpressMiddleware = function expressMiddleware(
3021
- req,
3022
- _res,
3023
- next,
3024
- ) {
3025
- // Add our function to the request object
3026
- req.False = variableHolder._FalseJSMainFunctionWotDoesFunctionality
3027
- req.isFalse = variableHolder._FalseJSIsFalse
3028
- next() // Continue to the next middleware or route
3029
- }
3030
-
3031
- /*exports.Yes = literally(YES)
3032
- exports.No = literally(NO)*/
3033
- // *EVEN MORE HELPERS
3034
-
3035
- function getNo() {
3036
- const NO = require("no/dist/main")
3037
- const NoComponent = () => {
3038
- return React.createElement("div", Null(), NO)
3039
- }
3040
- const noElement = React.createElement(NoComponent)
3041
- const html = cheerio
3042
- .load(ReactDOMServer.renderToString(noElement))("div")
3043
- .toString()
3044
- const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`)
3045
- dom.window.document.body.innerHTML = html
3046
- const bodyContent =
3047
- dom.window.document.querySelector("body").innerHTML
3048
- return striptags(bodyContent)
3049
- }
3050
-
3051
- function getValueOfThisStringText(text) {
3052
- return text
3053
- }
3054
-
3055
- function calculateRandomLetterOrNumber(loggingEnabled) {
3056
- const uniqueId = uuid.v4()
3057
- const uniqueId2 = crypto.randomUUID()
3058
- const dashlessUUID = uniqueId.replaceAll("-", emptyString)
3059
- const dashlessUUID2 = uniqueId2.replaceAll("-", emptyString)
3060
- const combinedUUID = emptyString.concat(dashlessUUID, dashlessUUID2)
3061
- const randomCharacter = StringCharAt.call(
3062
- combinedUUID,
3063
- $.add(
3064
- MathFloor(
3065
- $.multiply(MathRandom(), getStringLength(combinedUUID)),
3066
- ),
3067
- one,
3068
- ),
3069
- )
3070
- if (loggingEnabled) {
3071
- ltc(
3072
- clc.cyanBright(
3073
- `[falsejs] Random character calculated: ${randomCharacter}`,
3074
- ),
3075
- )
3076
- }
3077
- return randomCharacter
3078
- }
3079
- class falsejs {
3080
- static False =
3081
- variableHolder._FalseJSMainFunctionWotDoesFunctionality
3082
- static isFalse = variableHolder._FalseJSIsFalse
3083
- static injectIntojQuery = variableHolder._FalseJSjQueryPlugin
3084
- static expressMiddleware = variableHolder._FalseJSExpressMiddleware
3085
-
3086
- constructor() {
3087
- console.warn(
3088
- c.yellow(
3089
- `[falsejs] you aren't really supposed to create an instance of falsejs with new or construct(), but whatever`,
3090
- ),
3091
- )
3092
- this.False = falsejs.False
3093
- this.isFalse = falsejs.isFalse
3094
- this.injectIntojQuery = falsejs.injectIntojQuery
3095
- this.expressMiddleware = falsejs.expressMiddleware
3096
- }
3097
- }
3098
-
3099
- return falsejs
3100
- })
3101
- }
3102
- }
3103
- }
3104
- }