error-class
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -18,7 +18,6 @@ // Memoize these results, they're basically invariants. | ||
error.prototype = Object.create(Error.prototype, { | ||
constructor: nonEnumerableProperty(error) | ||
constructor: nonEnumerableProperty(error), | ||
name: nonEnumerableProperty(name) | ||
}) | ||
error.prototype.name = name | ||
if (hasSetPrototypeOf) Object.setPrototypeOf(error, Error) | ||
@@ -25,0 +24,0 @@ else error.__proto__ = Error |
{ | ||
"name": "error-class", | ||
"description": "Typed errors that closely emulate the native Error class.", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -35,3 +35,5 @@ # Error Class | ||
Object.keys(thirstyError).length === 0 // True, all properties are non-enumerable. | ||
Object.keys(Object.getPrototypeOf(instance)).length === 0 // Prototype non-enumerable. | ||
thirstyError.constructor === HumanError // True. | ||
thirstyError.constructor.name === 'HumanError' // True. | ||
thirstyError instanceof Error // True, errors inherit from native `Error` class. | ||
@@ -38,0 +40,0 @@ thirstyError instanceof HumanError // Also true, of course. |
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
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
5074
46