@modular-forms/react
Version:
The modular and type-safe form library for React
13 lines (12 loc) • 382 B
TypeScript
import type { MaybeValue } from '../types';
type Value = MaybeValue<string>;
/**
* Creates a validation functions that validates the pattern of a string.
*
* @param requirement The regex pattern.
* @param error The error message.
*
* @returns A validation function.
*/
export declare function pattern(requirement: RegExp, error: string): (value: Value) => string;
export {};