Download chakra-ui/packages/react/src/utils/entries.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 305 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/utils/entries.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/utils/entries.ts
-
curl -L -o entries.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/utils/entries.ts
305 Bytes
| export function mapEntries<A, B, K extends string | number | symbol>( | |
| obj: { [key in K]: A }, | |
| f: (key: K, val: A) => [K, B], | |
| ): { [key in K]: B } { | |
| const result: { [key in K]: B } = {} as any | |
| for (const key in obj) { | |
| const kv = f(key, obj[key]) | |
| result[kv[0]] = kv[1] | |
| } | |
| return result | |
| } | |