twing
Version:
First-class Twig engine for Node.js
17 lines (16 loc) • 369 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.count = void 0;
/**
* Count all elements in an object.
*
* @param {*} countable
* @returns {number}
*/
const count = (countable) => {
if (countable.size !== undefined) {
return countable.size;
}
return Object.keys(countable).length;
};
exports.count = count;