MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / mapError_

Function mapError_

packages/@contentlayer/utils/src/effect/These.ts:72–79  ·  view source on GitHub ↗
(self: These<E0, A>, f: (a: E0) => E)

Source from the content-addressed store, hash-verified

70}
71
72export function mapError_<E0, E, A>(self: These<E0, A>, f: (a: E0) => E): These<E, A> {
73 return foldM_(
74 self,
75 (a) => succeed(a),
76 (a, e) => warn(a, f(e)),
77 (e) => fail(f(e)),
78 )
79}
80
81export function mapError<E0, E>(f: (a: E0) => E): <A>(self: These<E0, A>) => These<E, A> {
82 return (self) => mapError_(self, f)

Callers 1

mapErrorFunction · 0.85

Calls 4

foldM_Function · 0.85
succeedFunction · 0.85
warnFunction · 0.85
failFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…