Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.theming.getStylesString.js.map Maven / Gradle / Ivy
{"version":3,"file":"getStylesString.js","sourceRoot":"","sources":["../../src/theming/getStylesString.ts"],"names":[],"mappings":"AAEA,MAAM,2BAA2B,GAAG,EAAE,CAAC,CAAC,sDAAsD;AAE9F,MAAM,eAAe,GAAG,CAAC,MAA2B,EAAE,EAAE;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,OAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAsB,CAAC,GAAG,CAAC,CAAC,KAAgB,EAAE,EAAE;YACvH,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QAC1D,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACb;IAED,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;AAC7D,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import type { ComponentStylesData, StyleData } from \"../types.js\";\n\nconst MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers\n\nconst getStylesString = (styles: ComponentStylesData) => {\n\tif (Array.isArray(styles)) {\n\t\treturn (styles.filter(style => !!style).flat(MAX_DEPTH_INHERITED_CLASSES) as Array).map((style: StyleData) => {\n\t\t\treturn typeof style === \"string\" ? style : style.content;\n\t\t}).join(\" \");\n\t}\n\n\treturn typeof styles === \"string\" ? styles : styles.content;\n};\n\nexport default getStylesString;\n"]}