@itrocks/length
Version:
Decorators @Length, @MinLength, @MaxLength to enforce fixed or flexible string length limits on class properties
21 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.minLengthOf = exports.MinLength = exports.maxLengthOf = exports.MaxLength = void 0;
exports.Length = Length;
exports.lengthOf = lengthOf;
const property_1 = require("@itrocks/decorator/property");
const property_2 = require("@itrocks/decorator/property");
var max_length_1 = require("./max-length");
Object.defineProperty(exports, "MaxLength", { enumerable: true, get: function () { return max_length_1.MaxLength; } });
Object.defineProperty(exports, "maxLengthOf", { enumerable: true, get: function () { return max_length_1.maxLengthOf; } });
var min_length_1 = require("./min-length");
Object.defineProperty(exports, "MinLength", { enumerable: true, get: function () { return min_length_1.MinLength; } });
Object.defineProperty(exports, "minLengthOf", { enumerable: true, get: function () { return min_length_1.minLengthOf; } });
const LENGTH = Symbol('length');
function Length(length) {
return (0, property_1.decorate)(LENGTH, length);
}
function lengthOf(target, property) {
return (0, property_2.decoratorOf)(target, property, LENGTH);
}
//# sourceMappingURL=length.js.map