Comparing version 0.1.1 to 0.1.2
@@ -54,4 +54,9 @@ /* Copyright (c) 2014 Richard Rodger, MIT License */ | ||
code = 'string' === typeof(code) ? code : 'unknown' | ||
details = | ||
('object' === typeof(details)) ? | ||
details : | ||
('object' === typeof(msg) && 'string' !== typeof(msg) ? msg : {}); | ||
msg = msgprefix + ('string' === typeof(msg) ? msg : code) | ||
details = 'object' === typeof(details) ? details : {} | ||
@@ -58,0 +63,0 @@ var e = new Error(msg) |
{ | ||
"name": "eraro", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Create JavaScript Error objects with code strings, context details, and uncluttered stacktraces", | ||
@@ -5,0 +5,0 @@ "main": "eraro.js", |
@@ -45,3 +45,3 @@ eraro | ||
Current Version: 0.1.1 | ||
Current Version: 0.1.2 | ||
@@ -48,0 +48,0 @@ Tested on: node 0.10.26 |
@@ -24,3 +24,3 @@ /* Copyright (c) 2014 Richard Rodger, MIT License */ | ||
var e2 = eraro('c2',{a:2}) | ||
assert.equal("{ [Error: foo: c2] foo: true, package: 'foo', code: 'c2', details: {} }",util.inspect(e2)) | ||
assert.equal("{ [Error: foo: c2] foo: true, package: 'foo', code: 'c2', details: { a: 2 } }",util.inspect(e2)) | ||
@@ -27,0 +27,0 @@ |
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
5543
69