// #region Imports
// #endregion
/**
 * Validator that requires the control's value to be numeric.
 *
 * State:
 * * badInput
 *
 * @public
 * @param control
 * @returns null if the validation check passes, otherwise an object containing information.
 */
export function numericValidator(control) {
    return isNumericValue(control.value)
        ? null
        : {
            badInput: [
                true, { actualValue: control.value }
            ]
        };
}
/**
 * Checks if the value is numeric.
 *
 * @param value - The value to check.
 * @returns True if the value is numeric, false otherwise.
 */
export function isNumericValue(value) {
    return typeof value === 'number' || (typeof value === 'string' && !Number.isNaN(+value));
}
//# sourceMappingURL=NumericElementValidatorFn.js.map