Function array

Requires an array. Element validation is optional.

Because validation of very long arrays can be prohibitively expensive in some cases, one may use the maxEntriesToValidate option to limit the limit that are actually validated. Note however, that maxEntriesToValidate is ignored if needed transformation is required within the array elements, for example with an array of dates where the dates need to be serialized or deserialized.

  • Type Parameters

    • ItemT = any

    Parameters

    • Optionalargs: {
          items?: Schema<ItemT>;
          maxEntriesToValidate?: number;
          maxLength?: number;
          minLength?: number;
      }

    Returns ArraySchema<ItemT>