inibase 1.4.4 → 1.4.5
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/utils.server.js +8 -2
- package/package.json +1 -1
package/dist/utils.server.js
CHANGED
|
@@ -87,10 +87,16 @@ export const compare = (operator, originalValue, comparedValue, fieldType) => {
|
|
|
87
87
|
// Determine the field type if it's an array of potential types.
|
|
88
88
|
if (Array.isArray(fieldType))
|
|
89
89
|
fieldType = detectFieldType(String(originalValue), fieldType);
|
|
90
|
-
//
|
|
90
|
+
// Special handling when the compared value is an array.
|
|
91
|
+
if (Array.isArray(comparedValue) &&
|
|
92
|
+
!Array.isArray(originalValue) &&
|
|
93
|
+
!["[]", "![]"].includes(operator))
|
|
94
|
+
return comparedValue.some((value) => compare(operator, originalValue, value, fieldType));
|
|
95
|
+
// Special handling when the original value is an array.
|
|
91
96
|
if (Array.isArray(originalValue) &&
|
|
92
97
|
!Array.isArray(comparedValue) &&
|
|
93
|
-
!["[]", "![]"].includes(operator)
|
|
98
|
+
!["[]", "![]"].includes(operator) &&
|
|
99
|
+
fieldType !== "array")
|
|
94
100
|
return originalValue.some((value) => compare(operator, value, comparedValue, fieldType));
|
|
95
101
|
// Switch statement for different comparison operators.
|
|
96
102
|
switch (operator) {
|