From cfebde55d7a899250ad26c37cf4c9c78e3959897 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Mon, 31 Aug 2020 08:09:41 +0200 Subject: [PATCH] Fix var declaration --- server/proofVerification.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/proofVerification.js b/server/proofVerification.js index ce3b520..dc7556d 100644 --- a/server/proofVerification.js +++ b/server/proofVerification.js @@ -92,6 +92,7 @@ const Twitter = async (params) => { const VerifyJsonProof = (data, checkPath, checkClaim, checkRelation) => { let isVerified = false; + let re; if (!data) { return isVerified; @@ -101,14 +102,14 @@ const VerifyJsonProof = (data, checkPath, checkClaim, checkRelation) => { switch (checkRelation) { default: case 'contains': - let re = new RegExp(checkClaim, "gi"); + re = new RegExp(checkClaim, "gi"); return re.test(data); break; case 'eq': return data.toLowerCase() == checkClaim.toLowerCase(); break; case 'oneOf': - let re = new RegExp(checkClaim, "gi"); + re = new RegExp(checkClaim, "gi"); return re.test(data.join("|")); break; }