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) • 591 B
JavaScript
import {
setToDefaultLocale
} from "./chunk-OE3L7EKN.mjs";
// 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;
setToDefaultLocale(uuidV1);
export {
uuidV1
};
//# sourceMappingURL=chunk-22254THF.mjs.map