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

    Function nullable

    • Makes a validator tolerant of null values.

      Accepts null unconditionally, delegating anything else to the wrapped validator, so an explicitly emptied property is constrained only when actually filled.

      Type Parameters

      • T

        The type of the present value

      Parameters

      • validator: Modal<Validator<T>>

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

      Returns Validator<T | null>

      A validator reporting the violations a present value incurs