loose instanceof: check constructor function name instead
This commit is contained in:
parent
ca098490bb
commit
eb4e8884d9
2 changed files with 2 additions and 2 deletions
src
|
@ -26,7 +26,7 @@ module.exports = function enforce(type, value) {
|
|||
}
|
||||
|
||||
default: {
|
||||
if (value instanceof type) return
|
||||
if (value.constructor.toString().match(/function (.*?)\(/)[1] === type.name) return
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue