method Result.prototype.match Result.prototype.match<U>(pattern: { ok: (value: T) => U; err: (error: E) => U; }): U Pattern matching for Results - handle both Ok and Err cases. Examples Example 1 const message = result.match({ ok: (value) => `Success: ${value}`, err: (error) => `Error: ${error.message}` }); Type Parameters U The type of the return value Parameters pattern: { ok: (value: T) => U; err: (error: E) => U; } Object with ok and err handler functions Return Type U The result of calling either the ok or err handler