MCPcopy Index your code
hub / github.com/coder/coder / extractVariables

Function extractVariables

site/src/theme/cssVariables.test.ts:92–103  ·  view source on GitHub ↗
(block: string)

Source from the content-addressed store, hash-verified

90}
91
92function extractVariables(block: string): Map<string, string> {
93 const variables = new Map<string, string>();
94 for (const match of block.matchAll(/(--[\w-]+)\s*:\s*([^;]+);/g)) {
95 const variable = match[1];
96 const value = match[2];
97 if (variable === undefined || value === undefined) {
98 continue;
99 }
100 variables.set(variable, value.trim());
101 }
102 return variables;
103}
104
105function extractEffectiveBlock(css: string, selector: string): string | null {
106 const block = extractBlock(css, selector);

Callers 1

extractVariableFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected