Skip to content

Commit

Permalink
Regex update (#818)
Browse files Browse the repository at this point in the history
* Regex update

* updated package.json version
Midge-dev authored Nov 15, 2023
1 parent dcce25f commit 2092ad2
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dist/686C-674-schema.json
Original file line number Diff line number Diff line change
@@ -10,18 +10,18 @@
"type": "string",
"minLength": 1,
"maxLength": 30,
"pattern": "^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$"
"pattern": "^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$"
},
"middle": {
"type": "string",
"pattern": "^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$",
"pattern": "^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$",
"maxLength": 20
},
"last": {
"type": "string",
"minLength": 1,
"maxLength": 30,
"pattern": "^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$"
"pattern": "^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$"
}
},
"required": [
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vets-json-schema",
"version": "20.32.3",
"version": "20.32.4",
"repository": {
"type": "git",
"url": "git+https://github.com/department-of-veterans-affairs/vets-json-schema.git"
8 changes: 4 additions & 4 deletions src/schemas/686c-674/schema.js
Original file line number Diff line number Diff line change
@@ -12,14 +12,14 @@ const currencyAmountPattern = '^\\d+(\\.\\d{1,2})?$';
// filter out military states
const militaryStates = ['AA', 'AE', 'AP'];
const filteredStates = states.USA.filter(state => !militaryStates.includes(state.value));
const textRegex = '^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$';
const nameRegex = '^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$';

let definitions = cloneDeep(commonDefinitions);
definitions = pick(definitions, 'fullName', 'phone', 'date', 'email', 'files', 'privacyAgreementAccepted', 'ssn');

definitions.fullName.properties.first.pattern = textRegex;
definitions.fullName.properties.last.pattern = textRegex;
definitions.fullName.properties.middle.pattern = textRegex;
definitions.fullName.properties.first.pattern = nameRegex;
definitions.fullName.properties.last.pattern = nameRegex;
definitions.fullName.properties.middle.pattern = nameRegex;
definitions.fullName.properties.first.maxLength = 30;
definitions.fullName.properties.last.maxLength = 30;
definitions.fullName.properties.middle.maxLength = 20;

0 comments on commit 2092ad2

Please sign in to comment.