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

    Function size

    • Constrains the size of an array or object.

      Counts the elements of an array or the properties of an object, so cardinality is stated the same way for either. Bounds are inclusive; an undefined bound leaves the corresponding end unconstrained.

      Parameters

      • min: number | undefined

        The minimum accepted number of elements or properties, or undefined for no lower bound

      • max: number | undefined

        The maximum accepted number of elements or properties, or undefined for no upper bound

      Returns Validator<readonly unknown[] | Record<string, unknown>>

      A validator reporting a violation if the count falls outside the bounds