make typescript happy

This commit is contained in:
Mads Rasmussen
2023-12-19 14:58:46 +01:00
parent a98c4104e4
commit 650866ea63

View File

@@ -13,7 +13,14 @@ export class UmbStylesheetRuleManager {
extractRules(stylesheetContent: string): Array<UmbStylesheetRule> {
const regex = this.#umbRuleRegex;
if (!stylesheetContent) throw Error('No Stylesheet content');
return [...stylesheetContent.matchAll(regex)].map((match) => match.groups);
return [...stylesheetContent.matchAll(regex)].map((match) => {
const rule: UmbStylesheetRule = {
name: match.groups?.name || '',
selector: match.groups?.selector || '',
styles: match.groups?.styles || '',
};
return rule;
});
}
/**