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

Function parseStyleAttr

packages/sdk/src/engine/model.ts:185–196  ·  view source on GitHub ↗
(styleAttr: string)

Source from the content-addressed store, hash-verified

183}
184
185function parseStyleAttr(styleAttr: string): Record<string, string> {
186 const result: Record<string, string> = {};
187 for (const decl of splitStyleDeclarations(styleAttr)) {
188 const idx = decl.indexOf(":");
189 if (idx === -1) continue;
190 const rawProp = decl.slice(0, idx).trim();
191 const value = decl.slice(idx + 1).trim();
192 if (!rawProp) continue;
193 result[toCamel(rawProp)] = value;
194 }
195 return result;
196}
197
198/** Serialize camelCase style map → style attribute string. */
199function serializeStyleAttr(styles: Record<string, string>): string {

Callers 1

getElementStylesFunction · 0.85

Calls 2

splitStyleDeclarationsFunction · 0.85
toCamelFunction · 0.85

Tested by

no test coverage detected