Used to check if a result is an Ok.
Ok
const result: Result<number, string> = ok(1);const isOkResult: boolean = isOk(result); // true Copy
const result: Result<number, string> = ok(1);const isOkResult: boolean = isOk(result); // true
if (isOk(result)) { // We now know that the result is an Ok // so we can safely use it const value: number = unwrap(result); // 1} Copy
if (isOk(result)) { // We now know that the result is an Ok // so we can safely use it const value: number = unwrap(result); // 1}
Used to check if a result is an
Ok.