mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
Remove redundant 'await' when returning in verifications.js
This commit is contained in:
parent
70d8b307a1
commit
72d2a4a869
1 changed files with 4 additions and 4 deletions
|
@ -226,7 +226,7 @@ const runJSON = async (proofData, checkPath, params) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof proofData === 'object' && !Array.isArray(proofData) && checkPath[0] === '*') {
|
if (typeof proofData === 'object' && !Array.isArray(proofData) && checkPath[0] === '*') {
|
||||||
return await runJSON(Object.values(proofData), checkPath.slice(1), params)
|
return runJSON(Object.values(proofData), checkPath.slice(1), params)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(proofData)) {
|
if (Array.isArray(proofData)) {
|
||||||
|
@ -248,12 +248,12 @@ const runJSON = async (proofData, checkPath, params) => {
|
||||||
if (checkPath.length === 0) {
|
if (checkPath.length === 0) {
|
||||||
switch (params.claimRelation) {
|
switch (params.claimRelation) {
|
||||||
case ClaimRelation.ONEOF:
|
case ClaimRelation.ONEOF:
|
||||||
return await containsProof(proofData.join('|'), params)
|
return containsProof(proofData.join('|'), params)
|
||||||
|
|
||||||
case ClaimRelation.CONTAINS:
|
case ClaimRelation.CONTAINS:
|
||||||
case ClaimRelation.EQUALS:
|
case ClaimRelation.EQUALS:
|
||||||
default:
|
default:
|
||||||
return await containsProof(proofData, params)
|
return containsProof(proofData, params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ const runJSON = async (proofData, checkPath, params) => {
|
||||||
throw new Error('err_json_structure_incorrect')
|
throw new Error('err_json_structure_incorrect')
|
||||||
}
|
}
|
||||||
|
|
||||||
return await runJSON(
|
return runJSON(
|
||||||
proofData[checkPath[0]],
|
proofData[checkPath[0]],
|
||||||
checkPath.slice(1),
|
checkPath.slice(1),
|
||||||
params
|
params
|
||||||
|
|
Loading…
Reference in a new issue