hmpo-form-wizard 14.1.0 → 15.0.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.
@@ -23,7 +23,7 @@ let validators = {
23
23
  },
24
24
 
25
25
  email(value) {
26
- return value === '' || validators.regex(value, /^[a-z0-9._%+-]+@([a-z0-9]+([a-z0-9-]*[a-z0-9]+)?\.)+[a-z]{2,6}$/i);
26
+ return value === '' || validators.regex(value, /^(?!.*\.\.)[a-z0-9_%+-](?:[a-z0-9._%+-]*[a-z0-9_%+-])?@([a-z0-9]+([a-z0-9-]*[a-z0-9]+)?\.)+[a-z]{2,6}$/i);
27
27
  },
28
28
 
29
29
  minlength(value, length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hmpo-form-wizard",
3
- "version": "14.1.0",
3
+ "version": "15.0.0",
4
4
  "description": "Routing and request handling for a multi-step form processes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -64,15 +64,46 @@ describe('validators', () => {
64
64
  null,
65
65
  'asdf.com',
66
66
  'asdf.',
67
+ '.asdf',
68
+ '.asdf.',
67
69
  'asdf@com.',
70
+ 'asdf@.com',
68
71
  'asdf@.com.',
72
+ '@com',
69
73
  '@.com',
70
74
  '@com.',
75
+ '@.com.',
76
+ '@example.com',
71
77
  'test.com@',
72
78
  'test@test@test.com',
79
+ 'test@@test.com',
80
+ '.test@example.com',
81
+ 'test.@example.com',
82
+ '.test.@example.com',
83
+ 'user..name@example.com',
73
84
  'test@.example.com',
85
+ 'test@example.com.',
86
+ 'test@.example.com.',
87
+ 'test@example..com',
88
+ 'test@exa mple.com',
89
+ 'te st@example.com',
90
+ 'test@x',
91
+ 'test@example.x',
92
+ 'test@somewhere',
93
+ 'test@example.somewhere',
74
94
  'test@example-.com',
75
- 'test@-.com'
95
+ 'test@-.com',
96
+ 'test@example,com',
97
+ 'test@example com',
98
+ '<test>@example.com',
99
+ 'user,name@example.com',
100
+ 'user`name@example.com',
101
+ 'user\'name@example.com',
102
+ ' test@example.com',
103
+ 'test @example.com',
104
+ 'test@example.com ',
105
+ 'test!#$%&\'*+/=?^_`{|}~@example.com',
106
+ 'test@example.com<'
76
107
  ];
77
108
  _.each(inputs, i => {
78
109
  it(testName(i), () => {
@@ -86,6 +117,9 @@ describe('validators', () => {
86
117
  '',
87
118
  't@i.co',
88
119
  'test@example.com',
120
+ '_@example.com',
121
+ '_%+-test@example.com',
122
+ 'test-+%_@example.com',
89
123
  'test+suffix@gmail.com',
90
124
  'test+suffix@digital.cabinet-office.gov.uk',
91
125
  'test.suffix@digital.cabinet-office.gov.uk',