From: Jérôme Benoit Date: Fri, 23 Dec 2022 18:38:07 +0000 (+0100) Subject: Cleanups uneeded encapsulating methods X-Git-Tag: v1.1.89~59 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=91ecff2da29c7d1930ab1e8d90d159ae7a8c722e;p=e-mobility-charging-stations-simulator.git Cleanups uneeded encapsulating methods Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 3770c6ca..fb77ff2e 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -69,10 +69,7 @@ export default class Configuration { }, }; if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'uiServer')) { - uiServerConfiguration = Configuration.merge( - uiServerConfiguration, - Configuration.getConfig().uiServer - ); + uiServerConfiguration = merge(uiServerConfiguration, Configuration.getConfig().uiServer); } if (Configuration.isCFEnvironment() === true) { delete uiServerConfiguration.options.host; @@ -410,10 +407,6 @@ export default class Configuration { } } - // private static isObject(item: unknown): boolean { - // return item && typeof item === 'object' && Array.isArray(item) === false; - // } - private static objectHasOwnProperty(object: unknown, property: string): boolean { return Object.prototype.hasOwnProperty.call(object, property) as boolean; } @@ -422,10 +415,6 @@ export default class Configuration { return typeof obj === 'undefined'; } - private static merge(target: object, ...sources: object[]): object { - return merge(target, ...sources); - } - private static handleFileException( logPrefix: string, fileType: FileType, diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 2fde4883..f1744075 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -165,6 +165,10 @@ export default class Utils { ); } + public static isObject(item: unknown): boolean { + return item && typeof item === 'object' && Array.isArray(item) === false; + } + public static cloneObject(object: T): T { return clone(object); }