From 66d0f1790f1e5d9fa3c38ff975b1e0e0853f1b70 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 19 Apr 2024 11:59:14 -0400 Subject: [PATCH] fixup --- dist/index.js | 4 ++-- dist/platform.js | 4 ++-- src/platform.ts | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1acd066..771cc1f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -95322,8 +95322,8 @@ const getMacOsInfo = async () => { }; function getPropertyViaWithDefault(data, names, defaultValue) { for (const name of names) { - const ret = getPropertyWithDefault(data, name, undefined); - if (ret !== undefined) { + const ret = getPropertyWithDefault(data, name, defaultValue); + if (ret !== defaultValue) { return ret; } } diff --git a/dist/platform.js b/dist/platform.js index 90c52d5..9022b7d 100644 --- a/dist/platform.js +++ b/dist/platform.js @@ -29,8 +29,8 @@ const getMacOsInfo = async () => { }; function getPropertyViaWithDefault(data, names, defaultValue) { for (const name of names) { - const ret = getPropertyWithDefault(data, name, undefined); - if (ret !== undefined) { + const ret = getPropertyWithDefault(data, name, defaultValue); + if (ret !== defaultValue) { return ret; } } diff --git a/src/platform.ts b/src/platform.ts index 59e2091..cb5fd7c 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -52,8 +52,9 @@ function getPropertyViaWithDefault( defaultValue: T, ): T { for (const name of names) { - const ret: T | undefined = getPropertyWithDefault(data, name, undefined); - if (ret !== undefined) { + const ret: T = getPropertyWithDefault(data, name, defaultValue); + + if (ret !== defaultValue) { return ret; } }