Skip to content

Commit

Permalink
fix type checking vul in ctorName
Browse files Browse the repository at this point in the history
  • Loading branch information
qCVE committed Dec 30, 2019
1 parent 4da96c0 commit 975c13a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
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 975c13a

Please sign in to comment.