Skip to content

Commit

Permalink
6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Nov 19, 2017
1 parent bbad897 commit 95fe369
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ module.exports = function kindOf(val) {
return isGeneratorFn(val) ? 'generatorfunction' : 'function';
}

if (Array.isArray) {
if (Array.isArray(val)) return 'array';
} else if (val instanceof Array) {
return 'array';
}

if (isArray(val)) return 'array';
if (isBuffer(val)) return 'buffer';
if (isArguments(val)) return 'arguments';
if (isDate(val)) return 'date';
Expand Down Expand Up @@ -75,9 +70,13 @@ function ctorName(val) {
return val.constructor ? val.constructor.name : null;
}

function isArray(val) {
if (Array.isArray) return Array.isArray(val);
return val instanceof Array;
}

function isError(val) {
return typeof val.message === 'string' && val.constructor
&& typeof val.constructor.stackTraceLimit === 'number';
return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');
}

function isDate(val) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kind-of",
"description": "Get the native type of a value.",
"version": "6.0.0",
"version": "6.0.1",
"homepage": "https://github.com/jonschlinkert/kind-of",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
Expand Down

0 comments on commit 95fe369

Please sign in to comment.