expensify-common 2.0.158 → 2.0.159

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.
Files changed (2) hide show
  1. package/dist/str.js +5 -0
  2. package/package.json +3 -1
package/dist/str.js CHANGED
@@ -40,6 +40,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
40
40
  /* eslint-disable no-control-regex */
41
41
  const jquery_1 = __importDefault(require("jquery"));
42
42
  const awesome_phonenumber_1 = require("awesome-phonenumber");
43
+ const punycode_1 = __importDefault(require("punycode/"));
43
44
  const HtmlEntities = __importStar(require("html-entities"));
44
45
  const Constants = __importStar(require("./CONST"));
45
46
  const UrlPatterns = __importStar(require("./Url"));
@@ -394,6 +395,10 @@ const Str = {
394
395
  * @returns True if the string is an email
395
396
  */
396
397
  isValidEmail(str) {
398
+ const unicodeVersion = punycode_1.default.toUnicode(str);
399
+ if (String(unicodeVersion).match(Constants.CONST.REG_EXP.EMOJI_RULE)) {
400
+ return false;
401
+ }
397
402
  return !!String(str).match(Constants.CONST.REG_EXP.EMAIL);
398
403
  },
399
404
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.158",
3
+ "version": "2.0.159",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",
@@ -36,6 +36,7 @@
36
36
  "localforage": "^1.10.0",
37
37
  "lodash": "4.17.21",
38
38
  "prop-types": "15.8.1",
39
+ "punycode": "^2.3.1",
39
40
  "react": "16.12.0",
40
41
  "react-dom": "16.12.0",
41
42
  "semver": "^7.6.3",
@@ -49,6 +50,7 @@
49
50
  "@types/jest": "^29.5.13",
50
51
  "@types/jquery": "^3.5.30",
51
52
  "@types/lodash": "^4.17.10",
53
+ "@types/punycode": "^2.1.4",
52
54
  "@types/react-dom": "^18.3.5",
53
55
  "@types/ua-parser-js": "^0.7.39",
54
56
  "@typescript-eslint/eslint-plugin": "^8.26.1",