Skip to content

Commit

Permalink
confirm support partiallyValid
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK committed Dec 10, 2021
1 parent 78f835c commit c16111a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions js/validators/ConfirmationValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export class ConfirmationValidator extends DataSetValidator
const compare = data.hasOwnProperty(this._field) ? data[this._field] : null;
if(compare !== value)
{
if(compare.substr(0, value.length) === value)
{
return ValidationResponse.potentiallyValid(['value does not match']);
}
return ValidationResponse.error(['value does not match']);
}
return ValidationResponse.success();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@packaged/validate",
"version": "3.0.1",
"version": "3.0.2",
"main": "index.js",
"repository": "[email protected]:packaged/validate",
"author": "Tom Kay <[email protected]>",
Expand Down

0 comments on commit c16111a

Please sign in to comment.