UNPKG

foxts

Version:

Opinionated collection of common TypeScript utils by @SukkaW

5 lines 440 B
"use strict";/** * Ponyfill for the TC39 "Property Counting" proposal. * * @see https://github.com/tc39/proposal-object-property-count */exports.getOwnPropertyNamesLength=function(t){return Object.getOwnPropertyNames(t).length},exports.getOwnPropertySymbolsLength=function(t){return Object.getOwnPropertySymbols(t).length},exports.keysLength=function(t){let e=0;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e};