From c16111a6ccd2d7c57c47fe49d8e4c51396d9cad9 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Fri, 10 Dec 2021 16:10:54 +0000 Subject: [PATCH] confirm support partiallyValid --- js/validators/ConfirmationValidator.js | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/validators/ConfirmationValidator.js b/js/validators/ConfirmationValidator.js index 64e253c..dc29957 100644 --- a/js/validators/ConfirmationValidator.js +++ b/js/validators/ConfirmationValidator.js @@ -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(); diff --git a/package.json b/package.json index ba88125..43b717b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@packaged/validate", - "version": "3.0.1", + "version": "3.0.2", "main": "index.js", "repository": "git@github.com:packaged/validate", "author": "Tom Kay ",