Spaces:
Sleeping
Sleeping
Download node_modules/@reduxjs/toolkit/src/query/utils/countObjectKeys.ts from Scribbler310/gs-port: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/spaces/Scribbler310/gs-port/resolve/main/node_modules/%40reduxjs/toolkit/src/query/utils/countObjectKeys.ts
- Command line
-
hf download hf://spaces/Scribbler310/gs-port/node_modules/@reduxjs/toolkit/src/query/utils/countObjectKeys.ts
-
curl -L -o countObjectKeys.ts https://huggingface.co/spaces/Scribbler310/gs-port/resolve/main/node_modules/%40reduxjs/toolkit/src/query/utils/countObjectKeys.ts
326 Bytes
| // 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 | |
| } | |