diff --git a/src/validator.js b/src/validator.js index 86ba5d6..1e08973 100644 --- a/src/validator.js +++ b/src/validator.js @@ -206,9 +206,11 @@ function isType(type, item, nullAllowed = false) { if (Array === type && Array.isArray(item)) return true - return some(TYPES, + if (some(TYPES, (TYPE, key) => (TYPE === type && typeof item === key) // eslint-disable-line valid-typeof - ) + )) return true + + return item instanceof type } function ensureOne(items) {