MCPcopy Index your code
hub / github.com/prettier/prettier / parseValue

Function parseValue

src/language-css/parse/parse-value.js:177–199  ·  view source on GitHub ↗
(value, options)

Source from the content-addressed store, hash-verified

175}
176
177function parseValue(value, options) {
178 // Inline JavaScript in Less
179 if (options.parser === "less" && value.startsWith("~`")) {
180 return { type: "value-unknown", value };
181 }
182
183 let result;
184
185 try {
186 result = new PostcssValuesParser(value, { loose: true }).parse();
187 } catch {
188 return {
189 type: "value-unknown",
190 value,
191 };
192 }
193
194 result.text = value;
195
196 const parsedResult = parseNestedValue(result, options);
197
198 return addTypePrefix(parsedResult, "value-", /^selector-/);
199}
200
201export default parseValue;

Callers 1

parseNestedCSSFunction · 0.85

Calls 2

addTypePrefixFunction · 0.90
parseNestedValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…