svelte-common 6.6.10 → 6.6.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.6.10",
3
+ "version": "6.6.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/filter.mjs CHANGED
@@ -74,7 +74,7 @@ function allOp(value, against, op) {
74
74
 
75
75
  if (against instanceof Map) {
76
76
  for (const [k, v] of against) {
77
- if (value.match(k) || value.match(v)) {
77
+ if (allOp(value, k, op) || allOp(value, v, op)) {
78
78
  return true;
79
79
  }
80
80
  }
@@ -82,36 +82,41 @@ function allOp(value, against, op) {
82
82
 
83
83
  if (against[Symbol.iterator]) {
84
84
  for (const i of against) {
85
- if (value.match(i)) {
85
+ if (allOp(value, i, op)) {
86
86
  return true;
87
87
  }
88
88
  }
89
+ return false;
89
90
  }
90
91
  }
91
92
 
92
93
  return value.match(against);
93
94
  case "bigint":
94
95
  case "number":
95
- if (against instanceof RegExp) {
96
- return against.test(value);
97
- }
96
+ switch (typeof against) {
97
+ case "object":
98
+ if (against instanceof RegExp) {
99
+ return against.test(value);
100
+ }
98
101
 
99
- if (against instanceof Map) {
100
- for (const [k, v] of against) {
101
- if (numberOp(value, k, op) || numberOp(value, v, op)) {
102
- return true;
102
+ if (against instanceof Map) {
103
+ for (const [k, v] of against) {
104
+ if (numberOp(value, k, op) || numberOp(value, v, op)) {
105
+ return true;
106
+ }
107
+ }
108
+ return false;
103
109
  }
104
- }
105
- }
106
110
 
107
- if (against[Symbol.iterator]) {
108
- for (const i of against) {
109
- if (numberOp(value, i, op)) {
110
- return true;
111
+ if (against[Symbol.iterator]) {
112
+ for (const i of against) {
113
+ if (numberOp(value, i, op)) {
114
+ return true;
115
+ }
116
+ }
117
+ return false;
111
118
  }
112
- }
113
119
  }
114
-
115
120
  return numberOp(value, against, op);
116
121
  case "boolean":
117
122
  switch (typeof against) {
@@ -108,6 +108,9 @@ export class Pagination {
108
108
  return () => this.#subscriptions.delete(s);
109
109
  }
110
110
 
111
+ /**
112
+ * @return {number}
113
+ */
111
114
  get numberOfPages() {
112
115
  let n;
113
116
 
@@ -124,6 +127,11 @@ export class Pagination {
124
127
  return Math.ceil(n / this.itemsPerPage);
125
128
  }
126
129
 
130
+ /**
131
+ * Deliver items per page.
132
+ * @see {itemsPerPage}
133
+ * @return {number}
134
+ */
127
135
  get length() {
128
136
  return this.#itemsPerPage;
129
137
  }