@spinnaker/core 0.19.2 → 0.19.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spinnaker/core",
3
3
  "license": "Apache-2.0",
4
- "version": "0.19.2",
4
+ "version": "0.19.3",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "scripts": {
@@ -120,5 +120,5 @@
120
120
  "shx": "0.3.3",
121
121
  "typescript": "4.3.5"
122
122
  },
123
- "gitHead": "3ea12b48839ff145c4a602d489507f317b06f856"
123
+ "gitHead": "4e2ec409f093985f4c084f8140c650f29bb9009b"
124
124
  }
@@ -4,11 +4,15 @@ import { robotToHuman } from '../../robotToHumanFilter/robotToHuman.filter';
4
4
  import type { IValidator } from './validation';
5
5
 
6
6
  const THIS_FIELD = 'This field';
7
+ // RCF 5322 Email Validation Regex taken from https://emailregex.com/
8
+ const VALID_EMAIL_REGEX = new RegExp(
9
+ '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[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,}))$',
10
+ );
7
11
 
8
12
  const emailValue = (message?: string): IValidator => {
9
13
  return function emailValue(val: string, label = THIS_FIELD) {
10
14
  message = message || `${label} is not a valid email address.`;
11
- return val && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(val) && message;
15
+ return val && !VALID_EMAIL_REGEX.test(val) && message;
12
16
  };
13
17
  };
14
18