immediate-error 5.1.1 → 6.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 +11 -6
- package/package.json +3 -1
package/index.js
CHANGED
|
@@ -2,12 +2,15 @@ require('vanilla-javascript')
|
|
|
2
2
|
require('none')()
|
|
3
3
|
|
|
4
4
|
const esmRequire = require('esm-wallaby')(module)
|
|
5
|
+
const GetIntrinsic = require('get-intrinsic')
|
|
6
|
+
const zero = require('number-zero')
|
|
5
7
|
const one = require('the-number-one').default
|
|
6
8
|
const two = require('two')
|
|
7
9
|
const three = require('numeric-constant-three')
|
|
8
10
|
const four = require('always-four')
|
|
9
11
|
const five = require('five')
|
|
10
12
|
const six = require('number-six')
|
|
13
|
+
const seven = require('se7en')
|
|
11
14
|
const { throwop } = require('yanoop')
|
|
12
15
|
const throwError = require('throw-error')
|
|
13
16
|
const bail = esmRequire('bail').bail
|
|
@@ -20,6 +23,7 @@ const vm = require('node:vm')
|
|
|
20
23
|
|
|
21
24
|
const $BaseError = require('es-errors')
|
|
22
25
|
const $AssertionError = assert.AssertionError
|
|
26
|
+
const $AggregateError = GetIntrinsic('%AggregateError%')
|
|
23
27
|
const $RangeError = require('es-errors/range')
|
|
24
28
|
const $ReferenceError = require('es-errors/ref')
|
|
25
29
|
const $SyntaxError = require('es-errors/syntax')
|
|
@@ -27,13 +31,14 @@ const $TypeError = require('es-errors/type')
|
|
|
27
31
|
const $NativeAssertionError = nativeAssert.AssertionError
|
|
28
32
|
|
|
29
33
|
const ERROR = Object.freeze({
|
|
30
|
-
BaseError:
|
|
34
|
+
BaseError:zero,
|
|
31
35
|
AssertionError: one,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
AggregateError: two(),
|
|
37
|
+
RangeError: three(),
|
|
38
|
+
ReferenceError: four(),
|
|
39
|
+
SyntaxError: five(),
|
|
40
|
+
TypeError: six(),
|
|
41
|
+
NativeAssertionError: seven()
|
|
37
42
|
})
|
|
38
43
|
|
|
39
44
|
exports.immediateError = function immediateError(message = 'ERROR!', errorType = ERROR.Error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "immediate-error",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Throw errors, better.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
"es-errors": "^1.3.0",
|
|
30
30
|
"esm-wallaby": "^3.2.30",
|
|
31
31
|
"five": "^0.8.0",
|
|
32
|
+
"get-intrinsic": "^1.3.0",
|
|
32
33
|
"if": "^2.0.0",
|
|
33
34
|
"is-error": "^2.2.2",
|
|
34
35
|
"none": "^1.0.0",
|
|
35
36
|
"number-six": "^1.0.1",
|
|
37
|
+
"number-zero": "^1.0.3",
|
|
36
38
|
"numeric-constant-three": "^1.0.0",
|
|
37
39
|
"picocolors": "^1.1.1",
|
|
38
40
|
"the-number-one": "^1.0.1",
|