@modular-forms/react
Version:
The modular and type-safe form library for React
13 lines (12 loc) • 440 B
TypeScript
import type { MaybeValue } from '../types';
type Value = MaybeValue<string | string[] | number[] | File[]>;
/**
* Creates a validation functions that validates the length of a string or array.
*
* @param requirement The maximum string or array length.
* @param error The error message.
*
* @returns A validation function.
*/
export declare function maxLength(requirement: number, error: string): (value: Value) => string;
export {};