[CRITICAL] fix all_of_array variable check
This commit is contained in:
parent
6e9b50e471
commit
6a098f8e9a
2 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "prometheus_policy_proxy",
|
"name": "prometheus_policy_proxy",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"packageManager": "pnpm@10.6.5",
|
"packageManager": "pnpm@10.6.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export function validateQuery(input: string, query: Query, vars: AnyVariable[]):
|
||||||
if (v.varType === "all_of_array" || v.varType === "any_of_array") {
|
if (v.varType === "all_of_array" || v.varType === "any_of_array") {
|
||||||
const items = variableValue.split(v.separator);
|
const items = variableValue.split(v.separator);
|
||||||
if (v.varType === "all_of_array") {
|
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 {
|
return {
|
||||||
result: false,
|
result: false,
|
||||||
message: `Check '${v.varType}' failed for variable '${v.name}', part ${p}.`,
|
message: `Check '${v.varType}' failed for variable '${v.name}', part ${p}.`,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue