@itrocks/length
Version:
Decorators @Length, @MinLength, @MaxLength to enforce fixed or flexible string length limits on class properties
14 lines • 551 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MaxLength = MaxLength;
exports.maxLengthOf = maxLengthOf;
const property_1 = require("@itrocks/decorator/property");
const property_2 = 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_2.decoratorOf)(target, property, MAX_LENGTH, undefined);
}
//# sourceMappingURL=max-length.js.map