@@ -11,2 +11,3 @@ const {toString} = Object.prototype; | ||
return function TypeError(type, val) { | ||
if (type === undefined) throw Error('Type cannot be undefined'); | ||
if (typeof type != 'string') type = ofType(type); | ||
@@ -13,0 +14,0 @@ const err = _TypeError('Expected ' + type + ', got ' + typeOf(val)); |
{ | ||
"name": "type-error", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "aleclarson/type-error", |
@@ -1,2 +0,2 @@ | ||
# type-error v1.0.1 | ||
# type-error v1.0.2 | ||
@@ -3,0 +3,0 @@ Create a native `TypeError` object by passing the expected type and the actual value. |
3143
2.24%30
3.45%