svelte-common 6.12.0 → 6.13.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/filter.mjs +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.12.0",
3
+ "version": "6.13.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/filter.mjs CHANGED
@@ -44,8 +44,18 @@ function allOp(value, against, op) {
44
44
 
45
45
  switch (typeof against) {
46
46
  case "object":
47
- if (against instanceof Date && value instanceof Date) {
48
- return dateOp(value, against, op);
47
+ if (value instanceof Date) {
48
+ if (
49
+ Array.isArray(against) &&
50
+ against[0] instanceof Date &&
51
+ against[1] instanceof Date
52
+ ) {
53
+ return dateOp(value, against[0], GREATER_EQUAL) && dateOp(value, against[1], LESS_EQUAL);
54
+ }
55
+
56
+ if (against instanceof Date) {
57
+ return dateOp(value, against, op);
58
+ }
49
59
  }
50
60
 
51
61
  if (value[Symbol.toPrimitive] && against[Symbol.toPrimitive]) {