"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get VALIDATOR_TYPE () {
        return VALIDATOR_TYPE;
    },
    get numericValidator () {
        return numericValidator;
    }
});
const _number = require("../../helpers/number");
const VALIDATOR_TYPE = 'numeric';
function numericValidator(value, callback) {
    let valueToValidate = value;
    if (valueToValidate === null || valueToValidate === undefined) {
        valueToValidate = '';
    }
    if (this.allowEmpty && valueToValidate === '') {
        callback(true);
    } else if (valueToValidate === '') {
        callback(false);
    } else {
        callback((0, _number.isNumeric)(value));
    }
}
numericValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;
