MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / constructor

Method constructor

src/common/result.ts:35–39  ·  view source on GitHub ↗
(ok: boolean, x?: T | string | Error)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected