@ukhomeoffice/cop-react-form-renderer 5.91.1 → 5.92.0

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.
@@ -7,6 +7,7 @@ exports.default = void 0;
7
7
  // eslint-disable-next-line no-control-regex
8
8
  // const EMAIL_REGEX = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i;
9
9
  var HODS_EMAIL_REGEX = /^[a-z0-9._\-']+@(digital\.)?homeoffice.gov.uk$/i;
10
+ var JMSC_EMAIL_REGEX = /^[a-z0-9._\-']+@jmsc.gov.uk$/i;
10
11
 
11
12
  /**
12
13
  * Validates an email address, ensuring it is in the correct domain and
@@ -26,7 +27,7 @@ var validateEmail = function validateEmail(value) {
26
27
  if (!!value) {
27
28
  var name = label ? label.toLowerCase() : 'email address';
28
29
  if (typeof value === 'string') {
29
- if (HODS_EMAIL_REGEX.test(value)) {
30
+ if (HODS_EMAIL_REGEX.test(value) || JMSC_EMAIL_REGEX.test(value)) {
30
31
  return undefined;
31
32
  }
32
33
  }
@@ -14,6 +14,9 @@ describe('utils', function () {
14
14
  it('should return no error when the value is a valid .gov.uk address', function () {
15
15
  expect((0, _validateEmail.default)('alpha@homeoffice.gov.uk', LABEL)).toBeUndefined();
16
16
  });
17
+ it('should return no error when the value is a valid jmsc.gov.uk address', function () {
18
+ expect((0, _validateEmail.default)('alpha@jmsc.gov.uk', LABEL)).toBeUndefined();
19
+ });
17
20
  it('should return no error when the value is a capitalised digital.homeoffice.gov.uk address', function () {
18
21
  expect((0, _validateEmail.default)('ALPHA.BRAVO@DIGITAL.HOMEOFFICE.GOV.UK', LABEL)).toBeUndefined();
19
22
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "5.91.1",
3
+ "version": "5.92.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",