@prismatic-io/spectral 8.1.3 → 8.1.4
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.
|
@@ -67,7 +67,8 @@ const contains = (container, containee) => {
|
|
|
67
67
|
if (typeof container === "object" && container !== null) {
|
|
68
68
|
if (Array.isArray(container)) {
|
|
69
69
|
// Array member check.
|
|
70
|
-
return container.includes(containee)
|
|
70
|
+
return (container.includes(containee) ||
|
|
71
|
+
container.includes((0, exports.parseValue)(containee)));
|
|
71
72
|
}
|
|
72
73
|
// Object attribute check (set membership).
|
|
73
74
|
return Object.prototype.hasOwnProperty.call(container, `${containee}`);
|
|
@@ -226,9 +227,9 @@ const evaluate = (expression) => {
|
|
|
226
227
|
case types_1.BinaryOperator.lessThanOrEqual:
|
|
227
228
|
return left <= right;
|
|
228
229
|
case types_1.BinaryOperator.in:
|
|
229
|
-
return (0, exports.contains)(right,
|
|
230
|
+
return (0, exports.contains)(right, leftTerm);
|
|
230
231
|
case types_1.BinaryOperator.notIn:
|
|
231
|
-
return !(0, exports.contains)(right,
|
|
232
|
+
return !(0, exports.contains)(right, leftTerm);
|
|
232
233
|
case types_1.BinaryOperator.exactlyMatches:
|
|
233
234
|
return left === right || lodash_1.default.isEqual(left, right);
|
|
234
235
|
case types_1.BinaryOperator.doesNotExactlyMatch:
|