Unwraps the Ok value or throws with the provided message.
const okValue = TernaryResult.ok('ready');assert.strictEqual(TernaryResult.expectToBe(okValue, 'missing'), 'ready');const expectResult = TernaryResult.expectToBe('needs value');const throwTest = (): void => { expectResult(TernaryResult.err('oops'));};assert.throws(throwTest, /needs value/u); Copy
const okValue = TernaryResult.ok('ready');assert.strictEqual(TernaryResult.expectToBe(okValue, 'missing'), 'ready');const expectResult = TernaryResult.expectToBe('needs value');const throwTest = (): void => { expectResult(TernaryResult.err('oops'));};assert.throws(throwTest, /needs value/u);
Unwraps the Ok value or throws with the provided message.