@ganintegrity/gan-error
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -31,7 +31,3 @@ class GanError extends Error { | ||
} else if (data) { | ||
Object.keys(data).forEach(key => { | ||
if (this[key] === undefined) { | ||
this[key] = data[key]; | ||
} | ||
}); | ||
this.data = data; | ||
} | ||
@@ -38,0 +34,0 @@ } |
{ | ||
"name": "@ganintegrity/gan-error", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "an extendable ES6 Error with support for HTTP errors", | ||
@@ -23,2 +23,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@semantic-release/changelog": "^2.0.0", | ||
"@semantic-release/git": "^4.0.0", | ||
"coveralls": "^3.0.0", | ||
@@ -30,2 +32,3 @@ "eslint": "^4.18.1", | ||
"prettier": "^1.11.0", | ||
"semantic-release": "^15.0.2", | ||
"unexpected": "^10.37.2" | ||
@@ -32,0 +35,0 @@ }, |
@@ -7,2 +7,3 @@ # @ganintegrity/gan-error | ||
[![dependency status](https://david-dm.org/ganintegrity/gan-error.svg)](https://david-dm.org/ganintegrity/gan-error) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/ganintegrity/gan-error.svg)](https://greenkeeper.io/) | ||
@@ -9,0 +10,0 @@ > an extendable ES6 [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |
@@ -61,7 +61,7 @@ const expect = require('unexpected').clone(); | ||
it('assigns all other items in the object to the error', () => { | ||
it('stores the object as `data`', () => { | ||
expect( | ||
new GanError({ message: 'foo', foo: 'foo', bar: {} }), | ||
'to satisfy', | ||
{ message: 'foo', foo: 'foo', bar: {} } | ||
{ data: { message: 'foo', foo: 'foo', bar: {} } } | ||
); | ||
@@ -68,0 +68,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
12723
17
212
94
10
1