Download next.js/turbopack/packages/devlow-bench/src/utils.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 387 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/packages/devlow-bench/src/utils.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/packages/devlow-bench/src/utils.ts
-
curl -L -o utils.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/packages/devlow-bench/src/utils.ts
387 Bytes
| export function formatVariant( | |
| scenario: string, | |
| props: Record<string, string | number | boolean | null> | |
| ): string { | |
| const keys = Object.keys(props) | |
| .filter((key) => props[key] !== false && props[key] !== null) | |
| .map((key) => (props[key] === true ? key : `${key}=${props[key]}`)) | |
| if (keys.length === 0) { | |
| return scenario | |
| } | |
| return `${scenario} ${keys.join(' ')}` | |
| } | |