mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-14 17:44:32 -08:00
36f8be040d
Some checks are pending
Auto Test / auto-test (18, ARM64) (push) Blocked by required conditions
Auto Test / auto-test (18, macos-latest) (push) Blocked by required conditions
Auto Test / auto-test (18, ubuntu-latest) (push) Blocked by required conditions
Auto Test / auto-test (18, windows-latest) (push) Blocked by required conditions
Auto Test / auto-test (20.5, ARM64) (push) Blocked by required conditions
Auto Test / auto-test (20.5, macos-latest) (push) Blocked by required conditions
Auto Test / auto-test (20.5, ubuntu-latest) (push) Blocked by required conditions
Auto Test / auto-test (20.5, windows-latest) (push) Blocked by required conditions
Auto Test / armv7-simple-test (18, ARMv7) (push) Blocked by required conditions
Auto Test / armv7-simple-test (20, ARMv7) (push) Blocked by required conditions
Auto Test / check-linters (push) Waiting to run
Auto Test / e2e-test (push) Blocked by required conditions
CodeQL / Analyze (go) (push) Waiting to run
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Merge Conflict Labeler / Labeling (push) Waiting to run
json-yaml-validate / json-yaml-validate (push) Waiting to run
32 lines
925 B
JavaScript
32 lines
925 B
JavaScript
/**
|
|
* Represents a variable used in a condition and the set of operators that can be applied to this variable.
|
|
*
|
|
* A `ConditionVariable` holds the ID of the variable and a list of operators that define how this variable can be evaluated
|
|
* in conditions. For example, if the variable is a request body or a specific field in a request, the operators can include
|
|
* operations such as equality checks, comparisons, or other custom evaluations.
|
|
*/
|
|
class ConditionVariable {
|
|
/**
|
|
* @type {string}
|
|
*/
|
|
id;
|
|
|
|
/**
|
|
* @type {import("./operators").ConditionOperator[]}
|
|
*/
|
|
operators = {};
|
|
|
|
/**
|
|
* @param {string} id ID of variable
|
|
* @param {import("./operators").ConditionOperator[]} operators Operators the condition supports
|
|
*/
|
|
constructor(id, operators = []) {
|
|
this.id = id;
|
|
this.operators = operators;
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
ConditionVariable,
|
|
};
|