Safely unwraps the Err value.
const errValue = TernaryResult.err('fail');const okValue = TernaryResult.ok('value');assert.strictEqual(TernaryResult.unwrapErr(errValue), 'fail');// eslint-disable-next-line @typescript-eslint/no-confusing-void-expressionassert.strictEqual(TernaryResult.unwrapErr(okValue), undefined); Copy
const errValue = TernaryResult.err('fail');const okValue = TernaryResult.ok('value');assert.strictEqual(TernaryResult.unwrapErr(errValue), 'fail');// eslint-disable-next-line @typescript-eslint/no-confusing-void-expressionassert.strictEqual(TernaryResult.unwrapErr(okValue), undefined);
Safely unwraps the Err value.