12 lines
293 B
JavaScript
12 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
|
|
);
|
|
};
|