ais_auth_lib 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/conditions.js +4 -0
- package/package.json +1 -1
package/dist/conditions.js
CHANGED
|
@@ -30,17 +30,21 @@ function resolveDynamicValue(condition, context) {
|
|
|
30
30
|
exports.resolveDynamicValue = resolveDynamicValue;
|
|
31
31
|
function evaluateCondition(obj, condition, context) {
|
|
32
32
|
const { attribute, value, operator, valueType } = condition;
|
|
33
|
+
console.log(condition);
|
|
33
34
|
console.log("attr", (0, exports.getPropertiesByPath)(obj, attribute));
|
|
34
35
|
const attributeValues = (0, exports.getPropertiesByPath)(obj, attribute);
|
|
36
|
+
console.log("ATTR VAL", attributeValues);
|
|
35
37
|
if (valueType === "dynamic" && !context) {
|
|
36
38
|
return false;
|
|
37
39
|
}
|
|
38
40
|
const resolved = condition.valueType === "dynamic"
|
|
39
41
|
? resolveDynamicValue(condition, context)
|
|
40
42
|
: value;
|
|
43
|
+
console.log("RESOLVED ", resolved);
|
|
41
44
|
if (resolved === undefined)
|
|
42
45
|
return false;
|
|
43
46
|
const compareValues = Array.isArray(resolved) ? resolved : [resolved];
|
|
47
|
+
console.log("COMPARE V", compareValues);
|
|
44
48
|
switch (operator) {
|
|
45
49
|
case "Равно":
|
|
46
50
|
return attributeValues.some((v) => compareValues.includes(v));
|