Skip to content

Commit

Permalink
Merge pull request #31 from xiaofen9/master
Browse files Browse the repository at this point in the history
fix type checking vul in ctorName
  • Loading branch information
doowb committed Jan 16, 2020
2 parents 4da96c0 + 975c13a commit 1df992c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -66,7 +66,7 @@ module.exports = function kindOf(val) {
};

function ctorName(val) {
return val.constructor ? val.constructor.name : null;
return val.constructor && typeof val.constructor === 'function' ? val.constructor.name : null;
}

function isArray(val) {
Expand Down

0 comments on commit 1df992c

Please sign in to comment.