rest-api-errors
Advanced tools
+9
-11
@@ -11,15 +11,13 @@ const {apiErrors} = require('./errors') | ||
| apiErrors.reduce((map, [name, status]) => { | ||
| module.exports = { | ||
| ...apiErrors.reduce((map, [name, status]) => { | ||
| map[`Http${status}Error`] = map[`${name}Error`] = map[name] = class extends APIError { | ||
| constructor(code, message) { | ||
| super(status, code, message); | ||
| } | ||
| }; | ||
| return map; | ||
| }, {}); | ||
| module.exports = { | ||
| ...apiErrors, | ||
| map[`Http${status}Error`] = map[`${name}Error`] = map[name] = class extends APIError { | ||
| constructor(code, message) { | ||
| super(status, code, message); | ||
| } | ||
| }; | ||
| return map; | ||
| }, {}), | ||
| APIError | ||
| }; |
+1
-1
| { | ||
| "name": "rest-api-errors", | ||
| "version": "1.3.0", | ||
| "version": "1.3.1", | ||
| "description": "Common errors that can be thrown to simplify promise based api implementations", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
54354
0.03%0
-100%1917
-0.05%