UNPKG

621 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Length = void 0;
4const attribute_service_1 = require("../model/column/attribute-service");
5/**
6 * Only allow values with length between min and max
7 */
8function Length({ msg, min, max }) {
9 const length = [min || 0, max];
10 const options = msg
11 ? { args: length, msg: msg }
12 : length;
13 return (target, propertyName) => (0, attribute_service_1.addAttributeOptions)(target, propertyName, {
14 validate: {
15 len: options,
16 },
17 });
18}
19exports.Length = Length;
20//# sourceMappingURL=length.js.map
\No newline at end of file