@dvpnt/errors
Advanced tools
Comparing version 2.1.0 to 2.2.0
23
index.js
const _ = require('underscore'); | ||
const defaultMessage = 'Error has occured'; | ||
const defaultMessage = 'Error has occurred'; | ||
const defaultUserMessage = 'Произошла ошибка'; | ||
@@ -91,12 +91,15 @@ | ||
exports.errorsCreator = (obj) => ({name, Parent = ServerError, ...params}) => { | ||
obj[name] = class extends Parent { | ||
constructor(constructorParams) { | ||
super({ | ||
...params, | ||
...constructorParams | ||
}); | ||
} | ||
}; | ||
exports.create = ({Parent = ServerError, ...params}) => class extends Parent { | ||
constructor(constructorParams) { | ||
super({ | ||
...params, | ||
...constructorParams | ||
}); | ||
} | ||
}; | ||
exports.errorsCreator = (obj) => ({name, ...params}) => { | ||
obj[name] = exports.create(params); | ||
Object.defineProperty(obj[name], 'name', { | ||
@@ -103,0 +106,0 @@ value: name, |
{ | ||
"name": "@dvpnt/errors", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "basic errors for node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4675
93
1