Address potential undefined

This commit is contained in:
Justin Greywolf 2023-12-10 13:25:16 -08:00
parent 3bb005b973
commit b51ca4fb15
2 changed files with 3 additions and 3 deletions

View File

@ -464,9 +464,9 @@ export const setCssStyle = function (id: string, styles: string[]) {
}
for (const s of styles) {
if (s.includes(',')) {
thisClass.styles = thisClass.styles.concat(s.split(','));
thisClass.styles = [...thisClass.styles, ...s.split(',')];
} else {
thisClass.styles.push(s);
thisClass.styles?.push(s);
}
}
};

View File

@ -10,12 +10,12 @@ export interface ClassNode {
members: ClassMember[];
annotations: string[];
domId: string;
styles: string[];
parent?: string;
link?: string;
linkTarget?: string;
haveCallback?: boolean;
tooltip?: string;
styles?: string[];
}
export type Visibility = '#' | '+' | '~' | '-' | '';