rename reset to resetConfig

This commit is contained in:
Reda Al Sulais
2023-08-10 21:01:32 +03:00
parent 38dc17f426
commit 545d361d3f
4 changed files with 6 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ export interface InjectUtils {
*/
export interface DiagramDB {
// config
reset?: () => void;
resetConfig?: () => void;
setConfig?: (config: BaseDiagramConfig) => void;
getConfig?: () => BaseDiagramConfig | undefined;

View File

@@ -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);
});
});

View File

@@ -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,

View File

@@ -43,7 +43,7 @@ export interface D3Sections {
export interface PieDB extends DiagramDB {
// config
reset: () => void;
resetConfig: () => void;
setConfig: (config: PieDiagramConfig) => void;
getConfig: () => Required<PieDiagramConfig>;