Comparing version 5.1.2 to 5.2.0
@@ -395,2 +395,3 @@ 'use strict'; | ||
this.assert(thrown, 'throw an error', err); | ||
return err; | ||
} | ||
@@ -424,2 +425,6 @@ | ||
if (thrown) { | ||
internals.assert(this, arguments.length < 2 || message, 'Can not assert with invalid message argument type'); | ||
internals.assert(this, arguments.length < 1 || message !== null || typeof type === 'function', 'Can not assert with invalid type argument'); | ||
if (type) { | ||
@@ -426,0 +431,0 @@ this.assert(thrown instanceof type, 'reject with ' + (type.name || 'provided type')); |
{ | ||
"name": "code", | ||
"description": "assertion library", | ||
"version": "5.1.2", | ||
"version": "5.2.0", | ||
"repository": "git://github.com/hapijs/code", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
19704
341