inibase 1.4.2 → 1.4.3
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 +6 -1
- package/package.json +1 -1
package/dist/utils.server.js
CHANGED
|
@@ -87,7 +87,9 @@ export const compare = (operator, originalValue, comparedValue, fieldType) => {
|
|
|
87
87
|
if (Array.isArray(fieldType))
|
|
88
88
|
fieldType = detectFieldType(String(originalValue), fieldType);
|
|
89
89
|
// Handle comparisons involving arrays.
|
|
90
|
-
if (Array.isArray(comparedValue) &&
|
|
90
|
+
if (Array.isArray(comparedValue) &&
|
|
91
|
+
!Array.isArray(originalValue) &&
|
|
92
|
+
!["[]", "![]"].includes(operator))
|
|
91
93
|
return comparedValue.some((value) => compare(operator, originalValue, value, fieldType));
|
|
92
94
|
// Switch statement for different comparison operators.
|
|
93
95
|
switch (operator) {
|
|
@@ -161,6 +163,9 @@ export const isEqual = (originalValue, comparedValue, fieldType) => {
|
|
|
161
163
|
// If both are null-like, treat as equivalent
|
|
162
164
|
if (isOriginalNullLike && isComparedNullLike)
|
|
163
165
|
return true;
|
|
166
|
+
// If both are arrays
|
|
167
|
+
if (Array.isArray(originalValue) && Array.isArray(comparedValue))
|
|
168
|
+
return JSON.stringify(originalValue) === JSON.stringify(comparedValue);
|
|
164
169
|
// If both are number-like
|
|
165
170
|
if (isNumber(originalValue) && isNumber(comparedValue))
|
|
166
171
|
return Number(originalValue) === Number(comparedValue);
|