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) • 652 B
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true});
var _chunkTJQ5NVL4js = require('./chunk-TJQ5NVL4.js');
// 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;
_chunkTJQ5NVL4js.setToDefaultLocale.call(void 0, uuid);
exports.uuid = uuid;
//# sourceMappingURL=chunk-62EKGBXF.js.map