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
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true});
var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
// src/asserts/string/uuidV5.ts
var uuidV5ErrorMessage = "The received value is not a valid UUID v5";
var uuidV5ErrorKey = "s:uuidV5";
var uuidV5Pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
var uuidV5 = () => (received, ctx) => {
if (!uuidV5Pattern.test(received)) {
ctx.addIssue("uuid v5", received, uuidV5ErrorKey);
}
};
uuidV5.key = uuidV5ErrorKey;
uuidV5.message = uuidV5ErrorMessage;
_chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, uuidV5);
exports.uuidV5 = uuidV5;
//# sourceMappingURL=chunk-SFIX77W5.js.map