Comparing version 3.0.1 to 3.0.2
17
index.js
@@ -9,3 +9,18 @@ 'use strict' | ||
catch (e) { | ||
throw e.message ? e.message : e | ||
/** | ||
* Node.js's assert does not allow passing of Error Objects any more | ||
* | ||
* See: https://git.io/vQcv7 | ||
* As of Node 8, when `assert` fails, it throws a new AssertionError. | ||
* Thus, if you pass an Error object to a call to `assert` it will ignore | ||
* it. | ||
* | ||
* In order to throw custom errors, we refer to the original | ||
* arguments passed into avow. | ||
* | ||
* This will also work for Node 7 and under. | ||
*/ | ||
const lastArg = args[args.length - 1] | ||
if (lastArg instanceof Error) throw lastArg | ||
throw e | ||
} | ||
@@ -12,0 +27,0 @@ } |
{ | ||
"name": "avow", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Proxy for assert that accepts custom Errors", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
3930
33