Merge pull request #839 from morluto/fix/empty-literal-graph-labels

fix(javascript): analyze sources containing empty string literals
This commit is contained in:
Kaoru0822
2026-10-06 20:55:11 -07:00
committed by GitHub
7 changed files with 167 additions and 21 deletions
+8
View File
@@ -23,3 +23,11 @@ export const semanticStaticPropertyKey = (
return String(property.value);
return !computed && t.isIdentifier(property) ? property.name : null;
};
/**
* Display an exact JavaScript string as nonempty label text. Graph labels and
* artifact-local keys are nonempty, so the legal empty value is shown as `""`;
* producers keep the exact value in their properties.
*/
export const javascriptDisplayText = (value: string): string =>
value === "" ? '""' : value;