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

Function getSuccesses

packages/effect/src/Array.ts:3730–3741  ·  view source on GitHub ↗
(
  self: T
)

Source from the content-addressed store, hash-verified

3728 * @since 4.0.0
3729 */
3730export const getSuccesses = <T extends Iterable<Result.Result<any, any>>>(
3731 self: T
3732): Array<Result.Result.Success<ReadonlyArray.Infer<T>>> => {
3733 const out: Array<any> = []
3734 for (const a of self) {
3735 if (Result.isSuccess(a)) {
3736 out.push(a.success)
3737 }
3738 }
3739
3740 return out
3741}
3742
3743/**
3744 * Keeps transformed values for elements where a `Filter` succeeds.

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected