MCPcopy Create free account
hub / github.com/github/awesome-copilot / resolveExpression

Function resolveExpression

eng/generate-website-data.mjs:846–863  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

844 }
845
846 function resolveExpression(expr) {
847 const trimmed = normalizeText(expr);
848 if (!trimmed) return null;
849 if (
850 (trimmed.startsWith('"') && trimmed.endsWith('"')) ||
851 (trimmed.startsWith("'") && trimmed.endsWith("'"))
852 ) {
853 return trimmed
854 .slice(1, -1)
855 .replace(/\\n/g, "\n")
856 .replace(/\\"/g, '"')
857 .replace(/\\'/g, "'");
858 }
859 if (trimmed.startsWith("`") && trimmed.endsWith("`") && !trimmed.includes("${")) {
860 return trimmed.slice(1, -1);
861 }
862 return constants.get(trimmed) || null;
863 }
864
865 function findMatchingBrace(startIndex) {
866 let depth = 0;

Callers 1

readPropFunction · 0.85

Calls 1

normalizeTextFunction · 0.70

Tested by

no test coverage detected