From 9ea34c5169cad13d646eb4455894c1a685c6923a Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 27 Jan 2026 15:05:03 +0000 Subject: [PATCH] `Result`: Make use of type hint --- lib/init-action.js | 2 +- src/util.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index e77bae91c..164428e29 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -87212,7 +87212,7 @@ var Result = class _Result { return !this._ok; } orElse(defaultValue) { - return this._ok ? this.value : defaultValue; + return this.isOk() ? this.value : defaultValue; } }; diff --git a/src/util.ts b/src/util.ts index fc11b86b2..2e2bd0511 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1319,6 +1319,6 @@ export class Result { } orElse(defaultValue: T): T { - return this._ok ? (this.value as T) : defaultValue; + return this.isOk() ? this.value : defaultValue; } }