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.
@@ -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) && !["[]", "![]"].includes(operator))
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",