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/uuidV1.ts var uuidV1ErrorMessage = "The received value is not a valid UUID v1"; var uuidV1ErrorKey = "s:uuidV1"; var uuidV1Pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; var uuidV1 = () => (received, ctx) => { if (!uuidV1Pattern.test(received)) { ctx.addIssue("uuid v1", received, uuidV1ErrorKey); } }; uuidV1.key = uuidV1ErrorKey; uuidV1.message = uuidV1ErrorMessage; _chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, uuidV1); exports.uuidV1 = uuidV1; //# sourceMappingURL=chunk-H4OW6OUF.js.map