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