Download chakra-ui/packages/react/src/styled-system/normalize.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 516 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/styled-system/normalize.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/styled-system/normalize.ts
-
curl -L -o normalize.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/styled-system/normalize.ts
516 Bytes
| import { type Dict, walkObject } from "../utils" | |
| import { type SystemContext } from "./types" | |
| export function createNormalizeFn(context: { | |
| utility: SystemContext["utility"] | |
| normalize: SystemContext["normalizeValue"] | |
| }) { | |
| const { utility, normalize } = context | |
| const { hasShorthand, resolveShorthand } = utility | |
| return function (styles: Dict) { | |
| return walkObject(styles, normalize, { | |
| stop: (value) => Array.isArray(value), | |
| getKey: hasShorthand ? resolveShorthand : undefined, | |
| }) | |
| } | |
| } | |