Spaces:
Running
Running
File size: 326 Bytes
c2b7eb3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // Fast method for counting an object's keys
// without resorting to `Object.keys(obj).length
// Will this make a big difference in perf? Probably not
// But we can save a few allocations.
export function countObjectKeys(obj: Record<any, any>) {
let count = 0
for (const _key in obj) {
count++
}
return count
}
|