Skip to content

Commit

Permalink
chore: Allow array matching
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Sep 30, 2024
1 parent 54f115a commit 27c79bb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ export class InputDescriptorFilterEvaluationHandler extends AbstractEvaluationHa
evalResult = InputDescriptorFilterEvaluationHandler.FILTER_CACHE.get(successCacheKey)?.value;
if (evalResult === undefined) {
InputDescriptorFilterEvaluationHandler.keepCacheSizeInCheck();
evalResult = AJV_FIELD_FILTER.validate(field.filter, result.value);
if(Array.isArray(result.value)) {
const filter = field.filter
evalResult = result.value.some(value => AJV_FIELD_FILTER.validate(filter, value));
} else {
evalResult = AJV_FIELD_FILTER.validate(field.filter, result.value);
}
InputDescriptorFilterEvaluationHandler.FILTER_CACHE.set(successCacheKey, {
value: evalResult,
ts: now + InputDescriptorFilterEvaluationHandler.DEFAULT_FILTER_CACHE_TTL,
Expand Down

0 comments on commit 27c79bb

Please sign in to comment.