pasika 0.5.12 → 0.5.14
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.
|
@@ -51,10 +51,13 @@ function containsSmartCall(node) {
|
|
|
51
51
|
ts.forEachChild(node, visit);
|
|
52
52
|
return found;
|
|
53
53
|
}
|
|
54
|
+
function isAsyncFunction(node) {
|
|
55
|
+
return (ts.getModifiers(node) ?? []).some((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword);
|
|
56
|
+
}
|
|
54
57
|
function componentFromFunction(node) {
|
|
55
58
|
const name = node.name?.text;
|
|
56
59
|
if (!name || !isPascalCase(name) || !containsJsx(node)) return void 0;
|
|
57
|
-
return { name, declaration: node, smart: containsSmartCall(node) };
|
|
60
|
+
return { name, declaration: node, smart: containsSmartCall(node) || isAsyncFunction(node) };
|
|
58
61
|
}
|
|
59
62
|
function componentFromVariable(node) {
|
|
60
63
|
if (!ts.isIdentifier(node.name) || !isPascalCase(node.name.text)) return void 0;
|
|
@@ -1137,7 +1140,7 @@ function isComponentName(name) {
|
|
|
1137
1140
|
}
|
|
1138
1141
|
function isOuterLayoutClass(className) {
|
|
1139
1142
|
const utility = className.split(":").pop() ?? className;
|
|
1140
|
-
return /^(?:-?m[trblsexy]?-.+|(?:min-|max-)?[wh]-.+|size-.+|(?:flex-(?:1|auto|initial|none|grow|shrink|basis-.+)|grow(?:-.+)?|shrink(?:-.+)?|basis-.+|order-.+|(?:col|row)-(?:auto|span-.+|start-.+|end-.+)|(?:self|place-self|justify-self)-.+|z-.+|gap-.+|space-[xy]-.+))$/.test(
|
|
1143
|
+
return /^(?:-?(?:m|p)[trblsexy]?-.+|(?:min-|max-)?[wh]-.+|size-.+|inset(?:-[xy])?-.+|(?:-?(?:top|right|bottom|left)-.+)|overflow(?:-[xy])?-(?:auto|hidden|clip|visible|scroll)|(?:flex-(?:1|auto|initial|none|grow|shrink|basis-.+)|grow(?:-.+)?|shrink(?:-.+)?|basis-.+|order-.+|(?:col|row)-(?:auto|span-.+|start-.+|end-.+)|(?:self|place-self|justify-self)-.+|z-.+|gap-.+|space-[xy]-.+))$/.test(
|
|
1141
1144
|
utility
|
|
1142
1145
|
);
|
|
1143
1146
|
}
|