Spaces:
Sleeping
Sleeping
Download frontend/node_modules/@mui/system/esm/propsToClassKey.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/56fda741e84da791ee2e6198479f1d5630989f6c/frontend/node_modules/%40mui/system/esm/propsToClassKey.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@56fda741e84da791ee2e6198479f1d5630989f6c/frontend/node_modules/@mui/system/esm/propsToClassKey.js
-
curl -L -o propsToClassKey.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/56fda741e84da791ee2e6198479f1d5630989f6c/frontend/node_modules/%40mui/system/esm/propsToClassKey.js
976 Bytes
| import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | |
| const _excluded = ["variant"]; | |
| import capitalize from '@mui/utils/capitalize'; | |
| function isEmpty(string) { | |
| return string.length === 0; | |
| } | |
| /** | |
| * Generates string classKey based on the properties provided. It starts with the | |
| * variant if defined, and then it appends all other properties in alphabetical order. | |
| * @param {object} props - the properties for which the classKey should be created. | |
| */ | |
| export default function propsToClassKey(props) { | |
| const { | |
| variant | |
| } = props, | |
| other = _objectWithoutPropertiesLoose(props, _excluded); | |
| let classKey = variant || ''; | |
| Object.keys(other).sort().forEach(key => { | |
| if (key === 'color') { | |
| classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]); | |
| } else { | |
| classKey += `${isEmpty(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`; | |
| } | |
| }); | |
| return classKey; | |
| } |