This commit is contained in:
Graham Christensen 2024-04-19 11:59:14 -04:00
parent 2e9d44ddf6
commit 66d0f1790f
3 changed files with 7 additions and 6 deletions

4
dist/index.js generated vendored
View file

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

4
dist/platform.js generated vendored
View file

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

View file

@ -52,8 +52,9 @@ function getPropertyViaWithDefault<T, Property extends string>(
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;
}
}