From 91ecff2da29c7d1930ab1e8d90d159ae7a8c722e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 23 Dec 2022 19:38:07 +0100 Subject: [PATCH] Cleanups uneeded encapsulating methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Configuration.ts | 13 +------------ src/utils/Utils.ts | 4 ++++ 2 files changed, 5 insertions(+), 12 deletions(-) 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); } -- 2.34.1