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

Function getFailures

packages/effect/src/Iterable.ts:1751–1769  ·  view source on GitHub ↗
(self: Iterable<Result<R0, L>>)

Source from the content-addressed store, hash-verified

1749 * @since 4.0.0
1750 */
1751export const getFailures = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<L> => {
1752 return {
1753 [Symbol.iterator]() {
1754 const iterator = self[Symbol.iterator]()
1755 return {
1756 next() {
1757 let result = iterator.next()
1758 while (!result.done) {
1759 if (R.isFailure(result.value)) {
1760 return { done: false, value: result.value.failure }
1761 }
1762 result = iterator.next()
1763 }
1764 return { done: true, value: undefined }
1765 }
1766 }
1767 }
1768 }
1769}
1770
1771/**
1772 * Returns a lazy iterable containing the success values from an iterable of

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected