Skip to content

Commit

Permalink
Merge pull request #14 from struct78/master
Browse files Browse the repository at this point in the history
Added undefined check
  • Loading branch information
jonschlinkert committed Aug 2, 2017
2 parents ca4aa55 + e69a4de commit b827fd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions browser.js
Expand Up @@ -30,7 +30,7 @@ module.exports = function kindOf(val) {

// functions
if (type === 'function' || val instanceof Function) {
if (val.constructor.name.slice(0, 9) === 'Generator') {
if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') {
return 'generatorfunction';
}
return 'function';
Expand Down Expand Up @@ -141,4 +141,4 @@ function isBuffer(val) {
}

},{}]},{},[1])(1)
});
});
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -29,7 +29,7 @@ module.exports = function kindOf(val) {

// functions
if (type === 'function' || val instanceof Function) {
if (val.constructor.name.slice(0, 9) === 'Generator') {
if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') {
return 'generatorfunction';
}
return 'function';
Expand Down

0 comments on commit b827fd5

Please sign in to comment.