immediate-error 3.1.1 → 3.1.3

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 +2 -0
  2. package/index.js +19 -4
  3. package/package.json +4 -1
package/README.md CHANGED
@@ -22,4 +22,6 @@ immediateError('Syntax error', { errorType: ERROR.SyntaxError }) // throws a syn
22
22
 
23
23
  immediateError('type error', { errorType: ERROR.TypeError }) // throws a typeerror
24
24
 
25
+ immediateError('fucking error', { errorType: ERROR.FuckingError }) // throws a fuckingerror
26
+
25
27
  ```
package/index.js CHANGED
@@ -4,7 +4,10 @@ require('none')()
4
4
 
5
5
  const one = require('the-number-one').default // number one
6
6
  const two = require('two') // no2
7
+ const three = require('numeric-constant-three') //no3
8
+ const four = require('always-four') //no4
7
9
  const five = require('five') //no5
10
+ const six = require('number-six') //no6
8
11
  const successor = require('successor') // + 1
9
12
  global.jQuery = require('jquery')
10
13
  require('jquery-basic-arithmetic-plugin') // why not use jquery for math?
@@ -18,11 +21,19 @@ const ERROR = Object.freeze({
18
21
  Error:0,
19
22
  AssertionError: one,
20
23
  RangeError: two(),
21
- ReferenceError: successor(two()),
22
- SyntaxError: $.subtract(five(), one),
23
- TypeError: five()
24
+ ReferenceError: three(),
25
+ SyntaxError: four(),
26
+ TypeError: five(),
27
+ FuckingError: six()
24
28
  })
25
29
 
30
+ class FuckingError extends Error {
31
+
32
+ constructor(message) {
33
+ super(`FuckingError: Holy shit there was A Fucking Error With A Message: ${message}`)
34
+ }
35
+ }
36
+
26
37
  const assert = require('assert-fn') // import assert
27
38
  const vm = require('node:vm') // vm
28
39
 
@@ -62,6 +73,11 @@ module.exports = function immediateError(message = 'YOU SUCK AT PROGRAMMING THER
62
73
  break
63
74
  }
64
75
 
76
+ case ERROR.FuckingError: {
77
+ error = new FuckingError(message)
78
+ break
79
+ }
80
+
65
81
  default: {
66
82
  error = new Error(message)
67
83
  break
@@ -79,7 +95,6 @@ module.exports = function immediateError(message = 'YOU SUCK AT PROGRAMMING THER
79
95
  }
80
96
  vm.createContext(context) // Contextify the object.
81
97
  const script = new vm.Script(`
82
- console.log(clc.redBright.bold(\`× THERE WAS AN ERROR!\`))
83
98
  If(rand < 0.3).Then(() => {
84
99
  throwError(error)
85
100
  }).Else().If(rand > 0.3).Then(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "immediate-error",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "Immediate-error",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "homepage": "https://github.com/tj-commits/immediate-error#readme",
25
25
  "dependencies": {
26
+ "always-four": "^1.0.0",
26
27
  "assert-fn": "^1.0.1",
27
28
  "cli-color": "^2.0.4",
28
29
  "five": "^0.8.0",
@@ -30,6 +31,8 @@
30
31
  "jquery": "^3.7.1",
31
32
  "jquery-basic-arithmetic-plugin": "^1.1.0",
32
33
  "none": "^1.0.0",
34
+ "number-six": "^1.0.1",
35
+ "numeric-constant-three": "^1.0.0",
33
36
  "successor": "^1.0.1",
34
37
  "the-number-one": "^1.0.1",
35
38
  "throw-error": "^1.0.0",