Socket
Socket
Sign inDemoInstall

createerror

Package Overview
Dependencies
0
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

12

lib/createError.js

@@ -13,8 +13,10 @@ (function (root, factory) {

for (var i = 1; i < arguments.length; i++) {
var source = arguments[i],
keys = Object.keys(source);
var source = arguments[i];
if (source && typeof source === 'object') {
var keys = Object.keys(source);
for (var j = 0; j < keys.length; j++) {
var name = keys[j];
target[name] = source[name];
for (var j = 0; j < keys.length; j++) {
var name = keys[j];
target[name] = source[name];
}
}

@@ -21,0 +23,0 @@ }

@@ -11,3 +11,3 @@ {

],
"version": "1.0.0",
"version": "1.0.1",
"repository": {

@@ -26,3 +26,3 @@ "type": "git",

"mocha": "2.2.5",
"unexpected": "7.4.2"
"unexpected": "9.2.1"
},

@@ -29,0 +29,0 @@ "publishConfig": {

@@ -16,2 +16,7 @@ var expect = require('unexpected'),

it('should result a constructor that produces instances whose constructor property point at it', function () {
var Err = createError({foo: 'bar'});
expect(new Err().constructor, 'to equal', Err);
});
it('should return a constructor that prefers a message passed as to first argument to the one provided in the options object', function () {

@@ -123,2 +128,7 @@ var Err = createError({message: 'default message'});

});
it('should not break when the constructor options object has a data property with a value of undefined', function () {
var Err = createError();
new Err({data: undefined});
});
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc