26 lines
475 B
JavaScript
26 lines
475 B
JavaScript
|
/**
|
||
|
* Module dependencies.
|
||
|
*/
|
||
|
|
||
|
var toString = Object.prototype.toString;
|
||
|
|
||
|
/**
|
||
|
* Resolve `isArray` as native or fallback
|
||
|
*/
|
||
|
|
||
|
module.exports = null != Array.isArray
|
||
|
? Array.isArray
|
||
|
: isArray;
|
||
|
|
||
|
/**
|
||
|
* Wrap `Array.isArray` Polyfill for IE9
|
||
|
* source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
||
|
*
|
||
|
* @param {Array} array
|
||
|
* @public
|
||
|
*/
|
||
|
|
||
|
function isArray (array) {
|
||
|
return toString.call(array) === '[object Array]';
|
||
|
};
|