Validates that the array contains at least one element.
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the nonempty validator applied
Validates that all elements in the array are unique.
For primitive elements, uses strict equality. For objects, pass a keyFn
that extracts a comparison key from each element.
OptionalkeyFn: (item: any) => unknownoptional function to extract a comparison key from each element
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the unique validator applied
Methods added to
ArraySchemaBuilderby the built-in array extension pack.WORKAROUND: This interface duplicates the method signatures from
arrayExtensionsso that JSDoc survives into the published.d.tsfiles. TypeScript strips JSDoc when method signatures are reconstructed through theFixedMethodsmapped type (conditionalinferloses comments). Remove this interface once TypeScript preserves JSDoc through mapped types / conditional type inference.See
https://github.com/microsoft/TypeScript/issues/50715