Spaces:
Sleeping
Sleeping
Download frontend/node_modules/@mui/system/legacy/propsToClassKey.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 944 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/%40mui/system/legacy/propsToClassKey.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/@mui/system/legacy/propsToClassKey.js
-
curl -L -o propsToClassKey.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/%40mui/system/legacy/propsToClassKey.js
944 Bytes
| import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | |
| 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) { | |
| var variant = props.variant, | |
| other = _objectWithoutProperties(props, ["variant"]); | |
| var classKey = variant || ''; | |
| Object.keys(other).sort().forEach(function (key) { | |
| if (key === 'color') { | |
| classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]); | |
| } else { | |
| classKey += "".concat(isEmpty(classKey) ? key : capitalize(key)).concat(capitalize(props[key].toString())); | |
| } | |
| }); | |
| return classKey; | |
| } |