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 (16 loc) 695 B
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js'); // src/asserts/string/uuidV4.ts var uuidV4ErrorMessage = "The received value is not a valid UUID v4"; var uuidV4ErrorKey = "s:uuidV4"; var uuidV4Pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; var uuidV4 = () => (received, ctx) => { if (!uuidV4Pattern.test(received)) { ctx.addIssue("uuid v4", received, uuidV4ErrorKey); } }; uuidV4.key = uuidV4ErrorKey; uuidV4.message = uuidV4ErrorMessage; _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, uuidV4); exports.uuidV4 = uuidV4; //# sourceMappingURL=chunk-R25HSJPH.js.map