forked from mermaid-js/mermaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move
commonDb
into diagrams/common/commonDb
- Loading branch information
1 parent
6e51f8f
commit a61887f
Showing
19 changed files
with
79 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { sanitizeText as _sanitizeText } from './common.js'; | ||
import { getConfig } from '../../config.js'; | ||
import type { CommonDb } from './commonTypes.js'; | ||
|
||
let accTitle = ''; | ||
let diagramTitle = ''; | ||
let accDescription = ''; | ||
|
||
const sanitizeText = (txt: string): string => _sanitizeText(txt, getConfig()); | ||
|
||
export const clear = (): void => { | ||
accTitle = ''; | ||
accDescription = ''; | ||
diagramTitle = ''; | ||
}; | ||
|
||
export const setAccTitle = (txt: string): void => { | ||
accTitle = sanitizeText(txt).replace(/^\s+/g, ''); | ||
}; | ||
|
||
export const getAccTitle = (): string => { | ||
return accTitle; | ||
}; | ||
|
||
export const setAccDescription = (txt: string): void => { | ||
accDescription = sanitizeText(txt).replace(/\n\s+/g, '\n'); | ||
}; | ||
|
||
export const getAccDescription = (): string => { | ||
return accDescription; | ||
}; | ||
|
||
export const setDiagramTitle = (txt: string): void => { | ||
diagramTitle = sanitizeText(txt); | ||
}; | ||
|
||
export const getDiagramTitle = (): string => diagramTitle; | ||
|
||
export const db: CommonDb = { | ||
getAccTitle, | ||
setAccTitle, | ||
getDiagramTitle, | ||
setDiagramTitle, | ||
getAccDescription, | ||
setAccDescription, | ||
clear, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters