🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

whoops

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whoops - npm Package Compare versions

Comparing version

to
5.0.1

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/Kikobeats/whoops",
"version": "5.0.0",
"version": "5.0.1",
"main": "src/index.js",

@@ -8,0 +8,0 @@ "author": {

@@ -14,2 +14,3 @@ # whoops

- Attach extra information, being flexible with whatever user case.
- Less than 50 lines (~500 bytes)

@@ -16,0 +17,0 @@ This library is a compromise to provide a clean API for use `Error` native class.

@@ -8,8 +8,9 @@ 'use strict'

super(raw)
const { message, ...props } = typeof raw === 'string' ? { message: raw } : raw
const mergedProps = Object.assign({}, defaults, props)
Object.keys(mergedProps).forEach(key => (this[key] = mergedProps[key]))
if (message) this.description = typeof message === 'function' ? message(this) : message
const { message, ...props } = Object.assign(
{},
defaults,
typeof raw === 'string' ? { message: raw } : raw
)
Object.keys(props).forEach(key => (this[key] = props[key]))
if (message) this.description = typeof message === 'function' ? message(props) : message
this.message = this.code ? `${this.code}, ${this.description}` : this.description

@@ -16,0 +17,0 @@ this.name = name || ErrorClass.name