From a2856cdfd2017032223b09e669d54d4c456ac69f Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 24 Apr 2024 11:13:40 -0300 Subject: [PATCH] Prefer coalescing over or-ing --- dist/index.js | 4 ++-- dist/main.js | 4 ++-- src/main.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 19d5fc2..a46abe5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97933,7 +97933,7 @@ class NixInstallerAction { executionEnv.NIX_INSTALLER_SSL_CERT_FILE = this.sslCertFile; } executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = - this.idslib.getDiagnosticsUrl()?.toString() || ""; + this.idslib.getDiagnosticsUrl()?.toString() ?? ""; // TODO: Error if the user uses these on not-MacOS if (this.macEncrypt !== null) { if (runnerOs !== "macOS") { @@ -98383,7 +98383,7 @@ class NixInstallerAction { if (job === undefined) { return "no-jobs"; } - const outcomes = (job.steps || []).map((j) => j.conclusion || "unknown"); + const outcomes = (job.steps ?? []).map((j) => j.conclusion ?? "unknown"); // Possible values: success, failure, cancelled, or skipped // from: https://docs.github.com/en/actions/learn-github-actions/contexts if (outcomes.includes("failure")) { diff --git a/dist/main.js b/dist/main.js index e3726fb..a202cc8 100644 --- a/dist/main.js +++ b/dist/main.js @@ -269,7 +269,7 @@ class NixInstallerAction { executionEnv.NIX_INSTALLER_SSL_CERT_FILE = this.sslCertFile; } executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = - this.idslib.getDiagnosticsUrl()?.toString() || ""; + this.idslib.getDiagnosticsUrl()?.toString() ?? ""; // TODO: Error if the user uses these on not-MacOS if (this.macEncrypt !== null) { if (runnerOs !== "macOS") { @@ -719,7 +719,7 @@ class NixInstallerAction { if (job === undefined) { return "no-jobs"; } - const outcomes = (job.steps || []).map((j) => j.conclusion || "unknown"); + const outcomes = (job.steps ?? []).map((j) => j.conclusion ?? "unknown"); // Possible values: success, failure, cancelled, or skipped // from: https://docs.github.com/en/actions/learn-github-actions/contexts if (outcomes.includes("failure")) { diff --git a/src/main.ts b/src/main.ts index 4619072..085a246 100644 --- a/src/main.ts +++ b/src/main.ts @@ -360,7 +360,7 @@ class NixInstallerAction { } executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = - this.idslib.getDiagnosticsUrl()?.toString() || ""; + this.idslib.getDiagnosticsUrl()?.toString() ?? ""; // TODO: Error if the user uses these on not-MacOS if (this.macEncrypt !== null) { @@ -921,7 +921,7 @@ class NixInstallerAction { return "no-jobs"; } - const outcomes = (job.steps || []).map((j) => j.conclusion || "unknown"); + const outcomes = (job.steps ?? []).map((j) => j.conclusion ?? "unknown"); // Possible values: success, failure, cancelled, or skipped // from: https://docs.github.com/en/actions/learn-github-actions/contexts