size.js 343 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 var isArray = require('../lang/isArray'); var objSize = require('../object/size'); /** * Get collection size */ function size(list) { if (!list) { return 0; } if (isArray(list)) { return list.length; } return objSize(list); } module.exports = size;