MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / normalizeStyle

Function normalizeStyle

packages/utils/src/css-helper.ts:84–105  ·  view source on GitHub ↗
(style)

Source from the content-addressed store, hash-verified

82}
83
84function normalizeStyle(style) {
85 if (!style) {
86 return {};
87 }
88 if (style.default) {
89 const normalized = {};
90 Object.keys(style).forEach((pseudo) => {
91 if (pseudo === 'extra') {
92 normalized[pseudo] = style[pseudo];
93 return;
94 }
95 normalized[pseudo] = normalizeStyle(style[pseudo]);
96 });
97 return normalized;
98 }
99
100 const normalized: Record<string, string | Record<string, string>> = {};
101 Object.keys(style).forEach((key) => {
102 normalized[hyphenate(key)] = style[key];
103 });
104 return normalized;
105}
106
107function toCss(runtime) {
108 if (!runtime) {

Callers 2

toCssFunction · 0.85
cssToStyleFunction · 0.85

Calls 2

hyphenateFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…