text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const indicative_utils_1 = require("indicative-utils");
  const under_1 = require("../../raw/under");
  const MISSING_VALUE = 'under:make sure to define max value';
  const INVALID_TYPE = 'under:max value must be defined as an integer';
  const validation = {
      async: false,
      compile(args) {
          indicative_utils_1.ensureLength(args, MISSING_VALUE, 1);
          const minValue = indicative_utils_1.cast(args[0], 'float', INVALID_TYPE);
          return [minValue];
      },
      validate: (data, field, [maxValue], config) => {
          let fieldValue = indicative_utils_1.getValue(data, field);
          return indicative_utils_1.skippable(fieldValue, field, config) || under_1.under(fieldValue, maxValue);
      },
  };
  exports.default = validation;
  