Skip to content

Instantly share code, notes, and snippets.

View ThallesP's full-sized avatar

Thalles Passos ThallesP

View GitHub Profile
@ThallesP
ThallesP / result.ts
Created February 26, 2025 16:34
Typescript Result like Rust
export class Err<O, E extends Error> {
readonly value: E
constructor(value: E) {
this.value = value
}
isOk(): this is Ok<O, E> {
return false
}