Skip to content

Commit 1df992c

Browse files
authored
Merge pull request #31 from xiaofen9/master
fix type checking vul in ctorName
2 parents 4da96c0 + 975c13a commit 1df992c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module.exports = function kindOf(val) {
6666
};
6767

6868
function ctorName(val) {
69-
return val.constructor ? val.constructor.name : null;
69+
return val.constructor && typeof val.constructor === 'function' ? val.constructor.name : null;
7070
}
7171

7272
function isArray(val) {

0 commit comments

Comments
 (0)