X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FUtils.ts;h=6557a588446455506656c7f7133e8fe85c5881f0;hb=b40b5cb39eb44088100f2ce5efc2a6fdf4b84f26;hp=89119bc2df77181529b4de1371fbcc908c58e251;hpb=44eb6026079c8dc2c77b10a96a42d0c0b2da7c8f;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 89119bc2..6557a588 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -12,7 +12,7 @@ export default class Utils { } public static logPrefix(prefixString = ''): string { - return new Date().toLocaleString() + prefixString; + return `${new Date().toLocaleString()}${prefixString}`; } public static generateUUID(): string { @@ -184,8 +184,8 @@ export default class Utils { return clone(object); } - public static isIterable(obj: T): boolean { - return obj ? typeof obj[Symbol.iterator] === 'function' : false; + public static isIterable>(obj: T): boolean { + return !Utils.isNullOrUndefined(obj) ? typeof obj[Symbol.iterator] === 'function' : false; } public static isString(value: unknown): boolean { @@ -197,7 +197,7 @@ export default class Utils { } public static isUndefined(value: unknown): boolean { - return typeof value === 'undefined'; + return value === undefined; } public static isNullOrUndefined(value: unknown): boolean {