Comparing version 0.1.1 to 0.1.2
'use strict'; | ||
function createError(msg, code, props) { | ||
var err = typeof msg === 'string' ? new Error(msg) : msg; | ||
var err = msg instanceof Error ? msg : new Error(msg); | ||
var key; | ||
@@ -6,0 +6,0 @@ |
{ | ||
"name": "err-code", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Create an error with a code", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,2 +40,10 @@ 'use strict'; | ||
}); | ||
it('should create an error object with code and without message', function () { | ||
var err = errcode(null, 'ESOME'); | ||
expect(err).to.be.an(Error); | ||
expect(err.message).to.be('null'); | ||
expect(err.code).to.be('ESOME'); | ||
}); | ||
}); |
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
4746
52