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 +1 -1
- package/src/filter.mjs +22 -17
- package/src/pagination.mjs +8 -0
package/package.json
CHANGED
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
|
|
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
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
switch (typeof against) {
|
|
97
|
+
case "object":
|
|
98
|
+
if (against instanceof RegExp) {
|
|
99
|
+
return against.test(value);
|
|
100
|
+
}
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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) {
|
package/src/pagination.mjs
CHANGED
|
@@ -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
|
}
|