mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
chore: refactore &&
into if
in populateCommonDb
This commit is contained in:
parent
cc6f896b69
commit
eb63568ceb
@ -3,7 +3,13 @@ import type { DiagramAST } from 'mermaid-parser';
|
||||
import type { DiagramDB } from '../../diagram-api/types.js';
|
||||
|
||||
export function populateCommonDb(ast: DiagramAST, db: DiagramDB) {
|
||||
ast.accDescr && db.setAccDescription?.(ast.accDescr);
|
||||
ast.accTitle && db.setAccTitle?.(ast.accTitle);
|
||||
ast.title && db.setDiagramTitle?.(ast.title);
|
||||
if (ast.accDescr) {
|
||||
db.setAccDescription?.(ast.accDescr);
|
||||
}
|
||||
if (ast.accTitle) {
|
||||
db.setAccTitle?.(ast.accTitle);
|
||||
}
|
||||
if (ast.title) {
|
||||
db.setDiagramTitle?.(ast.title);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user