Socket
Socket
Sign inDemoInstall

error-class

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-class - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

5

lib/index.js

@@ -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

2

package.json
{
"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.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc