all files / src/ email.js

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14         15×          
import { regFormat } from './helpers'
 
// eslint-disable-next-line no-useless-escape
const REG_EMAIL = /^[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i
 
// Uses "regFormat" internally which is already memoized
let email = regFormat(function () {
  return REG_EMAIL
}, 'email')
 
email.REG_EMAIL = REG_EMAIL
 
export default email