UNPKG

nowjs-core

Version:

NowCanDo Javascript Core [nowjs-core] is a library written by TypeScript code maintains under Apache 2.0 licence

20 lines (19 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../index"); const index_2 = require("./index"); exports.VALIDATOR_GREATOREQUAL_METADATA_KEY = Symbol('validation:validator:isGreatOrEqualTo'); function isGreatOrEqualTo(anotherTarget, anotherPropertyName = '', errorMessage) { return (target, propertyKey, descriptor) => { const original = descriptor.value; Reflect.defineMetadata(exports.VALIDATOR_GREATOREQUAL_METADATA_KEY, null, target, propertyKey); Reflect.defineMetadata(index_1.VALIDATOR_METADATA_KEY, new GreatOrEqualToValidator(anotherTarget, anotherPropertyName, errorMessage), target, propertyKey); }; } exports.isGreatOrEqualTo = isGreatOrEqualTo; class GreatOrEqualToValidator extends index_2.CompareToValidatorBase { constructor(anotherTarget, anotherPropertyName = '', errorMessage = 'The value of ${DisplayName} must ${style} .') { super('GreatOrEqualTo', 'greatOrEqual', anotherTarget, anotherPropertyName, errorMessage); } } exports.GreatOrEqualToValidator = GreatOrEqualToValidator;