mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 07:19:41 +02:00
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:
@@ -7,6 +7,8 @@ import { UnknownDiagramError } from './errors.js';
|
|||||||
import { cleanupComments } from './diagram-api/comments.js';
|
import { cleanupComments } from './diagram-api/comments.js';
|
||||||
import type { DetailedError } from './utils.js';
|
import type { DetailedError } from './utils.js';
|
||||||
import type { MermaidConfig } from './config.type.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;
|
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 {
|
export class Diagram {
|
||||||
type = 'graph';
|
type = 'graph';
|
||||||
parser;
|
parser: DiagramDefinition['parser'];
|
||||||
renderer;
|
renderer: DiagramDefinition['renderer'];
|
||||||
db;
|
db: DiagramDefinition['db'];
|
||||||
private init?: (config: MermaidConfig) => void;
|
private init?: DiagramDefinition['init'];
|
||||||
|
|
||||||
private detectError?: UnknownDiagramError;
|
private detectError?: UnknownDiagramError;
|
||||||
constructor(public text: string) {
|
constructor(public text: string) {
|
||||||
this.text += '\n';
|
this.text += '\n';
|
||||||
@@ -62,7 +65,6 @@ export class Diagram {
|
|||||||
if (this.init) {
|
if (this.init) {
|
||||||
const config = configApi.getConfig();
|
const config = configApi.getConfig();
|
||||||
this.init(config);
|
this.init(config);
|
||||||
log.info('Initialized diagram ' + this.type, config);
|
|
||||||
}
|
}
|
||||||
this.parser.parse(this.text);
|
this.parser.parse(this.text);
|
||||||
}
|
}
|
||||||
|
@@ -172,8 +172,6 @@ describe('more than one sequence diagram', () => {
|
|||||||
|
|
||||||
describe('when parsing a sequenceDiagram', function () {
|
describe('when parsing a sequenceDiagram', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
// diagram.db = sequenceDb;
|
|
||||||
//
|
|
||||||
diagram = new Diagram(`
|
diagram = new Diagram(`
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
Alice->Bob:Hello Bob, how are you?
|
Alice->Bob:Hello Bob, how are you?
|
||||||
@@ -2048,7 +2046,6 @@ describe('when rendering a sequenceDiagram with directives', () => {
|
|||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mermaidAPI.reset();
|
mermaidAPI.reset();
|
||||||
// diagram.db = sequenceDb;
|
|
||||||
diagram.renderer.bounds.init();
|
diagram.renderer.bounds.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user