@jsenv/dom 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jsenv_dom.js
CHANGED
|
@@ -668,6 +668,8 @@ const mergeStyles = (stylesA, stylesB, context = "js") => {
|
|
|
668
668
|
}
|
|
669
669
|
const result = {};
|
|
670
670
|
const aKeys = Object.keys(stylesA);
|
|
671
|
+
// in case stylesB is a string we first parse it
|
|
672
|
+
stylesB = normalizeStyles(stylesB, context);
|
|
671
673
|
const bKeyToVisitSet = new Set(Object.keys(stylesB));
|
|
672
674
|
for (const aKey of aKeys) {
|
|
673
675
|
const bHasKey = bKeyToVisitSet.has(aKey);
|
|
@@ -679,7 +681,7 @@ const mergeStyles = (stylesA, stylesB, context = "js") => {
|
|
|
679
681
|
}
|
|
680
682
|
}
|
|
681
683
|
for (const bKey of bKeyToVisitSet) {
|
|
682
|
-
result[bKey] =
|
|
684
|
+
result[bKey] = stylesB[bKey];
|
|
683
685
|
}
|
|
684
686
|
return result;
|
|
685
687
|
};
|
package/package.json
CHANGED
|
@@ -15,6 +15,8 @@ export const mergeStyles = (stylesA, stylesB, context = "js") => {
|
|
|
15
15
|
}
|
|
16
16
|
const result = {};
|
|
17
17
|
const aKeys = Object.keys(stylesA);
|
|
18
|
+
// in case stylesB is a string we first parse it
|
|
19
|
+
stylesB = normalizeStyles(stylesB, context);
|
|
18
20
|
const bKeyToVisitSet = new Set(Object.keys(stylesB));
|
|
19
21
|
for (const aKey of aKeys) {
|
|
20
22
|
const bHasKey = bKeyToVisitSet.has(aKey);
|
|
@@ -26,7 +28,7 @@ export const mergeStyles = (stylesA, stylesB, context = "js") => {
|
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
for (const bKey of bKeyToVisitSet) {
|
|
29
|
-
result[bKey] =
|
|
31
|
+
result[bKey] = stylesB[bKey];
|
|
30
32
|
}
|
|
31
33
|
return result;
|
|
32
34
|
};
|