MCPcopy Create free account
hub / github.com/resend/react-email / splitDeclarations

Function splitDeclarations

packages/editor/src/utils/styles.ts:31–50  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

29};
30
31const splitDeclarations = (input: string): string[] => {
32 const results: string[] = [];
33 let current = '';
34 let depth = 0;
35
36 for (const char of input) {
37 if (char === '(') depth++;
38 if (char === ')') depth--;
39
40 if (char === ';' && depth === 0) {
41 results.push(current);
42 current = '';
43 } else {
44 current += char;
45 }
46 }
47
48 if (current) results.push(current);
49 return results;
50};
51
52export const inlineCssToJs = (
53 inlineStyle: string,

Callers 1

inlineCssToJsFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected