mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 13:29:40 +02:00
Address potential undefined
This commit is contained in:
@@ -464,9 +464,9 @@ export const setCssStyle = function (id: string, styles: string[]) {
|
|||||||
}
|
}
|
||||||
for (const s of styles) {
|
for (const s of styles) {
|
||||||
if (s.includes(',')) {
|
if (s.includes(',')) {
|
||||||
thisClass.styles = thisClass.styles.concat(s.split(','));
|
thisClass.styles = [...thisClass.styles, ...s.split(',')];
|
||||||
} else {
|
} else {
|
||||||
thisClass.styles.push(s);
|
thisClass.styles?.push(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -10,12 +10,12 @@ export interface ClassNode {
|
|||||||
members: ClassMember[];
|
members: ClassMember[];
|
||||||
annotations: string[];
|
annotations: string[];
|
||||||
domId: string;
|
domId: string;
|
||||||
|
styles: string[];
|
||||||
parent?: string;
|
parent?: string;
|
||||||
link?: string;
|
link?: string;
|
||||||
linkTarget?: string;
|
linkTarget?: string;
|
||||||
haveCallback?: boolean;
|
haveCallback?: boolean;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
styles?: string[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Visibility = '#' | '+' | '~' | '-' | '';
|
export type Visibility = '#' | '+' | '~' | '-' | '';
|
||||||
|
Reference in New Issue
Block a user