MCPcopy
hub / github.com/supermacro/neverthrow / myFunc

Function myFunc

tests/safe-try.test.ts:142–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140
141 test("mayFail2 error", () => {
142 function myFunc(): Result<number, string> {
143 return safeTry<number, string>(function*() {
144 return ok(
145 (yield* good()
146 .mapErr(e => `1st, ${e}`)
147 .safeUnwrap())
148 +
149 (yield* bad()
150 .mapErr(e => `2nd, ${e}`)
151 .safeUnwrap())
152 )
153 })
154 }
155
156 const result = myFunc()
157 expect(result.isErr()).toBe(true)

Callers 1

safe-try.test.tsFile · 0.85

Calls 11

safeTryFunction · 0.90
okFunction · 0.90
okAsyncFunction · 0.90
goodFunction · 0.85
badFunction · 0.85
promiseBadFunction · 0.85
asyncGoodFunction · 0.85
promiseGoodFunction · 0.85
asyncBadFunction · 0.85
safeUnwrapMethod · 0.65
mapErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…