simple-graph-query 1.2.2 → 1.2.4
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.
|
@@ -48632,25 +48632,20 @@ class ForgeExprEvaluator extends AbstractParseTreeVisitor_1.AbstractParseTreeVis
|
|
|
48632
48632
|
}
|
|
48633
48633
|
// helper function to get the label for a value (used for @: operator)
|
|
48634
48634
|
getLabelForValue(value) {
|
|
48635
|
-
// For primitive values (numbers, booleans), the label is the value itself
|
|
48635
|
+
// // For primitive values (numbers, booleans), the label is the value itself
|
|
48636
48636
|
if (typeof value === "number" || typeof value === "boolean") {
|
|
48637
|
-
return value;
|
|
48637
|
+
return String(value); // [SP: Labels are always strings, so convert numbers/booleans to strings]
|
|
48638
48638
|
}
|
|
48639
48639
|
// For string values, try to find the corresponding atom and return its label
|
|
48640
48640
|
if (typeof value === "string") {
|
|
48641
|
-
|
|
48642
|
-
|
|
48643
|
-
|
|
48644
|
-
|
|
48645
|
-
// If the atom has a label field, return it; otherwise return the ID
|
|
48646
|
-
return atom.label !== undefined ? atom.label : atom.id;
|
|
48647
|
-
}
|
|
48648
|
-
}
|
|
48641
|
+
let atom = this.instanceData.getAtoms().find((a) => a.id === value);
|
|
48642
|
+
if (atom) {
|
|
48643
|
+
// If the atom has a label field, return it; otherwise return the ID
|
|
48644
|
+
return atom.label !== undefined ? atom.label : atom.id;
|
|
48649
48645
|
}
|
|
48650
|
-
// If no atom found, the value itself is the label (for string literals)
|
|
48651
|
-
return value;
|
|
48652
48646
|
}
|
|
48653
48647
|
// Fallback: return the value itself
|
|
48648
|
+
console.error(`No atom found for value: ${value}`);
|
|
48654
48649
|
return value;
|
|
48655
48650
|
}
|
|
48656
48651
|
// helper function
|
package/package.json
CHANGED