Type guard for the Err variant.
const maybeErr = TernaryResult.err('boom') as TernaryResult< number, string, string>;if (TernaryResult.isErr(maybeErr)) { assert.strictEqual(maybeErr.value, 'boom');} Copy
const maybeErr = TernaryResult.err('boom') as TernaryResult< number, string, string>;if (TernaryResult.isErr(maybeErr)) { assert.strictEqual(maybeErr.value, 'boom');}
Type guard for the Err variant.