UNPKG

reviewed

Version:

Ergonomic, extensible and lightweight validators.

9 lines (8 loc) 268 B
import { Validator } from "./validators"; export interface RegexResult<T extends string> { match: string; index: number; captured: string[]; named: Partial<Record<T, string>>; } export type RegexValidator<T extends string> = Validator<RegexResult<T>>;