@voiceflow/common 7.27.2 → 7.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getEmailDomain = exports.isValidEmail = void 0;
4
- const FORMAT = /^\w+(['+-.]\w+)*@\w+([.-]\w+)*\.\w+([.-]\w+)*$/;
5
- const isValidEmail = (email) => !!email.match(FORMAT);
4
+ const FORMAT = /^[\w!#$%&'*+./=?^`{|}~-]+@[\dA-Za-z](?:[\dA-Za-z-]{0,61}[\dA-Za-z])?(?:\.[\dA-Za-z](?:[\dA-Za-z-]{0,61}[\dA-Za-z])?)*$/;
5
+ const isValidEmail = (email) => email.length < 320 && FORMAT.test(email);
6
6
  exports.isValidEmail = isValidEmail;
7
7
  const getEmailDomain = (email) => email.slice(Math.max(0, email.lastIndexOf('@') + 1));
8
8
  exports.getEmailDomain = getEmailDomain;
@@ -1,3 +1,3 @@
1
- const FORMAT = /^\w+(['+-.]\w+)*@\w+([.-]\w+)*\.\w+([.-]\w+)*$/;
2
- export const isValidEmail = (email) => !!email.match(FORMAT);
1
+ const FORMAT = /^[\w!#$%&'*+./=?^`{|}~-]+@[\dA-Za-z](?:[\dA-Za-z-]{0,61}[\dA-Za-z])?(?:\.[\dA-Za-z](?:[\dA-Za-z-]{0,61}[\dA-Za-z])?)*$/;
2
+ export const isValidEmail = (email) => email.length < 320 && FORMAT.test(email);
3
3
  export const getEmailDomain = (email) => email.slice(Math.max(0, email.lastIndexOf('@') + 1));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@voiceflow/common",
3
3
  "description": "Junk drawer of utility functions",
4
- "version": "7.27.2",
4
+ "version": "7.27.3",
5
5
  "author": "Voiceflow",
6
6
  "bugs": {
7
7
  "url": "https://github.com/voiceflow/libs/issues"
@@ -78,5 +78,5 @@
78
78
  "test:single": "NODE_ENV=test ts-mocha --paths --config config/tests/mocharc.yml",
79
79
  "test:unit": "NODE_ENV=test nyc --report-dir=nyc_coverage_unit ts-mocha --paths --config config/tests/mocharc.yml 'tests/**/*.unit.ts'"
80
80
  },
81
- "gitHead": "097deb91076fee24e982436cb7d37f66a4e74d9e"
81
+ "gitHead": "aaef6e55ca6d58d392b421df752be011840163c0"
82
82
  }