"use strict";
Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.notAllSpaceValidate = exports.textIsNumValidate = exports.textFirstValueValidate = exports.textValueValidate = exports.objOfStrPropTrim = exports.noSpaceLengthValidate = exports.textLengthValidate = void 0;
var _amosTool = require("amos-tool");

function _typeof(t) {
  return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
    return typeof t
  } : function(t) {
    return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  })(t)
}
var textLengthValidate = function(a, n) {
  return function(t, e, o) {
    e && ((0, _amosTool.trim)(e).length > a ? o("长度不能大于".concat(a)) : n && (0, _amosTool.trim)(e).length < n ? o("长度不能小于".concat(n)) : o()), o()
  }
};
exports.textLengthValidate = textLengthValidate;
var noSpaceLengthValidate = function(a, n, r) {
  return function(t, e, o) {
    e && (e = (0, _amosTool.trim)(e).length, n && 0 === e && o(r), a && a <= e && o("长度范围为".concat(a, "！"))), o()
  }
};
exports.noSpaceLengthValidate = noSpaceLengthValidate;
var objOfStrPropTrim = function(e) {
  return "object" === _typeof(e) && Object.keys(e).forEach(function(t) {
    "string" == typeof e[t] && (e[t] = (0, _amosTool.trim)(e[t]))
  }), e
};
exports.objOfStrPropTrim = objOfStrPropTrim;
var textValueValidate = function(a, n) {
  return function(t, e, o) {
    e && (/^-?\d+\.?\d*$/.test(e) ? a < e ? o("输入的值不能大于".concat(a)) : n && n < a && e < n ? o("输入的值不能小于".concat(n)) : o() : o("请输入正确的数值格式")), o()
  }
};
exports.textValueValidate = textValueValidate;
var textFirstValueValidate = function(a) {
  return function(t, e, o) {
    e && (/^[1-9]\d*$/.test(e) ? a && (0, _amosTool.trim)(e).length < a && o("长度不能小于".concat(a)) : o("输入的值第一位不能为0")), o()
  }
};
exports.textFirstValueValidate = textFirstValueValidate;
var textIsNumValidate = function(a) {
  return function(t, e, o) {
    e && (/^-?\d+\.?\d*$/.test(e) ? a && e < a ? o("输入的值不能小于".concat(a)) : o() : o("只能输入数字")), o()
  }
};
exports.textIsNumValidate = textIsNumValidate;
var notAllSpaceValidate = function(a) {
  return function(t, e, o) {
    e && 0 === (0, _amosTool.trim)(e).length && o(a), o()
  }
};
exports.notAllSpaceValidate = notAllSpaceValidate;
