Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/components / utils / validation.js
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = isEmailValidForWhitelist;

/**
 * Is validating inputs for the MultiEmailSelect component.
 * We need to allow domains and sub domains starting with a @ here as well
 * @param {String} string
 */
function isEmailValidForWhitelist(string) {
  var emailRE = new RegExp(/^(.*)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
  return emailRE.test(typeof string === 'string' && string || '');
}