UNPKG

bguard

Version:

**bguard** is a powerful, flexible, and type-safe validation library for TypeScript. It allows developers to define validation schemas for their data structures and ensures that data conforms to the expected types and constraints.

21 lines (19 loc) 550 B
import { setToDefaultLocale } from "./chunk-OE3L7EKN.mjs"; // src/asserts/string/uuid.ts var uuidErrorMessage = "The received value is not a valid UUID"; var uuidErrorKey = "s:uuid"; var uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; var uuid = () => (received, ctx) => { if (!uuidPattern.test(received)) { ctx.addIssue("uuid", received, uuidErrorKey); } }; uuid.key = uuidErrorKey; uuid.message = uuidErrorMessage; setToDefaultLocale(uuid); export { uuid }; //# sourceMappingURL=chunk-2IPGGARK.mjs.map