[CRITICAL] fix all_of_array variable check

This commit is contained in:
soffee 2026-01-24 18:11:22 +03:00
parent 6e9b50e471
commit 6a098f8e9a
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{
"name": "prometheus_policy_proxy",
"type": "module",
"version": "1.1.0",
"version": "1.1.1",
"packageManager": "pnpm@10.6.5",
"license": "MIT",
"scripts": {

View file

@ -51,7 +51,7 @@ export function validateQuery(input: string, query: Query, vars: AnyVariable[]):
if (v.varType === "all_of_array" || v.varType === "any_of_array") {
const items = variableValue.split(v.separator);
if (v.varType === "all_of_array") {
if(v.items.find(i => !items.includes(i))) {
if(v.items.length !== items.length || v.items.find(i => !items.includes(i))) {
return {
result: false,
message: `Check '${v.varType}' failed for variable '${v.name}', part ${p}.`,