Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cortex-js/compute-engine
/ map
Method
map
src/common/result.ts:131–134 ·
view source on GitHub ↗
(fn: (value: T) => U)
Source
from the content-addressed store, hash-verified
129
}
130
131
map<U>(fn: (value: T) => U): Result<U> {
132
if
(this.ok)
return
Result.ok(fn(this.value as T));
133
return
Result.err(this.error as string);
134
}
135
136
/** Useful
for
debugging, e.g.
137
* ```typescript
Callers
nothing calls this directly
Calls
3
fn
Function · 0.85
ok
Method · 0.80
err
Method · 0.80
Tested by
no test coverage detected