Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1x 15x 1740x 1755x 14x 494x | export class Result<V, E> {
public static err<V, E>(error: E) {
return new Result<V, E>(undefined, error);
}
public static ok<V, E>(value: V) {
return new Result<V, E>(value);
}
constructor(readonly value?: V, readonly error?: E) {}
public get isOk(): boolean {
return this.value !== undefined;
}
public get isErr(): boolean {
return this.error !== undefined;
}
}
|