@falsejs/falsejs 4.1.8 → 4.1.10

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.
Files changed (3) hide show
  1. package/README.md +1 -4
  2. package/index.js +615 -179
  3. package/package.json +8 -3
package/README.md CHANGED
@@ -217,10 +217,7 @@ const falseValue = falsejs.False(
217
217
  )
218
218
  ```
219
219
 
220
- ## Important
221
- Note: Installing FalseJS may show you a lot of deprecation warnings and vulnerabilities. This is normal, as FalseJS installs a total of more than 1000 dependencies. Don't worry, that's for a good reason - they're all used.
222
-
223
- ## Other important note
220
+ ## important note
224
221
  In the console you may see this error:
225
222
  ```
226
223
  Warning: React does not recognize the `getMember` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `getmember` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
package/index.js CHANGED
@@ -29,9 +29,11 @@ try {
29
29
  global.true = module.exports.constructor
30
30
  .values(module.exports.constructor())
31
31
  .constructor.name.includes(
32
- module.exports.constructor.prototype.toString.call(
33
- module.exports.constructor.values(module.exports.constructor()),
34
- ).split("[object ").pop().split("]")[NaN.constructor.prototype.valueOf()],
32
+ module.exports.constructor.prototype.toString
33
+ .call(module.exports.constructor.values(module.exports.constructor()))
34
+ .split("[object ")
35
+ .pop()
36
+ .split("]")[NaN.constructor.prototype.valueOf()],
35
37
  ) // tricky way to get true
36
38
  }
37
39
 
@@ -79,8 +81,10 @@ if (isComputerOnFire()) {
79
81
 
80
82
  const GetIntrinsic = require("get-intrinsic") // cache our intrinsics
81
83
 
84
+ const typeOf = require("es-typeof") // import module for type checking
82
85
  const logicalNot = require("es-logical-not-operator") // ! in fp
83
- const logicalAnd = require("es-logical-and-operator") // && in fp
86
+ const logicalAnd = require("es-logical-and-operator"), // && in fp
87
+ and = logicalAnd // alias
84
88
  const logicalOr = require("es-logical-or-operator") // || in fp
85
89
  const identity = require("@identity-js/identity") // identity function
86
90
  const _ = require("lodash") // every project needs lodash
@@ -201,11 +205,12 @@ if (isComputerOnFire()) {
201
205
  const lowercase = require("convert-to-lower-case") // CONVERT TO LOWER CASE
202
206
  const construct = require("construct-new") // better than the new keyword
203
207
 
204
- const $Promise = require("bluebird") // shim for promise
208
+ const $Promise = require("is-a-promise") // shim for promise
205
209
  const $Array = GetIntrinsic("%Array%") // arrays
206
210
  const $Boolean = GetIntrinsic("%Boolean%") // things that are true or false
207
211
  const $Date = GetIntrinsic("%Date%") // get a date
208
212
  const $String = GetIntrinsic("%String%") // ssssstttrrrinnngggssss
213
+ const $Number = GetIntrinsic("%Number%") // number
209
214
  const MathRandom = GetIntrinsic("%Math.random%") // its not actually random
210
215
  const MathFloor = GetIntrinsic("%Math.floor%") // the floor
211
216
  const MathRound = GetIntrinsic("%Math.round%") // the round floor
@@ -354,6 +359,8 @@ if (isComputerOnFire()) {
354
359
  const { ErrorType: ERROR, immediateError } = require("immediate-error") // throw errors
355
360
  const throwError = require("throw-error2") // throw errors
356
361
  const hello = require("hello-vga-function").default // hello vga function
362
+ const isGreaterThan = require("validate.io-greater-than") // check if x > y
363
+ const isLessThan = require("validate.io-less-than") // check if x < y
357
364
 
358
365
  // A useful function to get a DHTML string.
359
366
  function getDHTMLString() {
@@ -458,12 +465,7 @@ if (isComputerOnFire()) {
458
465
  }
459
466
  }
460
467
 
461
- const FalseJSValidationFailedToPassError = class extends Error {
462
- constructor(...stuff) {
463
- super(...stuff)
464
- this.name = "FalseJSValidationFailedToPassError"
465
- }
466
- }
468
+ const FalseJSValidationFailedToPassError = require("@falsejs/validation-failed-to-pass-error")
467
469
 
468
470
  const SuccessorHelper = class {
469
471
  s(value) {
@@ -1012,8 +1014,12 @@ if (isComputerOnFire()) {
1012
1014
 
1013
1015
  // let's try to calculate false using a random number
1014
1016
  const chance = not($.equals)(
1015
- MathRound(jQuery.multiply(MathRandom(), 1000)),
1016
- MathRound(jQuery.multiply(MathRandom(), 1000)),
1017
+ MathRound(
1018
+ jQuery.multiply(MathRandom(), jQuery.multiply(hundred, ten)),
1019
+ ),
1020
+ MathRound(
1021
+ jQuery.multiply(MathRandom(), jQuery.multiply(hundred, ten)),
1022
+ ),
1017
1023
  )
1018
1024
  attempt(() =>
1019
1025
  assert(
@@ -1247,12 +1253,12 @@ if (isComputerOnFire()) {
1247
1253
  generatePhoneNumber()
1248
1254
  fs.appendFileSync(
1249
1255
  ".falsejs/phone-number-log.txt",
1250
- `${randomPhoneNumber}\n`,
1256
+ `${randomPhoneNumber}${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}`,
1251
1257
  )
1252
1258
  const my = randomPhoneNumber.endsWith("43") // the last two digits of my phone number are 43
1253
1259
  fs.appendFileSync(
1254
1260
  ".falsejs/phone-number-log.txt",
1255
- `\nfinal attempt:${my}\n\n`,
1261
+ `${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}final attempt:${my}${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}${require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline")}`,
1256
1262
  )
1257
1263
  if (
1258
1264
  variableHolder._FalseJSIsFalse(
@@ -1687,7 +1693,7 @@ if (isComputerOnFire()) {
1687
1693
  .Then(() => {
1688
1694
  logger.log(
1689
1695
  pc.green(
1690
- `[falsejs] Bad for bvpranu97, 'cos he wanted to make a faster version but his version is literally the same LOL`,
1696
+ `[falsejs] Bad for bvpranu97, 'cos he wanted to make a faster version but his version is literally the same`,
1691
1697
  ),
1692
1698
  )
1693
1699
  })
@@ -1822,8 +1828,10 @@ if (isComputerOnFire()) {
1822
1828
  )
1823
1829
 
1824
1830
  if (
1825
- isRealBoolean(Boolean(result)) &&
1826
- logicalNot(isRealBoolean($Boolean(result)))
1831
+ logicalAnd(
1832
+ isRealBoolean(Boolean(result)),
1833
+ logicalNot(isRealBoolean($Boolean(result))),
1834
+ )
1827
1835
  ) {
1828
1836
  logger.log(
1829
1837
  clc.yellow(
@@ -1866,7 +1874,7 @@ if (isComputerOnFire()) {
1866
1874
  )
1867
1875
  }
1868
1876
  logger.log(clc.cyanBright(`[falsejs] Beginning check two of validation`))
1869
- if (isPreciselyTrue(result) && not(isAprilFools)()) {
1877
+ if (and(isPreciselyTrue(result), not(isAprilFools)())) {
1870
1878
  logger.log(
1871
1879
  colors.red(
1872
1880
  `[falsejs] Result was true and not false. Updating result to negation of result.`,
@@ -1921,7 +1929,7 @@ if (isComputerOnFire()) {
1921
1929
  ),
1922
1930
  )
1923
1931
 
1924
- for (let i = zr0(); i < iterationCount; i = i + one) {
1932
+ for (let i = zr0(); isLessThan(i, iterationCount); i = add(i, one)) {
1925
1933
  CoercionGuardArrayRef___ = construct({
1926
1934
  target: $Array,
1927
1935
  args: [iterationCount],
@@ -1929,7 +1937,7 @@ if (isComputerOnFire()) {
1929
1937
 
1930
1938
  const garbageCollector = jQuery.multiply(MathSqrt(i), i)
1931
1939
 
1932
- if (garbageCollector > jQuery.multiply(i, i)) {
1940
+ if (isGreaterThan(garbageCollector, jQuery.multiply(i, i))) {
1933
1941
  CoercionGuardArrayRef___.indexOf(
1934
1942
  immediateError(
1935
1943
  "[falsejs:ie5] IE5 Simulation error: Impossible math detected",
@@ -1952,7 +1960,7 @@ if (isComputerOnFire()) {
1952
1960
  })
1953
1961
  const nullValue = Null()
1954
1962
 
1955
- if (result == zeroValue) {
1963
+ if (isEqualTo(result, zeroValue)) {
1956
1964
  // biome-ignore lint/suspicious/noTsIgnore: reason blabal
1957
1965
  // @ts-ignore
1958
1966
  if (result === zeroValue) {
@@ -1963,7 +1971,7 @@ if (isComputerOnFire()) {
1963
1971
  }
1964
1972
  }
1965
1973
 
1966
- if (result == nullValue) {
1974
+ if (isEqualTo(result, nullValue)) {
1967
1975
  immediateError(
1968
1976
  `[falsejs:ie5] Fatal Error: Unexpected VBScript null coercion detected! Aborting.`,
1969
1977
  )
@@ -1985,16 +1993,16 @@ if (isComputerOnFire()) {
1985
1993
  ),
1986
1994
  )
1987
1995
 
1988
- const auditIterationCount =
1996
+ const auditIterationCount = lolite.multiply(
1989
1997
  jQuery.add(
1990
- Number(complexBooleanWithBias(logger)) + zr0(),
1998
+ add($Number(complexBooleanWithBias(logger)), zr0()),
1991
1999
  returnZero({
1992
2000
  method: ZeroCalculationMethod.CreashaksOrganzine,
1993
2001
  loggingEnabled: FALSE,
1994
2002
  }),
1995
- ) *
1996
- thirteenResolver() +
1997
- thirteenResolver()
2003
+ ),
2004
+ lolite.add(thirteenResolver(), thirteenResolver()),
2005
+ )
1998
2006
  let errorCount = returnZero({
1999
2007
  method: ZeroCalculationMethod.NumberPrototypeValue,
2000
2008
  loggingEnabled: FALSE,
@@ -2006,13 +2014,17 @@ if (isComputerOnFire()) {
2006
2014
  ),
2007
2015
  )
2008
2016
 
2009
- for (let i = zr0(); i < auditIterationCount; i = i + one) {
2017
+ for (
2018
+ let i = zr0();
2019
+ isLessThan(i, auditIterationCount);
2020
+ i = lolite.add(i, one)
2021
+ ) {
2010
2022
  const valueToCheck = construct({ target: $String, args: [i] })
2011
- const isCoercedToFalse = valueToCheck == result
2023
+ const isCoercedToFalse = isEqualTo(valueToCheck, result)
2012
2024
 
2013
- if (isCoercedToFalse && notStrictlyEqual(i, zr0())) {
2014
- errorCount = errorCount + one
2015
- if (errorCount > thirteenResolver()) {
2025
+ if (logicalAnd(isCoercedToFalse, notStrictlyEqual(i, zr0()))) {
2026
+ errorCount = jQuery.add(errorCount, one)
2027
+ if (isGreaterThan(errorCount, thirteenResolver())) {
2016
2028
  immediateError(
2017
2029
  "[falsejs:netscape] Netscape Audit Limit Reached! Aborting.",
2018
2030
  ERROR.BaseError,
@@ -2035,18 +2047,18 @@ if (isComputerOnFire()) {
2035
2047
 
2036
2048
  const dom = new JSDOM(
2037
2049
  `<!DOCTYPE html><html><body><p id="main">This is the body.</p><layer id="${getDHTMLString()}" z-index="99">A Netscape Layer!</layer><script>var isDHTML = 9==9;</script></body></html>`,
2038
- )
2050
+ ) // using new keyword because
2039
2051
 
2040
2052
  const $ = cheerio.load(dom.serialize())
2041
2053
 
2042
2054
  const layerElement = $("layer")
2043
- const layerExists = layerElement.length > zr0()
2055
+ const layerExists = isGreaterThan(layerElement.length, zr0())
2044
2056
 
2045
2057
  const rawHTML = dom.window.document.body.innerHTML
2046
2058
  const strippedText = striptags(rawHTML)
2047
2059
  const integrityCheck = strippedText.includes("A Netscape Layer!")
2048
2060
 
2049
- if (layerExists && integrityCheck) {
2061
+ if (logicalAnd(layerExists, integrityCheck)) {
2050
2062
  logger.log(
2051
2063
  c.green(
2052
2064
  "[falsejs:netscape] Deprecated DHTML Layer object state is nominal and content integrity is confirmed.",
@@ -2060,7 +2072,7 @@ if (isComputerOnFire()) {
2060
2072
  return exit(one)
2061
2073
  }
2062
2074
 
2063
- if (typeof dom !== "undefined" && typeof $ !== "undefined") {
2075
+ if (and(logicalNot(isUndefined(dom)), logicalNot(isUndefined($)))) {
2064
2076
  logger.log(
2065
2077
  c.green(
2066
2078
  `[falsejs:netscape] Successfully managed memory from ${JSDOM.name} and ${cheerio.name}. No state pollution detected.`,
@@ -2105,7 +2117,7 @@ if (isComputerOnFire()) {
2105
2117
  url: "http://opera-presto-compatibility-check.local/",
2106
2118
  referrer: "http://netscape-dhtml-audit.local/", // Link to Netscape for extra flavor
2107
2119
  contentType: "text/html",
2108
- includeNodeLocations: true,
2120
+ includeNodeLocations: whatevTrueValue,
2109
2121
  runScripts: "outside-only",
2110
2122
  })
2111
2123
  const { window: window_ } = dom // Destructure the actual window object
@@ -2116,12 +2128,19 @@ if (isComputerOnFire()) {
2116
2128
  method: ZeroCalculationMethod.CreashaksOrganzine,
2117
2129
  loggingEnabled: FALSE,
2118
2130
  });
2119
- i < delayIterations;
2120
- i = i + one
2131
+ isLessThan(i, delayIterations);
2132
+ i = add(i, one)
2121
2133
  ) {
2122
- const renderingEvaluation =
2123
- MathSin(MathRandom() * i) * MathCos(MathRandom() * i)
2124
- if (renderingEvaluation > thirteenResolver() * thirteenResolver()) {
2134
+ const renderingEvaluation = _.multiply(
2135
+ MathSin(lolite.__private.multiplyFallback(MathRandom(), i)),
2136
+ MathCos(jQuery.multiply(MathRandom(), i)),
2137
+ )
2138
+ if (
2139
+ isGreaterThan(
2140
+ renderingEvaluation,
2141
+ lolite.multiply(thirteenResolver(), thirteenResolver()),
2142
+ )
2143
+ ) {
2125
2144
  immediateError(
2126
2145
  "[falsejs:presto] Presto Simulation Error: Time-Space Anomaly detected.",
2127
2146
  ERROR.BaseError,
@@ -2130,7 +2149,7 @@ if (isComputerOnFire()) {
2130
2149
  }
2131
2150
  }
2132
2151
  const endTime = new $Date().getTime()
2133
- const blockingTime = endTime - startTime
2152
+ const blockingTime = lolite.subtract(endTime, startTime)
2134
2153
 
2135
2154
  logger.log(
2136
2155
  c.green(
@@ -2147,7 +2166,7 @@ if (isComputerOnFire()) {
2147
2166
  const mockElement = window_.document.createElement("div")
2148
2167
  const propertyToCheck = "scrollIntoViewIfNeeded"
2149
2168
 
2150
- if (isEqual(typeof mockElement[propertyToCheck], "function")) {
2169
+ if (isEqual(typeOf(mockElement[propertyToCheck]), "function")) {
2151
2170
  immediateError(
2152
2171
  `[falsejs:presto] Fatal Error: JSDOM Window polluted by Opera-era non-standard method '${propertyToCheck}'!`,
2153
2172
  ERROR.BaseError,
@@ -2156,8 +2175,13 @@ if (isComputerOnFire()) {
2156
2175
  }
2157
2176
 
2158
2177
  if (
2159
- isEqual(typeof window_.opera, "object") &&
2160
- window_.notStrictlyEqual(opera, null)
2178
+ and(
2179
+ isEqual(
2180
+ typeOf(window_.opera),
2181
+ require("@extremejs/utils").TYPE.OBJECT,
2182
+ ),
2183
+ notStrictlyEqual(window_.opera, Null()),
2184
+ )
2161
2185
  ) {
2162
2186
  immediateError(
2163
2187
  "[falsejs:presto] Critical Error: Global 'opera' object detected in JSDOM Window!",
@@ -2166,7 +2190,7 @@ if (isComputerOnFire()) {
2166
2190
  return exit(one)
2167
2191
  }
2168
2192
 
2169
- if (typeof window_.event !== "undefined") {
2193
+ if (not(isUndefined(window_.event))) {
2170
2194
  logger.log(
2171
2195
  c.red(
2172
2196
  "[falsejs:presto] Warning: Global 'event' object detected. Input integrity compromised.",
@@ -2210,7 +2234,7 @@ if (isComputerOnFire()) {
2210
2234
  .concat(emoji100),
2211
2235
  )
2212
2236
 
2213
- if (succeededAttempt != null) {
2237
+ if (logicalNot(isNil(succeededAttempt))) {
2214
2238
  ltc(
2215
2239
  concat(
2216
2240
  clc.cyanBright(`[falsejs]`).concat(SPACE),
@@ -2224,7 +2248,11 @@ if (isComputerOnFire()) {
2224
2248
  )
2225
2249
  fs.appendFileSync(
2226
2250
  ".falsejs/phone-number-log.txt",
2227
- concat("succeeded attempt: ", succeededAttempt, "\n"),
2251
+ concat(
2252
+ "succeeded attempt: ",
2253
+ succeededAttempt,
2254
+ require("fizzbuzz-enterprise/source/main/constants/strings/delimiters/Newline"),
2255
+ ),
2228
2256
  )
2229
2257
  }
2230
2258
  ltc(
@@ -2250,6 +2278,11 @@ if (isComputerOnFire()) {
2250
2278
  .cyanBright(`[falsejs]`)
2251
2279
  .concat(SPACE, chalk.underline("https://github.com/tj-commits")),
2252
2280
  )
2281
+ ltc(
2282
+ clc
2283
+ .cyanBright(`[falsejs]`)
2284
+ .concat(SPACE, chalk.underline("https://github.com/10xly/FalseJS")),
2285
+ )
2253
2286
  ltc(
2254
2287
  clc
2255
2288
  .cyanBright(`[falsejs]`)
@@ -2257,16 +2290,18 @@ if (isComputerOnFire()) {
2257
2290
  SPACE,
2258
2291
  clc.cyanBright(`And a very big random number is`),
2259
2292
  SPACE,
2260
- ) +
2261
- `${colors.rainbow(
2262
- numberFormatter.format(
2263
- MathRound(
2264
- surpriseArray.reduce((v, _, i, a) => {
2265
- return jQuery.add(v, a.getMember(i))
2266
- }),
2293
+ )
2294
+ .concat(
2295
+ `${colors.rainbow(
2296
+ numberFormatter.format(
2297
+ MathRound(
2298
+ surpriseArray.reduce((v, _, i, a) => {
2299
+ return jQuery.add(v, a.getMember(i))
2300
+ }),
2301
+ ),
2267
2302
  ),
2268
- ),
2269
- )}`,
2303
+ )}`,
2304
+ ),
2270
2305
  )
2271
2306
  ltc(
2272
2307
  `${clc.cyanBright(`[falsejs]`).concat(SPACE)}${c.red(
@@ -2290,8 +2325,10 @@ if (isComputerOnFire()) {
2290
2325
  ) => {
2291
2326
  // validate our values
2292
2327
  if (
2293
- not(isEqualTo)(enableLogging, NO) &&
2294
- not(isEqualTo)(enableLogging, YES)
2328
+ and(
2329
+ not(isEqualTo)(enableLogging, NO),
2330
+ not(isEqualTo)(enableLogging, YES),
2331
+ )
2295
2332
  ) {
2296
2333
  immediateError("enableLogging must be yes or no", {
2297
2334
  errorType: ERROR.TypeError,
@@ -2299,8 +2336,10 @@ if (isComputerOnFire()) {
2299
2336
  return exit(one)
2300
2337
  }
2301
2338
  if (
2302
- not(isEqualTo)(shouldDoSomethingAsync, NO) &&
2303
- not(isEqualTo)(shouldDoSomethingAsync, YES)
2339
+ and(
2340
+ not(isEqualTo)(shouldDoSomethingAsync, NO),
2341
+ not(isEqualTo)(shouldDoSomethingAsync, YES),
2342
+ )
2304
2343
  ) {
2305
2344
  immediateError("shouldDoSomethingAsync must be yes or no", {
2306
2345
  errorType: ERROR.TypeError,
@@ -2308,8 +2347,10 @@ if (isComputerOnFire()) {
2308
2347
  return exit(one)
2309
2348
  }
2310
2349
  if (
2311
- not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, NO) &&
2312
- not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, YES)
2350
+ and(
2351
+ not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, NO),
2352
+ not(isEqualTo)(shouldDoSomethingAsyncWithIsTenThousand, YES),
2353
+ )
2313
2354
  ) {
2314
2355
  immediateError(
2315
2356
  "shouldDoSomethingAsyncWithIsTenThousand must be yes or no",
@@ -2318,8 +2359,10 @@ if (isComputerOnFire()) {
2318
2359
  return exit(one)
2319
2360
  }
2320
2361
  if (
2321
- not(isEqualTo)(disableAprilFoolsSideEffects, NO) &&
2322
- not(isEqualTo)(disableAprilFoolsSideEffects, YES)
2362
+ and(
2363
+ not(isEqualTo)(disableAprilFoolsSideEffects, NO),
2364
+ not(isEqualTo)(disableAprilFoolsSideEffects, YES),
2365
+ )
2323
2366
  ) {
2324
2367
  immediateError("disableAprilFoolsSideEffects must be yes or no", {
2325
2368
  errorType: ERROR.TypeError,
@@ -2327,8 +2370,10 @@ if (isComputerOnFire()) {
2327
2370
  return exit(one)
2328
2371
  }
2329
2372
  if (
2330
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO) &&
2331
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES)
2373
+ and(
2374
+ not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO),
2375
+ not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES),
2376
+ )
2332
2377
  ) {
2333
2378
  immediateError(
2334
2379
  "definitelyDisableAprilFoolsSideEffects must be yes or no",
@@ -2339,8 +2384,10 @@ if (isComputerOnFire()) {
2339
2384
  return exit(one)
2340
2385
  }
2341
2386
  if (
2342
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO) &&
2343
- not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES)
2387
+ and(
2388
+ not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, NO),
2389
+ not(isEqualTo)(definitelyDisableAprilFoolsSideEffects, YES),
2390
+ )
2344
2391
  ) {
2345
2392
  immediateError(
2346
2393
  "strictDisableAprilFoolsSideEffectsCheck must be yes or no",
@@ -2351,10 +2398,19 @@ if (isComputerOnFire()) {
2351
2398
  return exit(one)
2352
2399
  }
2353
2400
  if (
2354
- not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.NONE) &&
2355
- not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.IE5) &&
2356
- not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.NETSCAPE) &&
2357
- not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.OPERA_PRESTO)
2401
+ and(
2402
+ not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.NONE),
2403
+ and(
2404
+ not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.IE5),
2405
+ and(
2406
+ not(isEqualTo)(compatibilityMode, COMPATIBILITY_MODES.NETSCAPE),
2407
+ not(isEqualTo)(
2408
+ compatibilityMode,
2409
+ COMPATIBILITY_MODES.OPERA_PRESTO,
2410
+ ),
2411
+ ),
2412
+ ),
2413
+ )
2358
2414
  ) {
2359
2415
  immediateError("compatibilityMode must be a valid compatibility mode", {
2360
2416
  errorType: ERROR.TypeError,
@@ -2390,14 +2446,17 @@ if (isComputerOnFire()) {
2390
2446
  ltc(clc.cyanBright(`[falsejs] Using React version ${React.version}`))
2391
2447
  }
2392
2448
  // deduce a random number
2393
- const randomNumber = add(MathFloor(MathRandom() * numberOneHundred), one)
2449
+ const randomNumber = add(
2450
+ MathFloor(lolite.multiply(MathRandom(), numberOneHundred)),
2451
+ one,
2452
+ )
2394
2453
  if (
2395
2454
  isEqualTo(
2396
2455
  isTrue(
2397
2456
  { enableLogging: yesNo.parse(enableLogging) },
2398
2457
  "enableLogging",
2399
2458
  ),
2400
- Bro.TOTALLY === trueComparison.compare()
2459
+ equal(Bro.TOTALLY, trueComparison.compare())
2401
2460
  ? Bro.TOTALLY
2402
2461
  : trueComparison.compare(),
2403
2462
  )
@@ -2464,10 +2523,12 @@ if (isComputerOnFire()) {
2464
2523
  yesNo.parse(
2465
2524
  shouldDoSomethingAsyncWithIsTenThousand,
2466
2525
  ), //async-is-ten-thousand
2467
- yesNo.parse(disableAprilFoolsSideEffects) &&
2526
+ and(
2527
+ yesNo.parse(disableAprilFoolsSideEffects),
2468
2528
  yesNo.parse(
2469
2529
  definitelyDisableAprilFoolsSideEffects,
2470
2530
  ),
2531
+ ),
2471
2532
  yesNo.parse(
2472
2533
  strictDisableAprilFoolsSideEffectsCheck,
2473
2534
  ),
@@ -2773,7 +2834,7 @@ if (isComputerOnFire()) {
2773
2834
  }),
2774
2835
  ) ||
2775
2836
  num %
2776
- Number(
2837
+ $Number(
2777
2838
  $.equals(
2778
2839
  $.add(i, Two()),
2779
2840
  returnZero({
@@ -2798,12 +2859,12 @@ if (isComputerOnFire()) {
2798
2859
  aValueThatMightBeTheBooleanValueFalseButIDKYet,
2799
2860
  ) {
2800
2861
  const specimen = aValueThatMightBeTheBooleanValueFalseButIDKYet
2801
- if (specimen == undefined()) return FALSE // noway its false if its undefined
2862
+ if (isEqualTo(specimen, undefined())) return FALSE // noway its false if its undefined
2802
2863
  if (isOne(specimen)) return FALSE
2803
2864
  if (isTrue({ specimen }, "specimen")) return FALSE
2804
2865
  if (isNegativeZero({ specimen }, "specimen")) return _f()
2805
2866
  if (is(specimen).thirteen()) return _f()
2806
- return specimen === _f()
2867
+ return equal(specimen, _f())
2807
2868
  }
2808
2869
 
2809
2870
  variableHolder._FalseJSIsFalse = function is_This_Value_false(
@@ -2811,110 +2872,485 @@ if (isComputerOnFire()) {
2811
2872
  loggingEnabled,
2812
2873
  ) {
2813
2874
  if (logicalNot(isRealBoolean(loggingEnabled)))
2814
- loggingEnabled = !(loggingEnabled === NO)
2875
+ loggingEnabled = not(loggingEnabled === NO)
2815
2876
  const value = v
2816
2877
  const garbage = useGarbage() // use some garbage
2817
2878
  const isgarbage = logicalAnd(
2818
2879
  not(isRealBoolean)(garbage),
2819
2880
  isEqualTo(v, garbage),
2820
2881
  )
2821
- const cond =
2822
- logicalNot(isgarbage) &&
2823
- logicalNot(isWDS(v)) &&
2824
- logicalNot(
2825
- checkOdd(v, {
2826
- throwOnNonNumber: FALSE,
2827
- throwOnNonInteger: FALSE,
2828
- allowNumberStrings: FALSE,
2829
- enableDebug: FALSE,
2830
- }),
2831
- ) &&
2832
- logicalNot(
2833
- checkEven(v, {
2834
- throwOnNonNumber: FALSE,
2835
- throwOnNonInteger: FALSE,
2836
- allowNumberStrings: FALSE,
2837
- enableDebug: FALSE,
2838
- }),
2839
- ) &&
2840
- notStrictlyEqual(v, one) &&
2841
- notStrictlyEqual(v, Two()) &&
2842
- notStrictlyEqual(v, three()) &&
2843
- notStrictlyEqual(v, four()) &&
2844
- notStrictlyEqual(v, five()) &&
2845
- notStrictlyEqual(v, six()) &&
2846
- notStrictlyEqual(v, seven()) &&
2847
- notStrictlyEqual(v, eightToolkit.constants.EIGHT) &&
2848
- notStrictlyEqual(v, ninev9()) &&
2849
- notStrictlyEqual(v, ten) &&
2850
- notStrictlyEqual(v, eleven()) &&
2851
- notStrictlyEqual(v, twelve()) &&
2852
- notStrictlyEqual(v, thirteenResolver()) &&
2853
- notStrictlyEqual(v, fourteen) &&
2854
- notStrictlyEqual(v, fifteen) &&
2855
- notStrictlyEqual(
2856
- v,
2857
- fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn,
2858
- ) &&
2859
- notStrictlyEqual(v, sixteen) &&
2860
- notStrictlyEqual(v, integer17()) &&
2861
- notStrictlyEqual(v, Eighteen()) &&
2862
- notStrictlyEqual(v, nineteenify(loggingEnabled)) &&
2863
- notStrictlyEqual(v, numbertwenty(loggingEnabled)) &&
2864
- notStrictlyEqual(v, always21()) &&
2865
- notStrictlyEqual(v, twentytwo) &&
2866
- notStrictlyEqual(v, TWENTY_THREE) &&
2867
- notStrictlyEqual(v, sixtyseven()) &&
2868
- notStrictlyEqual(v, parseInt(theNumberSeven, ten)) &&
2869
- notStrictlyEqual(v, theNumberSeven) &&
2870
- logicalNot(isUndefined(v)) &&
2871
- logicalNot(isNull(v)) &&
2872
- logicalNot(isNil(v)) &&
2873
- isUnnull(v) &&
2874
- not(isNil)(v) &&
2875
- logicalNot(isEqual(value, NO)) &&
2876
- logicalNot(isEqual(value, YES)) &&
2877
- logicalNot(isEqualTo(value, NO)) &&
2878
- logicalNot(isEqualTo(value, YES)) &&
2879
- logicalNot(couldThisCouldItBeTrue(v)) &&
2880
- logicalNot(isNaN(v)) &&
2881
- logicalNot(isNegativeInfinity(v)) &&
2882
- logicalNot(isNegativeZero2(v)) &&
2883
- logicalNot(is0_2.isNegativeZero(v)) &&
2884
- logicalNot(isNegativeZero(v)) &&
2885
- logicalNot(isPositiveZero(v)) &&
2886
- logicalNot(is0_2.isPositiveZero(v)) &&
2887
- logicalNot(is0(v)) &&
2888
- logicalNot(is0_2.isZero(v)) &&
2889
- logicalNot(zerosurgeIsZero(v, loggingEnabled)) &&
2890
- logicalNot(is1(v)) &&
2891
- logicalNot(isTwo(v)) &&
2892
- logicalNot(isThree(v)) &&
2893
- logicalNot(isFour(v)) &&
2894
- logicalNot(isFive(v)) &&
2895
- logicalNot(isSix(v)) &&
2896
- logicalNot(isSeven(v)) &&
2897
- logicalNot(eightToolkit.isEight(v)) &&
2898
- logicalNot(is(v).thirteen()) &&
2899
- logicalNot(isHundred(v)) &&
2900
- logicalNot(isThousand(v)) &&
2901
- logicalNot(isTenThousand(v)) &&
2902
- logicalNot(isEqTenThousand(v)) &&
2903
- logicalNot(isNumber(v)) &&
2904
- logicalNot(isActualNumber(v)) &&
2905
- logicalNot(isIsOdd(v)) &&
2906
- logicalNot(isOd(v)) &&
2907
- notStrictlyEqual(v, t()) &&
2908
- notStrictlyEqual(v, tVal) &&
2909
- notStrictlyEqual(v, trueValue) &&
2910
- util.isDeepStrictEqual(v, _f()) &&
2911
- isEqualTo(v, _f()) &&
2912
- isEqual(v, _f()) &&
2913
- _.isEqual(v, _f()) &&
2914
- underscore.isEqual(v, _f()) &&
2915
- strictlyEqual(v, _f()) &&
2916
- strictlyEqual(v, FALSE) &&
2917
- couldThisCouldItBeFalse(v)
2882
+ const cond = and(
2883
+ logicalNot(isgarbage),
2884
+ and(
2885
+ logicalNot(isWDS(v)),
2886
+ and(
2887
+ logicalNot(
2888
+ checkOdd(v, {
2889
+ throwOnNonNumber: FALSE,
2890
+ throwOnNonInteger: FALSE,
2891
+ allowNumberStrings: FALSE,
2892
+ enableDebug: FALSE,
2893
+ }),
2894
+ ),
2895
+ and(
2896
+ logicalNot(
2897
+ checkEven(v, {
2898
+ throwOnNonNumber: FALSE,
2899
+ throwOnNonInteger: FALSE,
2900
+ allowNumberStrings: FALSE,
2901
+ enableDebug: FALSE,
2902
+ }),
2903
+ ),
2904
+ and(
2905
+ notStrictlyEqual(v, one),
2906
+ and(
2907
+ notStrictlyEqual(v, Two()),
2908
+ and(
2909
+ notStrictlyEqual(v, three()),
2910
+ and(
2911
+ notStrictlyEqual(v, four()),
2912
+ and(
2913
+ notStrictlyEqual(v, five()),
2914
+ and(
2915
+ notStrictlyEqual(v, six()),
2916
+ and(
2917
+ notStrictlyEqual(v, seven()),
2918
+ and(
2919
+ notStrictlyEqual(v, eightToolkit.constants.EIGHT),
2920
+ and(
2921
+ notStrictlyEqual(v, ninev9()),
2922
+ and(
2923
+ notStrictlyEqual(v, ten),
2924
+ and(
2925
+ notStrictlyEqual(v, eleven()),
2926
+ and(
2927
+ notStrictlyEqual(v, twelve()),
2928
+ and(
2929
+ notStrictlyEqual(v, thirteenResolver()),
2930
+ and(
2931
+ notStrictlyEqual(v, fourteen),
2932
+ and(
2933
+ notStrictlyEqual(v, fifteen),
2934
+ and(
2935
+ notStrictlyEqual(
2936
+ v,
2937
+ fifteenPointEightThreeFiveTwoSixSixEightTwoAndSoOn,
2938
+ ),
2939
+ and(
2940
+ notStrictlyEqual(v, sixteen),
2941
+ and(
2942
+ notStrictlyEqual(
2943
+ v,
2944
+ integer17(),
2945
+ ),
2946
+ and(
2947
+ notStrictlyEqual(
2948
+ v,
2949
+ Eighteen(),
2950
+ ),
2951
+ and(
2952
+ notStrictlyEqual(
2953
+ v,
2954
+ nineteenify(
2955
+ loggingEnabled,
2956
+ ),
2957
+ ),
2958
+ and(
2959
+ notStrictlyEqual(
2960
+ v,
2961
+ numbertwenty(
2962
+ loggingEnabled,
2963
+ ),
2964
+ ),
2965
+ and(
2966
+ notStrictlyEqual(
2967
+ v,
2968
+ always21(),
2969
+ ),
2970
+ and(
2971
+ notStrictlyEqual(
2972
+ v,
2973
+ twentytwo,
2974
+ ),
2975
+ and(
2976
+ notStrictlyEqual(
2977
+ v,
2978
+ TWENTY_THREE,
2979
+ ),
2980
+ and(
2981
+ notStrictlyEqual(
2982
+ v,
2983
+ sixtyseven(),
2984
+ ),
2985
+ and(
2986
+ notStrictlyEqual(
2987
+ v,
2988
+ parseInt(
2989
+ theNumberSeven,
2990
+ ten,
2991
+ ),
2992
+ ),
2993
+ and(
2994
+ notStrictlyEqual(
2995
+ v,
2996
+ theNumberSeven,
2997
+ ),
2998
+ and(
2999
+ logicalNot(
3000
+ isUndefined(
3001
+ v,
3002
+ ),
3003
+ ),
3004
+ and(
3005
+ logicalNot(
3006
+ isNull(
3007
+ v,
3008
+ ),
3009
+ ),
3010
+ and(
3011
+ logicalNot(
3012
+ isNil(
3013
+ v,
3014
+ ),
3015
+ ),
3016
+ and(
3017
+ isUnnull(
3018
+ v,
3019
+ ),
3020
+ and(
3021
+ not(
3022
+ isNil,
3023
+ )(
3024
+ v,
3025
+ ),
3026
+ and(
3027
+ logicalNot(
3028
+ isEqual(
3029
+ value,
3030
+ NO,
3031
+ ),
3032
+ ),
3033
+ and(
3034
+ logicalNot(
3035
+ isEqual(
3036
+ value,
3037
+ YES,
3038
+ ),
3039
+ ),
3040
+ and(
3041
+ logicalNot(
3042
+ isEqualTo(
3043
+ value,
3044
+ NO,
3045
+ ),
3046
+ ),
3047
+ and(
3048
+ logicalNot(
3049
+ isEqualTo(
3050
+ value,
3051
+ YES,
3052
+ ),
3053
+ ),
3054
+ and(
3055
+ logicalNot(
3056
+ couldThisCouldItBeTrue(
3057
+ v,
3058
+ ),
3059
+ ),
3060
+ and(
3061
+ logicalNot(
3062
+ isNaN(
3063
+ v,
3064
+ ),
3065
+ ),
3066
+ and(
3067
+ logicalNot(
3068
+ isNegativeInfinity(
3069
+ v,
3070
+ ),
3071
+ ),
3072
+ and(
3073
+ logicalNot(
3074
+ isNegativeZero2(
3075
+ v,
3076
+ ),
3077
+ ),
3078
+ and(
3079
+ logicalNot(
3080
+ is0_2.isNegativeZero(
3081
+ v,
3082
+ ),
3083
+ ),
3084
+ and(
3085
+ logicalNot(
3086
+ isNegativeZero(
3087
+ v,
3088
+ ),
3089
+ ),
3090
+ and(
3091
+ logicalNot(
3092
+ isPositiveZero(
3093
+ v,
3094
+ ),
3095
+ ),
3096
+ and(
3097
+ logicalNot(
3098
+ is0_2.isPositiveZero(
3099
+ v,
3100
+ ),
3101
+ ),
3102
+ and(
3103
+ logicalNot(
3104
+ is0(
3105
+ v,
3106
+ ),
3107
+ ),
3108
+ and(
3109
+ logicalNot(
3110
+ is0_2.isZero(
3111
+ v,
3112
+ ),
3113
+ ),
3114
+ and(
3115
+ logicalNot(
3116
+ zerosurgeIsZero(
3117
+ v,
3118
+ loggingEnabled,
3119
+ ),
3120
+ ),
3121
+ and(
3122
+ logicalNot(
3123
+ is1(
3124
+ v,
3125
+ ),
3126
+ ),
3127
+ and(
3128
+ logicalNot(
3129
+ isTwo(
3130
+ v,
3131
+ ),
3132
+ ),
3133
+ and(
3134
+ logicalNot(
3135
+ isThree(
3136
+ v,
3137
+ ),
3138
+ ),
3139
+ and(
3140
+ logicalNot(
3141
+ isFour(
3142
+ v,
3143
+ ),
3144
+ ),
3145
+ and(
3146
+ logicalNot(
3147
+ isFive(
3148
+ v,
3149
+ ),
3150
+ ),
3151
+ and(
3152
+ logicalNot(
3153
+ isSix(
3154
+ v,
3155
+ ),
3156
+ ),
3157
+ and(
3158
+ logicalNot(
3159
+ isSeven(
3160
+ v,
3161
+ ),
3162
+ ),
3163
+ and(
3164
+ logicalNot(
3165
+ eightToolkit.isEight(
3166
+ v,
3167
+ ),
3168
+ ),
3169
+ and(
3170
+ logicalNot(
3171
+ is(
3172
+ v,
3173
+ ).thirteen(),
3174
+ ),
3175
+ and(
3176
+ logicalNot(
3177
+ isHundred(
3178
+ v,
3179
+ ),
3180
+ ),
3181
+ and(
3182
+ logicalNot(
3183
+ isThousand(
3184
+ v,
3185
+ ),
3186
+ ),
3187
+ and(
3188
+ logicalNot(
3189
+ isTenThousand(
3190
+ v,
3191
+ ),
3192
+ ),
3193
+ and(
3194
+ logicalNot(
3195
+ isEqTenThousand(
3196
+ v,
3197
+ ),
3198
+ ),
3199
+ and(
3200
+ logicalNot(
3201
+ isNumber(
3202
+ v,
3203
+ ),
3204
+ ),
3205
+ and(
3206
+ logicalNot(
3207
+ isActualNumber(
3208
+ v,
3209
+ ),
3210
+ ),
3211
+ and(
3212
+ logicalNot(
3213
+ isIsOdd(
3214
+ v,
3215
+ ),
3216
+ ),
3217
+ and(
3218
+ logicalNot(
3219
+ isOd(
3220
+ v,
3221
+ ),
3222
+ ),
3223
+ and(
3224
+ notStrictlyEqual(
3225
+ v,
3226
+ t(),
3227
+ ),
3228
+ and(
3229
+ notStrictlyEqual(
3230
+ v,
3231
+ tVal,
3232
+ ),
3233
+ and(
3234
+ notStrictlyEqual(
3235
+ v,
3236
+ trueValue,
3237
+ ),
3238
+ and(
3239
+ util.isDeepStrictEqual(
3240
+ v,
3241
+ _f(),
3242
+ ),
3243
+ and(
3244
+ isEqualTo(
3245
+ v,
3246
+ _f(),
3247
+ ),
3248
+ and(
3249
+ isEqual(
3250
+ v,
3251
+ _f(),
3252
+ ),
3253
+ and(
3254
+ _.isEqual(
3255
+ v,
3256
+ _f(),
3257
+ ),
3258
+ and(
3259
+ underscore.isEqual(
3260
+ v,
3261
+ _f(),
3262
+ ),
3263
+ and(
3264
+ strictlyEqual(
3265
+ v,
3266
+ _f(),
3267
+ ),
3268
+ and(
3269
+ strictlyEqual(
3270
+ v,
3271
+ FALSE,
3272
+ ),
3273
+ couldThisCouldItBeFalse(
3274
+ v,
3275
+ ),
3276
+ ),
3277
+ ),
3278
+ ),
3279
+ ),
3280
+ ),
3281
+ ),
3282
+ ),
3283
+ ),
3284
+ ),
3285
+ ),
3286
+ ),
3287
+ ),
3288
+ ),
3289
+ ),
3290
+ ),
3291
+ ),
3292
+ ),
3293
+ ),
3294
+ ),
3295
+ ),
3296
+ ),
3297
+ ),
3298
+ ),
3299
+ ),
3300
+ ),
3301
+ ),
3302
+ ),
3303
+ ),
3304
+ ),
3305
+ ),
3306
+ ),
3307
+ ),
3308
+ ),
3309
+ ),
3310
+ ),
3311
+ ),
3312
+ ),
3313
+ ),
3314
+ ),
3315
+ ),
3316
+ ),
3317
+ ),
3318
+ ),
3319
+ ),
3320
+ ),
3321
+ ),
3322
+ ),
3323
+ ),
3324
+ ),
3325
+ ),
3326
+ ),
3327
+ ),
3328
+ ),
3329
+ ),
3330
+ ),
3331
+ ),
3332
+ ),
3333
+ ),
3334
+ ),
3335
+ ),
3336
+ ),
3337
+ ),
3338
+ ),
3339
+ ),
3340
+ ),
3341
+ ),
3342
+ ),
3343
+ ),
3344
+ ),
3345
+ ),
3346
+ ),
3347
+ ),
3348
+ ),
3349
+ ),
3350
+ ),
3351
+ ),
3352
+ ),
3353
+ )
2918
3354
 
2919
3355
  return cond
2920
3356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@falsejs/falsejs",
3
- "version": "4.1.8",
3
+ "version": "4.1.10",
4
4
  "description": "Returns false.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,11 +18,13 @@
18
18
  "@10xly/strict-equals": "^1.0.0",
19
19
  "@ahsm/noop": "^1.0.0",
20
20
  "@colors/colors": "^1.6.0",
21
+ "@extremejs/utils": "^1.0.0-beta.22",
21
22
  "@falsejs/is-true-helper": "^1.0.2",
23
+ "@falsejs/validation-failed-to-pass-error": "github:10xly/FalseJS-FalseJSValidationFailedToPassError",
22
24
  "@identity-js/identity": "^1.2.13",
23
25
  "@is-(unknown)/is-nil": "^1.2.0",
24
26
  "@is-(unknown)/is-null": "^1.2.2",
25
- "@is-(unknown)/is-undefined": "^1.2.0",
27
+ "@is-(unknown)/is-undefined": "^1.3.2",
26
28
  "@kgryte/noop": "^1.0.0",
27
29
  "@not-js/not": "^1.1.0",
28
30
  "@onesneakymofo/the-number-seven": "^1.1.0",
@@ -50,7 +52,6 @@
50
52
  "attempt-statement": "^1.1.0",
51
53
  "axios": "^1.7.7",
52
54
  "blank-space": "^0.0.1",
53
- "bluebird": "^3.7.2",
54
55
  "brototype": "^0.0.6",
55
56
  "chalk4096": "^1.0.1",
56
57
  "cheerio": "^1.0.0",
@@ -72,6 +73,7 @@
72
73
  "es-logical-and-operator": "^1.0.0",
73
74
  "es-logical-not-operator": "^1.0.0",
74
75
  "es-logical-or-operator": "^1.0.0",
76
+ "es-typeof": "^1.0.0",
75
77
  "es2015-noop": "^1.0.0",
76
78
  "examplebyraji": "^1.0.0",
77
79
  "exit": "^0.1.2",
@@ -98,6 +100,7 @@
98
100
  "infinoop": "^222.444.888",
99
101
  "integer-value-positive-zero": "^1.0.1",
100
102
  "is_number_odd": "^1.0.1",
103
+ "is-a-promise": "^0.1.0",
101
104
  "is-actual-number": "^1.0.2",
102
105
  "is-april": "^1.0.3",
103
106
  "is-april-fools": "^1.1.0",
@@ -257,6 +260,8 @@
257
260
  "utf8-byte-length": "^1.0.5",
258
261
  "uuid": "^10.0.0",
259
262
  "uwuifier": "^4.2.2",
263
+ "validate.io-greater-than": "^1.0.2",
264
+ "validate.io-less-than": "^1.0.2",
260
265
  "value-nine": "^9.0.0",
261
266
  "vanilla-javascript": "^1.1.6",
262
267
  "vapor-js-npm": "^1.4.6",