forked from Mirrors/doipjs
Improve regex
This commit is contained in:
parent
b7cc0d4234
commit
b2503bfcab
1 changed files with 3 additions and 6 deletions
|
@ -45,15 +45,12 @@ const runVerificationJson = (
|
||||||
switch (checkRelation) {
|
switch (checkRelation) {
|
||||||
default:
|
default:
|
||||||
case 'contains':
|
case 'contains':
|
||||||
re = new RegExp(
|
re = new RegExp(checkClaim, 'gi')
|
||||||
checkClaim.replace('[', '\\[').replace(']', '\\]'),
|
res.isVerified = re.test(proofData.replace(/\r?\n|\r|\\/g, ''))
|
||||||
'gi'
|
|
||||||
)
|
|
||||||
res.isVerified = re.test(proofData.replace(/\r?\n|\r/, ''))
|
|
||||||
break
|
break
|
||||||
case 'equals':
|
case 'equals':
|
||||||
res.isVerified =
|
res.isVerified =
|
||||||
proofData.replace(/\r?\n|\r/, '').toLowerCase() ==
|
proofData.replace(/\r?\n|\r|\\/g, '').toLowerCase() ==
|
||||||
checkClaim.toLowerCase()
|
checkClaim.toLowerCase()
|
||||||
break
|
break
|
||||||
case 'oneOf':
|
case 'oneOf':
|
||||||
|
|
Loading…
Reference in a new issue