@falsejs/falsejs 1.0.2 → 1.0.67

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 (2) hide show
  1. package/index.js +50 -89
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,51 +1,48 @@
1
1
  /**
2
- * FalseJS
3
- * The ultimate library for getting the value of false.
4
- * I didn't choose the 10x life. The 10x life chose me.
5
- * @author tj-commits
6
- * @license MIT
7
- * @version whatever_the_version_in_the_package.json_is
8
- */ /*
9
-
10
- ███████████████████████████████████████████████████████████████████████████████████
11
-
12
-
13
- sanity
14
-
15
- ███████████████████████████████████████████████████████████████████████████████████ */
16
-
17
- // #region IMPORTANT CHECKS
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
+ */
8
+
9
+ /** Here we check whether require is working. */
18
10
  let doesItWork
19
11
  try {
20
12
  doesItWork = require("is-require-working")
21
- } catch (e) {
22
- doesItWork = !e
13
+ } catch {
14
+ doesItWork = false
23
15
  }
24
16
 
25
17
  if (!doesItWork) {
26
- //o crap
18
+ /** Simple error handler to exit node if require is not working */
19
+ /** COMMENT: It doesn't use immediate-error because we can't require immediate-error if require isn't working. */
27
20
  throw new Error("require not working, exiting node")
28
21
  } else {
29
22
  const isComputerOn = require("is-computer-on")
30
23
  const isComputerOff = require("is-computer-off")
31
24
 
25
+ /** Make sure that the computer is on */
32
26
  if (!isComputerOn() || isComputerOff()) {
27
+ /** Simple error handler to exit node if the computer is not on. */
28
+ /** COMMENT: It doesn't use immediate-error because we should only require general-use libraries after critical checks. */
33
29
  throw new Error(
34
30
  "no point doing anything if computer is not on, exiting node"
35
31
  )
36
32
  } else {
37
33
  const isComputerOnFire = require("is-computer-on-fire").isComputerOnFire
38
34
  if (isComputerOnFire()) {
35
+ /** 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. */
39
36
  throw new Error(
40
37
  "OH MY GOSH YOUR COMPUTER IS ON FIRE WHY ARE YOU WASTING TIME USING A JOKE POINTLESS NPM PACKAGE GET YOUR FIRE EXTINGUISHER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
41
38
  )
42
39
  } else {
43
40
  const isNodeRunning = require("node-script-running")
44
41
  if (!isNodeRunning()) {
45
- // there's no point doing anything if node is not running
42
+ /** There is no point doing anything if node is not running. Therefore, do nothing.
43
+ There's no point throwing an error because it wont do anything. */
46
44
  } else {
47
- //#endregion IMPORTANT CHECKS
48
- // #region BEGINNING REQUIRES
45
+ /** The below requires are very important. Some of them optimize the code, and some are useful libraries like get-member. */
49
46
  require("vanilla-javascript") // * because we are making something awesome!
50
47
  require("vapor-js-npm") // the most awesome and flexible javascript framework
51
48
  require("none")() // this improves load times and performance
@@ -58,19 +55,24 @@ if (!doesItWork) {
58
55
  require("console.dog") // bark
59
56
  require("user")() // idk why this has so many downloads
60
57
  require("ecto1")() // the most advanced thing ever
61
- // #endregion BEGINNING REQUIRES
62
- // #region FACTORY CODE
58
+
63
59
  var jQuery = global.jQuery // have to define it as a variable so ESLint doesn't yell at me
64
60
  ;(function (factory) {
65
- // Export everything
61
+ /** Export everything. */
66
62
  module.exports.default = factory(jQuery)
67
63
  })(function ($) {
64
+ /** Use strict mode. Instead of sloppy mode */
68
65
  "use strict"
69
- //#endregion FACTORY CODE
70
- //* MODULE IMPORTS
71
- // #region MODULE IMPORTS
66
+
67
+ // SIX SEVEN
68
+
69
+
70
+ /** A holder for some variables. */
71
+ const variableHolder = {}
72
+
73
+ /** Below are some requires and module imports. */
74
+
72
75
  const GetIntrinsic = require("get-intrinsic") // cache our intrinsics
73
- const variableHolder = {} // store our variables
74
76
  const _ = require("lodash") // every project needs lodash
75
77
  const underscore = require("underscore") // underscore.js. the predecessor of lodash.
76
78
  const React = require("react") // the hype framework everyone uses for some reason
@@ -152,8 +154,8 @@ if (!doesItWork) {
152
154
  const isNumber = require("is-number") // jonschlinkert
153
155
  const isActualNumber = require("is-actual-number") // my is-number
154
156
  const isIsOdd = require("is-is-odd") // isIsOdd
155
- const isOdd = require("is-odd") //isOdd
156
- const isOd = require("is-od") // isOd
157
+ const isOdd = require("is-odd") // why does everyone think this is the dumbest package ever. its not
158
+ const isOd = require("is-od") // forget a d
157
159
  const isOddAndrew = require("is-odd-andrew") // isOddAndrew
158
160
  const isOddNum = require("is-odd-num") // another odd checker
159
161
  const isIntegerOdd = require("is-integer-odd") // another!!!!
@@ -185,9 +187,8 @@ if (!doesItWork) {
185
187
  const construct = require("construct-new") // better than the new keyword
186
188
  const $Promise = require("bluebird") // promise ponyfill cuz why not
187
189
 
188
- //#endregion MODULE IMPORTS
189
- //#region INTRINSICS
190
- // * INTRINSICS
190
+
191
+ /** Some intrinsics cacbed from get-intrinsic. */
191
192
 
192
193
  const $Array = GetIntrinsic('%Array%') // arary
193
194
  const $Boolean = GetIntrinsic("%Boolean%") // blooean
@@ -198,9 +199,9 @@ if (!doesItWork) {
198
199
  const PI = GetIntrinsic("%Math.PI%") // ip
199
200
  const MathAbs = GetIntrinsic("%Math.abs%") // asb
200
201
  const StringCharAt = GetIntrinsic("%String.prototype.charAt%") // chraAt
201
- //#endregion INTRINSICS
202
202
 
203
- //#region MORE MODULE IMPORTS
203
+ /** Below are some MORE module imports and requires. */
204
+
204
205
  const _calculateFalseAprilFools = require("./aprilFoolsCalculateFalse") // april fools
205
206
  const couldThisCouldItBeTrue = require("@falsejs/is-true-helper") // check if a value is true
206
207
  const {
@@ -221,20 +222,20 @@ if (!doesItWork) {
221
222
  const isDecember = require("is-december") // month 12
222
223
  const isMonday = require("is-monday") // day of the week 1 according to international standard, day of the week 2 according to the us
223
224
  const isTuesday = require("is-tuesday") // day of the week 2 according to international standard, day of the week 3 according to the us
224
- const isWednesday = () => require('is-wednesday')(Today) // day of the week 3 according to the international standard, day of the week 4 according to the us
225
+ 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
225
226
  // now we gotta sing rebecca black's song
226
227
  const isThursday = require("is-thursday") /// Yesterday was thursdayyyy
227
228
  const isFriday = require("is-friday") // tooo-ddadayy is friday! we so ecited
228
229
  const isSaturday = require("is-saturday") // tomorrow will be saturday
229
230
  const isSunday = require("is-sunday") // and sunday comes after
230
231
  const isWeekend = require("is-weekend") // looking forward to the weeeeekeend
231
-
232
232
  const zr0 = require("integer-value-positive-zero") // get the number zero 1
233
233
  const {
234
234
  returnZero,
235
235
  ZeroCalculationMethod,
236
236
  isZero: zerosurgeIsZero
237
237
  } = require("zerosurge") // get the number zero 2
238
+ /** LETS GET SOME NUMBERS */
238
239
  const one = require("the-number-one").default // get the number one
239
240
  const Two = require("two") // get number 2
240
241
  const three = require("numeric-constant-three") // get number 3
@@ -342,30 +343,22 @@ if (!doesItWork) {
342
343
  const throwError = require("throw-error") // throw errors
343
344
  const hello = require("hello-vga-function").default // hello vga function
344
345
  const greet = require("hell0-world") // greet our guys
345
- //#endregion MORE MODULE IMPORTS
346
-
347
- // *number formatter
348
- // #region Number Formatter
349
346
 
347
+ /** Below is a number formatter declaration. */
350
348
  const NumberFormatter = Intl.NumberFormat
351
349
  const numberFormatter = construct({ target: NumberFormatter })
352
- //#endregion Number Formatter
353
-
354
- //#region MKDIR .FALSEJS
355
350
 
356
- // * create .falsejs folder if doesn't already exist
351
+ /** Create .falsejs folder if it doesn't already exist. */
357
352
  tru(not(fs.existsSync)(".falsejs"))
358
353
  .then(() => {
359
354
  fs.mkdirSync(".falsejs")
360
355
  })
361
356
  .end()
362
- //#endregion MKDIR .FALSEJS
363
357
 
364
- // * CONSTANTS
365
- //#region CONSTANTS
358
+ /** Constants */
366
359
  variableHolder._lilmessage = colors.red(
367
360
  `[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.`
368
- )
361
+ ) // an error
369
362
  const my = {
370
363
  cons: {
371
364
  tants: {
@@ -388,7 +381,7 @@ if (!doesItWork) {
388
381
  )
389
382
  .toString(),
390
383
  variableHolder._lilmessage
391
- )
384
+ ) // bro its literally just nonsense just to get the error
392
385
  ? construct({
393
386
  target: $Array,
394
387
  args: [...voidFn.toString().split(voidFn.toString())]
@@ -477,26 +470,24 @@ if (!doesItWork) {
477
470
  TODAY: Today,
478
471
  USERNAME: username
479
472
  } = my.getMember("cons").getMember("tants")
480
- //#endregion CONSTANTS
481
- // *CLASSES
482
- //#region CLASSES
473
+
483
474
  let Logger = class {
484
475
  constructor(enableLogging) {
485
- this.enableLogging = enableLogging
476
+ this.enableLogging = enableLogging // ENABLE THE LOGGING
486
477
  }
487
478
  log(log) {
488
479
  if (isEqualTo(this.enableLogging, t())) {
489
- log instanceof weirdLtc
480
+ log instanceof weirdLtc // SO WERID
490
481
  }
491
482
  }
492
483
  }
493
484
 
494
- let FalseJSValidationFailedToPassError = class extends Error {}
485
+ let FalseJSValidationFailedToPassError = class extends Error { constructor(...stuff) { super(stuff) }} // its literally just an error with a different name
495
486
 
496
487
  let SuccessorHelper = class {
497
488
  s(value) {
498
489
  let result
499
- result = add(value, one)
490
+ result = add(value, one) // add one to it
500
491
  return result
501
492
  }
502
493
  }
@@ -549,10 +540,6 @@ if (!doesItWork) {
549
540
  return this.instance
550
541
  }
551
542
  }
552
- //#endregion CLASSES
553
-
554
- // * creation of classes
555
- //#region creation of classes
556
543
  const trueComparison = construct({
557
544
  target: TernaryCompare,
558
545
  args: [tVal, tVal, not(() => tVal)()]
@@ -565,10 +552,6 @@ if (!doesItWork) {
565
552
  clc = clc_ // setit
566
553
  const uwuifier = construct({ target: Uwuifier })
567
554
  const westPad = construct({ target: WestPad, args: ["N"] })
568
- //#endregion creation of classes
569
-
570
- // * A CHECK
571
- //#region A CHECK
572
555
  // lets make sure jquery-basic-arithmetic-plugin works
573
556
  if (not(() => Bro($).doYouEven("add"))()) {
574
557
  var True_Logger = construct({ target: Logger, args: [t()] })
@@ -645,9 +628,6 @@ if (!doesItWork) {
645
628
  )
646
629
  }
647
630
  }
648
- // #region SETLOGFUNTION INIT
649
-
650
- // * SETLOGFUNTION
651
631
  const surpriseArray = [] // define empty array
652
632
 
653
633
  // set a log function
@@ -678,10 +658,8 @@ if (!doesItWork) {
678
658
  }).compare()
679
659
  )
680
660
  })
681
- //#endregion SETLOGFUNTION INIT
682
661
 
683
662
  //* HELPERS
684
- //#region HELPER FUNCTIONS
685
663
 
686
664
  // define a little helper function
687
665
  /**
@@ -1037,9 +1015,6 @@ if (!doesItWork) {
1037
1015
  )
1038
1016
  }
1039
1017
 
1040
- //#endregion HELPER FUNCTIONS
1041
-
1042
- //#region FALSEJS LOGIC
1043
1018
  // * FALSEJS LOGIC
1044
1019
  // the _getFalse Function
1045
1020
  // :O :O :O
@@ -2561,9 +2536,6 @@ if (!doesItWork) {
2561
2536
  variableHolder._FalseJSMainFunctionWotDoesFunctionality =
2562
2537
  functions.ReturnFalse
2563
2538
 
2564
- //#endregion LOGIC
2565
-
2566
- //#region MORE HELPERS
2567
2539
 
2568
2540
  // * MORE HELPER FUNCTIONS
2569
2541
 
@@ -2948,8 +2920,6 @@ if (!doesItWork) {
2948
2920
  return value.toString()
2949
2921
  }
2950
2922
 
2951
- //#endregion MORE HELPERS
2952
- //#region ISFALSE FUNCTION
2953
2923
  // a function to check if something is false thati s used by the function to check if something is false
2954
2924
  function couldThisCouldItBeFalse(
2955
2925
  aValueThatMightBeTheBooleanValueFalseButIDKYet
@@ -3056,7 +3026,6 @@ if (!doesItWork) {
3056
3026
  return cond
3057
3027
  }
3058
3028
 
3059
- //#region PLUGINS
3060
3029
  variableHolder._FalseJSjQueryPlugin = function jQueryPlugin() {
3061
3030
  // Inject into jQuery
3062
3031
  jQuery.False =
@@ -3075,12 +3044,10 @@ if (!doesItWork) {
3075
3044
  next() // Continue to the next middleware or route
3076
3045
  }
3077
3046
 
3078
- //#endregion PLUGINS
3079
3047
 
3080
3048
  /*exports.Yes = literally(YES)
3081
3049
  exports.No = literally(NO)*/
3082
3050
  // *EVEN MORE HELPERS
3083
- //#region EVEN MORE HELPERS
3084
3051
 
3085
3052
  function getNo() {
3086
3053
  const NO = require("no/dist/main")
@@ -3126,11 +3093,6 @@ if (!doesItWork) {
3126
3093
  }
3127
3094
  return randomCharacter
3128
3095
  }
3129
-
3130
- //#endregion EVEN MORE HELPERS
3131
-
3132
- //#region RETURN FALSEJS
3133
-
3134
3096
  class falsejs {
3135
3097
  static False =
3136
3098
  variableHolder._FalseJSMainFunctionWotDoesFunctionality
@@ -3149,8 +3111,7 @@ if (!doesItWork) {
3149
3111
 
3150
3112
  return falsejs
3151
3113
  })
3152
- //#endregion RETURN FALSEJS
3153
3114
  }
3154
3115
  }
3155
3116
  }
3156
- }
3117
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@falsejs/falsejs",
3
- "version": "1.0.2",
3
+ "version": "1.0.67",
4
4
  "description": "I want to be sane",
5
5
  "main": "index.js",
6
6
  "scripts": {