We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9118d6c commit f41fec2Copy full SHA for f41fec2
components/vc-util/Dom/css.ts
@@ -121,7 +121,13 @@ export function styleToString(style: CSSStyleDeclaration) {
121
}
122
123
export function styleObjectToString(style: Record<string, string>) {
124
- return Object.keys(style)
125
- .map(name => `${name}: ${style[name]};`)
126
- .join('');
+ return Object.keys(style).reduce((acc, name) => {
+ const styleValue = style[name];
+ if (typeof styleValue === 'undefined' || styleValue === null) {
127
+ return acc;
128
+ }
129
+
130
+ acc += `${name}: ${style[name]};`;
131
132
+ }, '');
133
0 commit comments