nox-validation 1.6.2 → 1.6.3
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/lib/helpers.js +22 -1
- package/package.json +1 -1
package/lib/helpers.js
CHANGED
|
@@ -1404,6 +1404,20 @@ const getM2AItemParentPath = (path) => {
|
|
|
1404
1404
|
return match ? path.replace(".item", "") : null;
|
|
1405
1405
|
};
|
|
1406
1406
|
|
|
1407
|
+
const addIndexToStaticType = (key, staticType) => {
|
|
1408
|
+
const parts = key.split(".");
|
|
1409
|
+
|
|
1410
|
+
return parts
|
|
1411
|
+
.map((part) => {
|
|
1412
|
+
if (part === staticType) {
|
|
1413
|
+
// If staticType is found AND missing index → add [0]
|
|
1414
|
+
return part.includes("[") ? part : `${part}[0]`;
|
|
1415
|
+
}
|
|
1416
|
+
return part;
|
|
1417
|
+
})
|
|
1418
|
+
.join(".");
|
|
1419
|
+
};
|
|
1420
|
+
|
|
1407
1421
|
const getSelectedNodes = ({
|
|
1408
1422
|
node,
|
|
1409
1423
|
skipFn = (node) => node.meta?.interface === constants.interfaces.MANY_TO_ANY,
|
|
@@ -1456,6 +1470,13 @@ const getSelectedNodes = ({
|
|
|
1456
1470
|
return [...par, ...cur].join(".");
|
|
1457
1471
|
}
|
|
1458
1472
|
|
|
1473
|
+
if (currentNode?.meta?.staticType) {
|
|
1474
|
+
currentNode.key = addIndexToStaticType(
|
|
1475
|
+
currentNode.key,
|
|
1476
|
+
currentNode?.meta?.staticType
|
|
1477
|
+
);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1459
1480
|
if (parentKey)
|
|
1460
1481
|
currentNode.key = mergePathLevels(currentNode.key, parentKey);
|
|
1461
1482
|
|
|
@@ -1564,7 +1585,7 @@ const rebuildFullPath = (nodePath, fullPath, modifierFn) => {
|
|
|
1564
1585
|
// 1. Find parent path
|
|
1565
1586
|
const index = fullPath.lastIndexOf(nodePath);
|
|
1566
1587
|
if (index === -1) {
|
|
1567
|
-
|
|
1588
|
+
return fullPath;
|
|
1568
1589
|
}
|
|
1569
1590
|
|
|
1570
1591
|
const parentPath = fullPath.slice(0, index).replace(/\.$/, "");
|