MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / cssTreeParse

Function cssTreeParse

packages/core/css/css-tree-parser.ts:130–148  ·  view source on GitHub ↗
(css, source)

Source from the content-addressed store, hash-verified

128}
129
130export function cssTreeParse(css, source): any {
131 const errors = [];
132 const ast = cssTree.parse(css, {
133 parseValue: false,
134 parseAtrulePrelude: false,
135 parseRulePrelude: false,
136 positions: true,
137 filename: source,
138 onParseError: (error) => {
139 errors.push(`${source}:${error.line}:${error.column}: ${error.formattedMessage}`);
140 },
141 });
142
143 if (errors.length > 0) {
144 throw new Error(errors[0]);
145 }
146
147 return transformAst(ast, css);
148}

Callers 3

parseCSSAstMethod · 0.90

Calls 3

transformAstFunction · 0.85
parseMethod · 0.65
pushMethod · 0.45

Tested by 1