mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08: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:
parent
95efc1786f
commit
646f7662d0
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user