UNPKG

@mub22/validity

Version:

Lightweight JavaScript validation library inspired by Laravel's rule syntax. Validate fields and forms easily with built-in rules and error messages.

5 lines (4 loc) 139 B
export default function numeric(value) { const regex = /^-?\d+(\.\d+)?$/; return typeof value === "string" && regex.test(value); }