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

Method from

src/common/result.ts:49–60  ·  view source on GitHub ↗
(values: Iterable<T | Result<T>>)

Source from the content-addressed store, hash-verified

47 }
48
49 static from<T>(values: Iterable<T | Result<T>>): Result<T>[] {
50 const result: Result<T>[] = [];
51 for (const value of values) {
52 if (Result.isResult(value)) {
53 if (!value.ok) return [value];
54 result.push(value);
55 } else {
56 result.push(Result.ok(value));
57 }
58 }
59 return result;
60 }
61
62 isOk(result: Result<T>): result is Result<T> & { ok: true } {
63 return result.ok;

Callers 14

timeout.test.tsFile · 0.45
dictionary.test.tsFile · 0.45
statistics.test.tsFile · 0.45
heavyPatFunction · 0.45
longSumFunction · 0.45
buildCategoriesFunction · 0.45
levenshteinFunction · 0.45
escapeJsonStringFunction · 0.45
f1-matcher-gate.tsFile · 0.45

Calls 2

isResultMethod · 0.80
okMethod · 0.80

Tested by 2

heavyPatFunction · 0.36
longSumFunction · 0.36