immediate-error 6.0.0 → 6.1.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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/index.d.ts +7 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,8 @@ immediateError('Aaaaah') // this will throw a regular Error with the message "Aa
12
12
 
13
13
  immediateError('Aaaaah', ErrorType.BaseError) // does the same thing as above
14
14
 
15
+ immediateError('Aggregate error', ErrorType.AggregateError) // throws an AggregateError
16
+
15
17
  immediateError('Assertion error', ErrorType.AssertionError) // throws an AssertionError (from the assert-fn module)
16
18
 
17
19
  immediateError('Assertion error', ErrorType.NativeAssertionError) // throws an AssertionError (from the node:assert module)
package/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  export enum ErrorType {
2
2
  BaseError = 0,
3
- AssertionError = 1,
4
- RangeError = 2,
5
- ReferenceError = 3,
6
- SyntaxError = 4,
7
- TypeError = 5,
8
- NativeAssertionError = 6
3
+ AggregateError = 1,
4
+ AssertionError = 2,
5
+ RangeError = 3,
6
+ ReferenceError = 4,
7
+ SyntaxError = 5,
8
+ TypeError = 6,
9
+ NativeAssertionError = 7
9
10
  }
10
11
 
11
12
  export function immediateError(message?: string, errorType?: ErrorType | Function): void
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "immediate-error",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Throw errors, better.",
5
5
  "main": "index.js",
6
6
  "scripts": {