UNPKG

@itrocks/length

Version:

Decorators @Length, @MinLength, @MaxLength to enforce fixed or flexible string length limits on class properties

14 lines 547 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MinLength = MinLength; exports.minLengthOf = minLengthOf; const property_1 = require("@itrocks/decorator/property"); const property_2 = 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_2.decoratorOf)(target, property, MIN_LENGTH, 0); } //# sourceMappingURL=min-length.js.map