This package provides a function checking that a given email address is compatible with Salesforce. It follows the salesforce format for the local part and Mozilla regex for the domain part of the email address.
In order to be compatible with Salesforce the RFC 6532 is not fully implemented and email addresses with accents or other special characters will be rejected.
Unlike Salesforce, it does not accept comments; for example john.doe@(comment)example.com, and john.doe@example.com(comment) are allowed by salesforce but rejected by this module.
With npm:
npm install salesforce-email
Or with yarn
yarn add salesforce-email
import { isValidEmail } from 'salesforce-email'
console.log(isValidEmail('foo@bar.com')) // true