MCPcopy Create free account
hub / github.com/Effect-TS/effect / attempt

Function attempt

packages/effect/src/SemVer.ts:94–101  ·  view source on GitHub ↗
(evaluate: () => A)

Source from the content-addressed store, hash-verified

92}
93
94const attempt = <A>(evaluate: () => A): Result.Result<A, SemVerError> =>
95 Result.try({
96 try: evaluate,
97 catch: (error) => {
98 if (!isSemVerError(error)) throw error
99 return error
100 }
101 })
102
103/** @internal */
104export const tryParse = <A>(

Callers 2

tryParseFunction · 0.70
fromInputFunction · 0.70

Calls 1

isSemVerErrorFunction · 0.85

Tested by

no test coverage detected