UNPKG

276 BJavaScriptView Raw
1import isNil from './is-nil';
2import isArraylike from './is-array-like';
3export default function size(o) {
4 if (isNil(o)) {
5 return 0;
6 }
7 if (isArraylike(o)) {
8 return o.length;
9 }
10 return Object.keys(o).length;
11}
12//# sourceMappingURL=size.js.map
\No newline at end of file