Download chakra-ui/packages/react/src/utils/compact.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 207 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/utils/compact.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/utils/compact.ts
-
curl -L -o compact.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/utils/compact.ts
207 Bytes
| export function compact<T extends Record<any, any>>(object: T) { | |
| const clone = Object.assign({}, object) | |
| for (let key in clone) { | |
| if (clone[key] === undefined) delete clone[key] | |
| } | |
| return clone | |
| } | |