chore: Remove comments, cleanup

Co-authored-by: Alois Klink <alois@aloisklink.com>
Co-authored-by: Nikolay Rozhkov <nironame@gmail.com>
Co-authored-by: Yokozuna59 <u.yokozuna@gmail.com>
This commit is contained in:
Sidharth Vinod 2023-08-07 15:12:37 +05:30
parent 95efc1786f
commit 646f7662d0
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
2 changed files with 7 additions and 8 deletions

View File

@ -7,6 +7,8 @@ import { UnknownDiagramError } from './errors.js';
import { cleanupComments } from './diagram-api/comments.js';
import type { DetailedError } from './utils.js';
import type { MermaidConfig } from './config.type.js';
import type { DiagramDefinition } from './diagram-api/types.js';
import { D } from 'vitest/dist/types-198fd1d9.js';
export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
@ -16,10 +18,11 @@ export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?:
*/
export class Diagram {
type = 'graph';
parser;
renderer;
db;
private init?: (config: MermaidConfig) => void;
parser: DiagramDefinition['parser'];
renderer: DiagramDefinition['renderer'];
db: DiagramDefinition['db'];
private init?: DiagramDefinition['init'];
private detectError?: UnknownDiagramError;
constructor(public text: string) {
this.text += '\n';
@ -62,7 +65,6 @@ export class Diagram {
if (this.init) {
const config = configApi.getConfig();
this.init(config);
log.info('Initialized diagram ' + this.type, config);
}
this.parser.parse(this.text);
}

View File

@ -172,8 +172,6 @@ describe('more than one sequence diagram', () => {
describe('when parsing a sequenceDiagram', function () {
beforeEach(function () {
// diagram.db = sequenceDb;
//
diagram = new Diagram(`
sequenceDiagram
Alice->Bob:Hello Bob, how are you?
@ -2048,7 +2046,6 @@ describe('when rendering a sequenceDiagram with directives', () => {
beforeEach(function () {
mermaidAPI.reset();
// diagram.db = sequenceDb;
diagram.renderer.bounds.init();
});