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

    Function required

    • Requires a value to be present.

      Rejects undefined outright, delegating anything else to the wrapped validator, so a mandatory property is reported as missing rather than passing unchecked.

      This is the only constraint that reports an absent value as missing: the value-domain validators assume a value to inspect, and a type guard hands a missing one to its unknown branch, which reports it as a type mismatch rather than as absent. Wrap the value-domain constraints of a mandatory property in this check to have absence reported.

      Type Parameters

      • T

        The type of the present value

      Parameters

      • validator: Modal<Validator<T>>

        The validator applied to a present value, omitted or disabled to accept any value

      Returns Validator<T | undefined>

      A validator reporting a violation if the value is absent, and the violations it incurs otherwise