MCPcopy
hub / github.com/kuma-ui/kuma-ui / extractOperators

Function extractOperators

packages/sheet/src/sheet.ts:70–91  ·  view source on GitHub ↗
(operator: string, style: string)

Source from the content-addressed store, hash-verified

68}
69
70function extractOperators(operator: string, style: string) {
71 const selectors: string[] = [];
72 let searchStart = 0;
73
74 while (searchStart < style.length) {
75 const match = findOperator(operator, style, searchStart);
76
77 if (!match) {
78 break;
79 }
80
81 const prefix = style.slice(searchStart, match.start);
82
83 if (match.value !== undefined && /(?:^|[^\S\r\n])&\s*$/.test(prefix)) {
84 selectors.push(normalizeWhitespace(match.value));
85 }
86
87 searchStart = Math.max(match.end, match.start + 1);
88 }
89
90 return selectors;
91}
92
93function unwrapGlobalOperator(selector: string, out?: string[]) {
94 let result = "";

Callers 1

parseCSSMethod · 0.85

Calls 2

findOperatorFunction · 0.85
normalizeWhitespaceFunction · 0.85

Tested by

no test coverage detected