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; } }