UNPKG

@webnotion-net/typescript-model-validator

Version:

Flexible and extensible library for validating data models in TypeScript

19 lines (18 loc) 519 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Max = /** @class */ (function () { function Max(max) { this.max = max; } Max.prototype.validate = function (data) { if (typeof data == 'undefined') { return false; } return data.length > this.max; }; Max.prototype.getErrorMessage = function () { return "Length must be less than ".concat(this.max, " characters"); }; return Max; }()); exports.default = Max;