set-error-class
Advanced tools
| type NormalizeError<ErrorArg> = ErrorArg extends Error ? ErrorArg : Error | ||
| /** | ||
| * | ||
| * @example | ||
| * ```js | ||
| * ``` | ||
| */ | ||
| export default function setErrorClass<ErrorArg>( | ||
| error: ErrorArg, | ||
| ErrorClass: Function, | ||
| currentName?: string, | ||
| ): NormalizeError<ErrorArg> |
+11
-7
| { | ||
| "name": "set-error-class", | ||
| "version": "1.2.1", | ||
| "version": "1.3.0", | ||
| "type": "module", | ||
| "exports": "./build/src/main.js", | ||
| "exports": { | ||
| "types": "./build/types/main.d.ts", | ||
| "default": "./build/src/main.js" | ||
| }, | ||
| "main": "./build/src/main.js", | ||
| "types": "./build/src/main.d.ts", | ||
| "types": "./build/types/main.d.ts", | ||
| "files": [ | ||
| "build/src/**/*.{js,d.ts,json}" | ||
| "build/src/**/*.{js,json}", | ||
| "build/types/**/*.d.ts" | ||
| ], | ||
@@ -28,7 +32,7 @@ "scripts": { | ||
| "dependencies": { | ||
| "normalize-exception": "^2.8.1" | ||
| "normalize-exception": "^2.10.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@ehmicky/dev-tasks": "^1.0.94", | ||
| "test-each": "^5.4.1" | ||
| "@ehmicky/dev-tasks": "^1.0.99", | ||
| "test-each": "^5.5.0" | ||
| }, | ||
@@ -35,0 +39,0 @@ "engines": { |
+9
-6
@@ -1,6 +0,8 @@ | ||
| [](https://codecov.io/gh/ehmicky/set-error-class) | ||
| [](/src/main.d.ts) | ||
| [](https://www.npmjs.com/package/set-error-class) | ||
| [](https://twitter.com/intent/follow?screen_name=ehmicky) | ||
| [](https://medium.com/@ehmicky) | ||
| [](https://www.npmjs.com/package/set-error-class) | ||
| [](https://unpkg.com/set-error-class?module) | ||
| [](/types/main.d.ts) | ||
| [](https://codecov.io/gh/ehmicky/set-error-class) | ||
| [](https://bundlephobia.com/package/set-error-class) | ||
| [](https://twitter.com/intent/follow?screen_name=ehmicky) | ||
| [](https://medium.com/@ehmicky) | ||
@@ -41,3 +43,4 @@ Properly update an error's class. | ||
| This package is an ES module and must be loaded using | ||
| This package works in both Node.js >=14.18.0 and browsers. It is an ES module | ||
| and must be loaded using | ||
| [an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), | ||
@@ -44,0 +47,0 @@ not `require()`. |
| type NormalizeError<ErrorArg> = ErrorArg extends Error ? ErrorArg : Error | ||
| /** | ||
| * | ||
| * @example | ||
| * ```js | ||
| * ``` | ||
| */ | ||
| export default function setErrorClass<ErrorArg>( | ||
| error: ErrorArg, | ||
| ErrorClass: Function, | ||
| currentName?: string, | ||
| ): NormalizeError<ErrorArg> |
12990
3.48%139
2.21%Updated