Merge pull request #839 from morluto/fix/empty-literal-graph-labels
fix(javascript): analyze sources containing empty string literals
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user