Skip to content

Commit

Permalink
5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jun 21, 2017
1 parent 1f3d068 commit d6e5138
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
48 changes: 23 additions & 25 deletions browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.index = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var isBuffer = require('is-buffer');
var toString = Object.prototype.toString;

/**
Expand All @@ -10,8 +9,10 @@ var toString = Object.prototype.toString;
*/

module.exports = function kindOf(val) {
var type = typeof val;

// primitivies
if (typeof val === 'undefined') {
if (type === 'undefined') {
return 'undefined';
}
if (val === null) {
Expand All @@ -20,15 +21,18 @@ module.exports = function kindOf(val) {
if (val === true || val === false || val instanceof Boolean) {
return 'boolean';
}
if (typeof val === 'string' || val instanceof String) {
if (type === 'string' || val instanceof String) {
return 'string';
}
if (typeof val === 'number' || val instanceof Number) {
if (type === 'number' || val instanceof Number) {
return 'number';
}

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

Expand All @@ -46,7 +50,7 @@ module.exports = function kindOf(val) {
}

// other objects
var type = toString.call(val);
type = toString.call(val);

if (type === '[object RegExp]') {
return 'regexp';
Expand Down Expand Up @@ -85,6 +89,12 @@ module.exports = function kindOf(val) {
if (type === '[object Symbol]') {
return 'symbol';
}
if (type === '[object Map Iterator]') {
return 'mapiterator';
}
if (type === '[object Set Iterator]') {
return 'setiterator';
}

// typed arrays
if (type === '[object Int8Array]') {
Expand Down Expand Up @@ -119,27 +129,15 @@ module.exports = function kindOf(val) {
return 'object';
};

},{"is-buffer":2}],2:[function(require,module,exports){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <[email protected]> <http:https://feross.org>
* @license MIT
/**
* If you need to support Safari 5-7 (8-10 yr-old browser),
* take a look at https://github.com/feross/is-buffer
*/

// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}

function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}

// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
function isBuffer(val) {
return val.constructor
&& typeof val.constructor.isBuffer === 'function'
&& val.constructor.isBuffer(val);
}

},{}]},{},[1])(1)
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": "4.0.0",
"version": "5.0.0",
"homepage": "https://github.com/jonschlinkert/kind-of",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
Expand Down

0 comments on commit d6e5138

Please sign in to comment.