Interface DecodingFailure

Represents a decoding with a decoding error.

interface DecodingFailure {
    errors: DecodingErrors;
    failed: true;
    reason: string;
    success: false;
    concat(errors): DecodingErrors;
    foreach(fun): void;
    map<T>(fun): T[];
}

Hierarchy (view full)

Properties

failed: true
reason: string
success: false

Methods

  • Apply an operation on every decoding error and an array of paths where that error occurred.

    Parameters

    • fun: ((message, paths) => void)

      operation

        • (message, paths): void
        • Parameters

          • message: string
          • paths: Path[]

          Returns void

    Returns void

  • Transform decoding errors by applying a transformer on every error and an array of paths where that error occurred.

    Type Parameters

    • T

      type of transformation result

    Parameters

    • fun: ((message, paths) => T)

      transformer function

        • (message, paths): T
        • Parameters

          • message: string
          • paths: Path[]

          Returns T

    Returns T[]

Generated using TypeDoc