Skip to content

Commit

Permalink
Update conditions for optional properties
Browse files Browse the repository at this point in the history
Checking against undefined is more direct.
  • Loading branch information
victorlin committed Nov 21, 2024
1 parent c2d10de commit a7578d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/entropyCreateStateFromJsons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ function cdsFromAnnotation(
isWrapping: _isCdsWrapping(strand, segments),
color: validColor(annotation.color) || defaultColor || '#000',
}
if (typeof annotation.display_name === 'string') {
if (annotation.display_name !== undefined) {
cds.displayName = annotation.display_name;
}
if (typeof annotation.description === 'string') {
if (annotation.description !== undefined) {
cds.description = annotation.description;
}
return cds
Expand Down

0 comments on commit a7578d2

Please sign in to comment.