@immense/vue-pom-generator 1.0.35 → 1.0.36

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/index.mjs CHANGED
@@ -964,6 +964,18 @@ function nodeHandlerAttributeInfo(node) {
964
964
  }
965
965
  return null;
966
966
  };
967
+ const getRootIdentifierFromMemberChain = (node2) => {
968
+ if (!node2) {
969
+ return null;
970
+ }
971
+ if (isIdentifierNode(node2)) {
972
+ return node2.name;
973
+ }
974
+ if (isMemberExpressionNode(node2)) {
975
+ return getRootIdentifierFromMemberChain(node2.object);
976
+ }
977
+ return null;
978
+ };
967
979
  const getAssignmentTargetName = (lhs) => {
968
980
  if (!lhs) {
969
981
  return null;
@@ -1018,7 +1030,10 @@ function nodeHandlerAttributeInfo(node) {
1018
1030
  }
1019
1031
  if (isMemberExpressionNode(arg)) {
1020
1032
  const stableName = getLastIdentifierFromMemberChain(arg);
1021
- if (stableName) {
1033
+ const rootName = getRootIdentifierFromMemberChain(arg);
1034
+ const firstChar = (rootName ?? "").charAt(0);
1035
+ const isConstantLikeRoot = firstChar !== "" && firstChar === firstChar.toUpperCase() && firstChar !== firstChar.toLowerCase();
1036
+ if (stableName && isConstantLikeRoot) {
1022
1037
  return toPascalCase(stableName.slice(0, 24));
1023
1038
  }
1024
1039
  }
@@ -1036,12 +1051,15 @@ function nodeHandlerAttributeInfo(node) {
1036
1051
  const first = args.length > 0 ? args[0] : null;
1037
1052
  if (!isObjectExpressionNode(first)) {
1038
1053
  const parts2 = [];
1039
- for (const arg of args.slice(0, 2)) {
1054
+ for (const arg of args.slice(0, 4)) {
1040
1055
  const w = stableWordFromValue(arg ?? null);
1041
1056
  if (!w) {
1042
- return null;
1057
+ continue;
1043
1058
  }
1044
1059
  parts2.push(w);
1060
+ if (parts2.length >= 2) {
1061
+ break;
1062
+ }
1045
1063
  }
1046
1064
  if (parts2.length === 0) {
1047
1065
  return null;