(ok: boolean, x?: T | string | Error)
| 33 | readonly error?: string | Error; |
| 34 | |
| 35 | private constructor(ok: boolean, x?: T | string | Error) { |
| 36 | this.ok = ok; |
| 37 | if (ok) this.value = x as T; |
| 38 | else this.error = x as string | Error; |
| 39 | } |
| 40 | |
| 41 | static ok<T>(value: T): Result<T> { |
| 42 | return new Result<T>(true, value); |
nothing calls this directly
no outgoing calls
no test coverage detected