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

Function causePartition

packages/effect/src/internal/effect.ts:280–296  ·  view source on GitHub ↗
(
  self: Cause.Cause<E>
)

Source from the content-addressed store, hash-verified

278
279/** @internal */
280export const causePartition = <E>(
281 self: Cause.Cause<E>
282): {
283 readonly Fail: ReadonlyArray<Cause.Fail<E>>
284 readonly Die: ReadonlyArray<Cause.Die>
285 readonly Interrupt: ReadonlyArray<Cause.Interrupt>
286} => {
287 const obj = {
288 Fail: [] as Array<Cause.Fail<E>>,
289 Die: [] as Array<Cause.Die>,
290 Interrupt: [] as Array<Cause.Interrupt>
291 }
292 for (let i = 0; i < self.reasons.length; i++) {
293 obj[self.reasons[i]._tag].push(self.reasons[i] as any)
294 }
295 return obj
296}
297
298/** @internal */
299export const causeSquash = <E>(self: Cause.Cause<E>): unknown => {

Callers 1

causeSquashFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected