@kerthin/domain
Version:
Kerthin Domain (based on DDD)
14 lines • 609 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsDecimal = void 0;
const isDecimal_1 = require("validator/lib/isDecimal");
const apply_validation_1 = require("./apply-validation");
const IsDecimal = (options, validationOptions) => (0, apply_validation_1.applyValidation)({
code: 'IS_DECIMAL',
defaultMessage: 'The value must be an decimal.',
validate: (value) => {
return typeof value === 'string' && (0, isDecimal_1.default)(value, options);
}
}, validationOptions);
exports.IsDecimal = IsDecimal;
//# sourceMappingURL=is-decimal.validator.js.map