chore: refactore && into if in populateCommonDb

This commit is contained in:
Reda Al Sulais 2023-08-21 03:04:39 +03:00
parent cc6f896b69
commit eb63568ceb

View File

@ -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);
}
}