Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
15 lines
326 B
Plaintext
15 lines
326 B
Plaintext
// 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
|
|
}
|