Type Parameters
- T extends NonUndefined
- E extends NonUndefined
Returns val is OkResult<T, never>
true if the provided Result is an OkResult, false otherwise.
Example
const result = Ok('Success');
if (isOk(result)) {
console.log('Operation was successful:', result.unwrap());
}
Type guard to check if a Result is an Ok value. This function is used to narrow down the type of a Result to OkResult in TypeScript type system.