(astRule: ReworkCSS.Rule)
| 805 | } |
| 806 | |
| 807 | export function fromAstNode(astRule: ReworkCSS.Rule): RuleSet { |
| 808 | const declarations = astRule.declarations.filter(isDeclaration).map(createDeclaration); |
| 809 | const selectors = astRule.selectors.map(createSelector); |
| 810 | |
| 811 | return new RuleSet(selectors, declarations); |
| 812 | } |
| 813 | |
| 814 | function createDeclaration(decl: ReworkCSS.Declaration): any { |
| 815 | return { property: isCssVariable(decl.property) ? decl.property : decl.property.toLowerCase(), value: decl.value }; |
no test coverage detected