MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / advanceStyleDeclarationScan

Function advanceStyleDeclarationScan

packages/sdk/src/engine/model.ts:147–162  ·  view source on GitHub ↗
(scan: StyleDeclarationScan, ch: string, next: string)

Source from the content-addressed store, hash-verified

145}
146
147function advanceStyleDeclarationScan(scan: StyleDeclarationScan, ch: string, next: string): void {
148 if (scan.quote) {
149 if (ch === "\\" && next) {
150 scan.skip = true;
151 return;
152 }
153 if (ch === scan.quote) scan.quote = null;
154 return;
155 }
156 if (ch === "'" || ch === '"') {
157 scan.quote = ch;
158 return;
159 }
160 if (ch === "(") scan.depth++;
161 else if (ch === ")") scan.depth = Math.max(0, scan.depth - 1);
162}
163
164function splitStyleDeclarations(style: string): string[] {
165 const declarations: string[] = [];

Callers 1

splitStyleDeclarationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected