mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-27 03:09:43 +02:00
rename reset
to resetConfig
This commit is contained in:
@@ -17,7 +17,7 @@ export interface InjectUtils {
|
||||
*/
|
||||
export interface DiagramDB {
|
||||
// config
|
||||
reset?: () => void;
|
||||
resetConfig?: () => void;
|
||||
setConfig?: (config: BaseDiagramConfig) => void;
|
||||
getConfig?: () => BaseDiagramConfig | undefined;
|
||||
|
||||
|
@@ -11,7 +11,7 @@ describe('pie chart', () => {
|
||||
beforeEach(() => {
|
||||
parser.yy = db;
|
||||
db.clear();
|
||||
db.reset();
|
||||
db.resetConfig();
|
||||
});
|
||||
|
||||
describe('parse', () => {
|
||||
@@ -171,7 +171,7 @@ describe('pie chart', () => {
|
||||
|
||||
it('reset', () => {
|
||||
db.setConfig({ textPosition: 0 });
|
||||
db.reset();
|
||||
db.resetConfig();
|
||||
expect(db.getConfig().textPosition).toStrictEqual(DEFAULT_PIE_DB.config.textPosition);
|
||||
});
|
||||
});
|
||||
|
@@ -40,7 +40,7 @@ const setConfig = (conf: PieDiagramConfig): void => {
|
||||
|
||||
const getConfig = (): Required<PieDiagramConfig> => config;
|
||||
|
||||
const reset = (): void => {
|
||||
const resetConfig = (): void => {
|
||||
config.useWidth = DEFAULT_PIE_CONFIG.useWidth;
|
||||
config.useMaxWidth = DEFAULT_PIE_CONFIG.useMaxWidth;
|
||||
config.textPosition = DEFAULT_PIE_CONFIG.textPosition;
|
||||
@@ -82,7 +82,7 @@ const getShowData = (): boolean => showData;
|
||||
export const db: PieDB = {
|
||||
setConfig,
|
||||
getConfig,
|
||||
reset,
|
||||
resetConfig,
|
||||
|
||||
parseDirective,
|
||||
clear,
|
||||
|
@@ -43,7 +43,7 @@ export interface D3Sections {
|
||||
|
||||
export interface PieDB extends DiagramDB {
|
||||
// config
|
||||
reset: () => void;
|
||||
resetConfig: () => void;
|
||||
setConfig: (config: PieDiagramConfig) => void;
|
||||
getConfig: () => Required<PieDiagramConfig>;
|
||||
|
||||
|
Reference in New Issue
Block a user