Returns the Ok value or throws if the result is Warn or Err.
const okValue = TernaryResult.ok('ready');assert.strictEqual(TernaryResult.unwrapThrow(okValue), 'ready');const throwTest = (): void => { TernaryResult.unwrapThrow(TernaryResult.warn('warn', 'warned'));};assert.throws(throwTest, /Expected Ok/u); Copy
const okValue = TernaryResult.ok('ready');assert.strictEqual(TernaryResult.unwrapThrow(okValue), 'ready');const throwTest = (): void => { TernaryResult.unwrapThrow(TernaryResult.warn('warn', 'warned'));};assert.throws(throwTest, /Expected Ok/u);
Returns the Ok value or throws if the result is Warn or Err.