From ffe7f8547a1cee3b82769c54bcde7a6e56d4ce61 Mon Sep 17 00:00:00 2001 From: henrygd Date: Fri, 19 Sep 2025 11:51:27 -0400 Subject: [PATCH] fix: update temperature and byte formatting functions to use loose equality checks (#1180) --- internal/site/src/lib/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/site/src/lib/utils.ts b/internal/site/src/lib/utils.ts index a349b830..d5b36eca 100644 --- a/internal/site/src/lib/utils.ts +++ b/internal/site/src/lib/utils.ts @@ -179,8 +179,8 @@ export function formatTemperature(celsius: number, unit?: Unit): { value: number if (!unit) { unit = $userSettings.get().unitTemp || Unit.Celsius } - // need loose equality check due to form data being strings - if (unit === Unit.Fahrenheit) { + // biome-ignore lint/suspicious/noDoubleEquals: need loose equality check due to form data being strings + if (unit == Unit.Fahrenheit) { return { value: celsius * 1.8 + 32, unit: "°F", @@ -202,8 +202,8 @@ export function formatBytes( // Convert MB to bytes if isMegabytes is true if (isMegabytes) size *= 1024 * 1024 - // need loose equality check due to form data being strings - if (unit === Unit.Bits) { + // biome-ignore lint/suspicious/noDoubleEquals: need loose equality check due to form data being strings + if (unit == Unit.Bits) { const bits = size * 8 const suffix = perSecond ? "ps" : "" if (bits < 1000) return { value: bits, unit: `b${suffix}` }