svelte-common 6.4.5 → 6.4.6

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 +3 -3
  2. package/src/filter.mjs +22 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.4.5",
3
+ "version": "6.4.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -53,11 +53,11 @@
53
53
  "c8": "^8.0.0",
54
54
  "documentation": "^14.0.2",
55
55
  "mf-styling": "^3.0.2",
56
- "npm-pkgbuild": "^11.10.1",
56
+ "npm-pkgbuild": "^11.10.3",
57
57
  "semantic-release": "^21.0.7",
58
58
  "stylelint": "^15.10.2",
59
59
  "stylelint-config-standard": "^34.0.0",
60
- "svelte": "^4.0.5",
60
+ "svelte": "^4.1.0",
61
61
  "testcafe": "^3.0.1",
62
62
  "vite": "^4.4.4"
63
63
  },
package/src/filter.mjs CHANGED
@@ -17,6 +17,27 @@ function collectionOp(value, against, op) {
17
17
  function allOp(value, against, op) {
18
18
  switch (typeof value) {
19
19
  case "object":
20
+ switch (typeof against) {
21
+ case "object":
22
+ if (value[Symbol.toPrimitive] && against[Symbol.toPrimitive]) {
23
+ return numberOp(
24
+ value[Symbol.toPrimitive]("number"),
25
+ against[Symbol.toPrimitive]("number"),
26
+ op
27
+ );
28
+ }
29
+ break;
30
+
31
+ case "number":
32
+ if (value[Symbol.toPrimitive]) {
33
+ return allOp(
34
+ value[Symbol.toPrimitive](typeof against),
35
+ against,
36
+ op
37
+ );
38
+ }
39
+ }
40
+
20
41
  if (value instanceof Date) {
21
42
  switch (typeof against) {
22
43
  case "string":
@@ -42,7 +63,7 @@ function allOp(value, against, op) {
42
63
  if (against instanceof Date) {
43
64
  return dateOp(new Date(value), against, op);
44
65
  }
45
-
66
+
46
67
  if (against instanceof RegExp) {
47
68
  return against.test(value);
48
69
  }