@plumeria/codemod 21.2.0 → 21.2.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.
|
@@ -885,9 +885,11 @@ exports.releaseStyles = {
|
|
|
885
885
|
takeProp();
|
|
886
886
|
return;
|
|
887
887
|
}
|
|
888
|
-
const
|
|
889
|
-
if (
|
|
888
|
+
const resolved = elements.map(resolveText);
|
|
889
|
+
if (!complete && resolved.every((text) => text === undefined))
|
|
890
890
|
return;
|
|
891
|
+
const unnamed = resolved.includes(undefined);
|
|
892
|
+
const texts = resolved.map((text, at) => text ?? sourceCode.getText(elements[at]));
|
|
891
893
|
const ranked = elements.map((element) => element.type === 'LogicalExpression'
|
|
892
894
|
? styleKey(element.right)
|
|
893
895
|
: styleKey(element));
|
|
@@ -909,7 +911,7 @@ exports.releaseStyles = {
|
|
|
909
911
|
}
|
|
910
912
|
}
|
|
911
913
|
const declarations = elements.flatMap(declarationsOf);
|
|
912
|
-
const replacement = elements.some(needsFilter)
|
|
914
|
+
const replacement = unnamed || elements.some(needsFilter)
|
|
913
915
|
? `[${texts.join(', ')}].filter(Boolean).join(' ')`
|
|
914
916
|
: `[${texts.join(', ')}].join(' ')`;
|
|
915
917
|
if (declarations.length > 0) {
|
package/package.json
CHANGED