Download chakra-ui/packages/cli/src/utils/shared.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/cli/src/utils/shared.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/cli/src/utils/shared.ts
-
curl -L -o shared.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/cli/src/utils/shared.ts
504 Bytes
| export function unionType(values: Iterable<any>, loosen = false) { | |
| const baseType = Array.from(values) | |
| .map((value) => JSON.stringify(value)) | |
| .join(" | ") | |
| if (loosen) { | |
| return `${baseType} | (string & {})` | |
| } | |
| return baseType | |
| } | |
| export function capitalize(value: string) { | |
| return value.charAt(0).toUpperCase() + value.slice(1) | |
| } | |
| export const isBooleanValue = (value: string) => | |
| value === "true" || value === "false" | |
| export const uniq = <T>(arr: T[]) => Array.from(new Set(arr)) | |