From 4c5e87ae4e007b3cb0a8636515da8c3fe2bccff3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 14 Feb 2023 16:33:26 +0100 Subject: [PATCH] refactor(simulator): use helper(s) where appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/storage/JsonFileStorage.ts | 2 +- src/utils/Utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/performance/storage/JsonFileStorage.ts b/src/performance/storage/JsonFileStorage.ts index a2c77719..44340cc4 100644 --- a/src/performance/storage/JsonFileStorage.ts +++ b/src/performance/storage/JsonFileStorage.ts @@ -49,7 +49,7 @@ export class JsonFileStorage extends Storage { public open(): void { try { - if (this?.fd === undefined || this?.fd === null) { + if (Utils.isNullOrUndefined(this?.fd)) { this.fd = fs.openSync(this.dbName, 'a+'); } } catch (error) { diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index bffa0a17..8a66d92d 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -185,7 +185,7 @@ export class Utils { return clone(object); } - public static objectHasOwnProperty(object: object, property: string): boolean { + public static objectHasOwnProperty(object: unknown, property: string): boolean { return ( Utils.isObject(object) && (Object.prototype.hasOwnProperty.call(object, property) as boolean) ); -- 2.34.1