mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
Fix var declaration
This commit is contained in:
parent
2b82cf3a7b
commit
cfebde55d7
1 changed files with 3 additions and 2 deletions
|
@ -92,6 +92,7 @@ const Twitter = async (params) => {
|
||||||
|
|
||||||
const VerifyJsonProof = (data, checkPath, checkClaim, checkRelation) => {
|
const VerifyJsonProof = (data, checkPath, checkClaim, checkRelation) => {
|
||||||
let isVerified = false;
|
let isVerified = false;
|
||||||
|
let re;
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return isVerified;
|
return isVerified;
|
||||||
|
@ -101,14 +102,14 @@ const VerifyJsonProof = (data, checkPath, checkClaim, checkRelation) => {
|
||||||
switch (checkRelation) {
|
switch (checkRelation) {
|
||||||
default:
|
default:
|
||||||
case 'contains':
|
case 'contains':
|
||||||
let re = new RegExp(checkClaim, "gi");
|
re = new RegExp(checkClaim, "gi");
|
||||||
return re.test(data);
|
return re.test(data);
|
||||||
break;
|
break;
|
||||||
case 'eq':
|
case 'eq':
|
||||||
return data.toLowerCase() == checkClaim.toLowerCase();
|
return data.toLowerCase() == checkClaim.toLowerCase();
|
||||||
break;
|
break;
|
||||||
case 'oneOf':
|
case 'oneOf':
|
||||||
let re = new RegExp(checkClaim, "gi");
|
re = new RegExp(checkClaim, "gi");
|
||||||
return re.test(data.join("|"));
|
return re.test(data.join("|"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue