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

Function getFailures

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

Source from the content-addressed store, hash-verified

840 * @since 4.0.0
841 */
842export const getFailures = <K extends string, A, E>(
843 self: ReadonlyRecord<K, Result<A, E>>
844): Record<ReadonlyRecord.NonLiteralKey<K>, E> => {
845 const out: Record<string, E> = empty()
846 for (const key of keys(self)) {
847 const value = self[key]
848 if (R.isFailure(value)) {
849 InternalRecord.assignProperty(out, key, value.failure)
850 }
851 }
852
853 return out
854}
855
856/**
857 * 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