UNPKG

vuito

Version:

Simple, lightweight, isomorphic, and template-based validation library.

6 lines (4 loc) 184 B
import type { VRow } from '../types'; export default function (pattern: string | RegExp): VRow['test'] { return (value: string) => new RegExp(pattern).test((value || '').trim()); }