@itrocks/length
Version:
Decorators @Length, @MinLength, @MaxLength to enforce fixed or flexible string length limits on class properties
13 lines • 492 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MaxLength = MaxLength;
exports.maxLengthOf = maxLengthOf;
const property_1 = require("@itrocks/decorator/property");
const MAX_LENGTH = Symbol('maxLength');
function MaxLength(length) {
return (0, property_1.decorate)(MAX_LENGTH, length);
}
function maxLengthOf(target, property) {
return (0, property_1.decoratorOf)(target, property, MAX_LENGTH, undefined);
}
//# sourceMappingURL=max-length.js.map