import { escapeRegExp } from './escapeRegExp';

/**
 * Remove invalid characters
 */
export var removeInvalidChars = function removeInvalidChars(value, validChars) {
  var chars = escapeRegExp(validChars.join(''));
  var reg = new RegExp("[^\\d".concat(chars, "]"), 'gi');
  return value.replace(reg, '');
};