eslint-plugin-json-light
Version:
Light ESLint plugin for JSON validating
13 lines (12 loc) • 352 B
JavaScript
module.exports = class ExtendableError extends Error {
constructor(message, hash) {
super(message);
this.name = this.constructor.name;
this.hash = hash;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error(message)).stack;
}
}
};