@metreeca/core - v0.9.22
    Preparing search index...

    Function fail

    • Rejects every value.

      Reports the given violation whatever the value, closing a branch reached only by values already known to be illegal, for instance the unknown branch of a type split.

      The violation is stated either outright or as a function computing it from the rejected value; a computed trace is built only if a value is actually rejected, so wording that inspects the value costs nothing on the passing path.

      Type Parameters

      • T

        The type of the rejected value

      Parameters

      • trace: Trace | ((value: T) => Trace)

        The Trace wording the violation, or a function computing it from the rejected value

      Returns Validator<T>

      A validator reporting a violation for every value