svelte-common 6.4.3 → 6.4.4
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 +2 -2
- package/src/attribute.mjs +2 -0
- package/src/filter.mjs +25 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"mf-styling": "^3.0.2",
|
|
56
56
|
"npm-pkgbuild": "^11.10.1",
|
|
57
57
|
"semantic-release": "^21.0.7",
|
|
58
|
-
"stylelint": "^15.10.
|
|
58
|
+
"stylelint": "^15.10.2",
|
|
59
59
|
"stylelint-config-standard": "^34.0.0",
|
|
60
60
|
"svelte": "^4.0.5",
|
|
61
61
|
"testcafe": "^3.0.1",
|
package/src/attribute.mjs
CHANGED
package/src/filter.mjs
CHANGED
|
@@ -9,7 +9,6 @@ function collectionOp(value, against, op) {
|
|
|
9
9
|
if (allOp(v, against, op)) {
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
|
-
return false;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
return false;
|
|
@@ -17,18 +16,7 @@ function collectionOp(value, against, op) {
|
|
|
17
16
|
|
|
18
17
|
function allOp(value, against, op) {
|
|
19
18
|
switch (typeof against) {
|
|
20
|
-
case "bigint":
|
|
21
|
-
case "number":
|
|
22
|
-
return numberOp(value, against, op);
|
|
23
|
-
case "string":
|
|
24
|
-
if (value instanceof Date) {
|
|
25
|
-
return dateOp(value, new Date(against), op);
|
|
26
|
-
}
|
|
27
|
-
break;
|
|
28
19
|
case "object":
|
|
29
|
-
if (against instanceof RegExp) {
|
|
30
|
-
return against.test(value);
|
|
31
|
-
}
|
|
32
20
|
if (against instanceof Date) {
|
|
33
21
|
switch (typeof value) {
|
|
34
22
|
case "object":
|
|
@@ -44,15 +32,40 @@ function allOp(value, against, op) {
|
|
|
44
32
|
|
|
45
33
|
switch (typeof value) {
|
|
46
34
|
case "object":
|
|
35
|
+
if (value instanceof Date) {
|
|
36
|
+
switch (typeof against) {
|
|
37
|
+
case "string":
|
|
38
|
+
return dateOp(value, new Date(against), op);
|
|
39
|
+
case "object":
|
|
40
|
+
if (against instanceof Date) {
|
|
41
|
+
return dateOp(value, against, op);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
47
46
|
if (Array.isArray(value) || value instanceof Set) {
|
|
48
47
|
return collectionOp(value, against, op);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
return value.toString().match(against);
|
|
52
51
|
case "string":
|
|
52
|
+
switch (typeof against) {
|
|
53
|
+
case "bigint":
|
|
54
|
+
case "number":
|
|
55
|
+
return numberOp(value, against, op);
|
|
56
|
+
case "object":
|
|
57
|
+
if (against instanceof RegExp) {
|
|
58
|
+
return against.test(value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
return value.match(against);
|
|
54
63
|
case "bigint":
|
|
55
64
|
case "number":
|
|
65
|
+
if (against instanceof RegExp) {
|
|
66
|
+
return against.test(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
56
69
|
return numberOp(value, against, op);
|
|
57
70
|
case "boolean":
|
|
58
71
|
return value == against;
|