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

Method isResult

src/common/result.ts:70–79  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

68 }
69
70 static isResult<T>(value: any): value is Result<T> {
71 return (
72 (value &&
73 typeof value === 'object' &&
74 'ok' in value &&
75 value.ok === true &&
76 'value' in value) ||
77 (value.ok === false && 'error' in value)
78 );
79 }
80
81 static resultToString<T>(result: Result<T>): string {
82 if (result.ok) {

Callers 1

fromMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected