From a25fc2e7e82a1043e9c9e7334fbc5d86e5ce7b8a Mon Sep 17 00:00:00 2001 From: James Collins Date: Tue, 21 Feb 2023 14:53:51 +1000 Subject: [PATCH] Fix Snyk errors --- resources/js/helpers/datetime.ts | 4 ++-- resources/js/helpers/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/js/helpers/datetime.ts b/resources/js/helpers/datetime.ts index 4743842..8998285 100644 --- a/resources/js/helpers/datetime.ts +++ b/resources/js/helpers/datetime.ts @@ -56,7 +56,7 @@ export class SMDate { } } else if ( dateOrString instanceof Date && - !isNaN(dateOrString.getTime()) + !Number.isNaN(dateOrString.getTime()) ) { this.date = dateOrString; } @@ -223,7 +223,7 @@ export class SMDate { } if ( - isNaN(date.getTime()) == false && + Number.isNaN(date.getTime()) == false && checkYear == parsedYear && checkMonth == parsedMonth && checkDay == parsedDay && diff --git a/resources/js/helpers/types.ts b/resources/js/helpers/types.ts index 272060f..e00ac7e 100644 --- a/resources/js/helpers/types.ts +++ b/resources/js/helpers/types.ts @@ -57,7 +57,7 @@ export const isUUID = (uuid: string): boolean => { * @returns {string} The bytes in human readable string. */ export const bytesReadable = (bytes: number): string => { - if (isNaN(bytes)) { + if (Number.isNaN(bytes)) { return "0 Bytes"; }