MCPcopy Create free account
hub / github.com/KaTeX/KaTeX / cssStyleToString

Function cssStyleToString

src/domTree.ts:35–44  ·  view source on GitHub ↗
(style: CssStyle)

Source from the content-addressed store, hash-verified

33 * (hyphenating camelCase property names). Returns "" when no property is set.
34 */
35const cssStyleToString = function(style: CssStyle): string {
36 let styles = "";
37 for (const key of Object.keys(style) as Array<keyof CssStyle>) {
38 const value = style[key];
39 if (value !== undefined) {
40 styles += `${hyphenate(key)}:${value};`;
41 }
42 }
43 return styles;
44};
45
46type InitNodeData = {
47 classes: string[];

Callers 3

toMarkupFunction · 0.85
toMarkupMethod · 0.85
toMarkupMethod · 0.85

Calls 1

hyphenateFunction · 0.90

Tested by

no test coverage detected