13 lines
293 B
JavaScript
13 lines
293 B
JavaScript
|
'use strict';
|
||
|
|
||
|
var isArray = require('async.util.isarray');
|
||
|
|
||
|
module.exports = function isArrayLike(arr) {
|
||
|
return isArray(arr) || (
|
||
|
// has a positive integer length property
|
||
|
typeof arr.length === 'number' &&
|
||
|
arr.length >= 0 &&
|
||
|
arr.length % 1 === 0
|
||
|
);
|
||
|
};
|