"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const web3_1 = __importDefault(require("web3"));
const lodash_1 = require("lodash");
exports.isNotEmpty = (value) => value !== '' && value !== null && typeof value !== 'undefined';
exports.isString = (value) => typeof value === 'string';
exports.isInt = (value) => Number.isInteger(value);
exports.isNumber = (value) => lodash_1.isNumber(value);
exports.numericality = ({ gt, gte, lt, lte }) => (value) => {
    if (gt !== undefined && value <= gt) {
        return false;
    }
    if (gte !== undefined && value < gte) {
        return false;
    }
    if (lt !== undefined && value >= lt) {
        return false;
    }
    if (lte !== undefined && value > lte) {
        return false;
    }
    return true;
};
exports.isEthereumAddress = (value) => web3_1.default.utils.isAddress(value);
exports.isDate = (value) => new Date(value).toString() !== 'Invalid Date';
//# sourceMappingURL=validators.js.map