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

Function getFailures

packages/effect/src/Record.ts:884–896  ·  view source on GitHub ↗
(
  self: ReadonlyRecord<K, Result<A, E>>
)

Source from the content-addressed store, hash-verified

882 * @since 4.0.0
883 */
884export const getFailures = <K extends string, A, E>(
885 self: ReadonlyRecord<K, Result<A, E>>
886): Record<ReadonlyRecord.NonLiteralKey<K>, E> => {
887 const out: Record<string, E> = empty()
888 for (const key of keys(self)) {
889 const value = self[key]
890 if (R.isFailure(value)) {
891 InternalRecord.assignProperty(out, key, value.failure)
892 }
893 }
894
895 return out
896}
897
898/**
899 * Returns a new record containing only the `Ok` values from a record of

Callers

nothing calls this directly

Calls 2

emptyFunction · 0.70
keysFunction · 0.70

Tested by

no test coverage detected