svelte-common 4.22.4 → 4.22.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.
- package/README.md +57 -30
- package/package.json +2 -2
- package/src/filter.mjs +2 -1
package/README.md
CHANGED
|
@@ -26,22 +26,71 @@ or the [live example](https://arlac77.github.io/components/svelte-common/example
|
|
|
26
26
|
|
|
27
27
|
### Table of Contents
|
|
28
28
|
|
|
29
|
-
* [
|
|
29
|
+
* [tokens](#tokens)
|
|
30
30
|
* [Parameters](#parameters)
|
|
31
|
-
* [
|
|
31
|
+
* [setAttribute](#setattribute)
|
|
32
32
|
* [Parameters](#parameters-1)
|
|
33
|
-
* [
|
|
33
|
+
* [getAttribute](#getattribute)
|
|
34
34
|
* [Parameters](#parameters-2)
|
|
35
|
-
* [
|
|
35
|
+
* [getAttributeAndOperator](#getattributeandoperator)
|
|
36
36
|
* [Parameters](#parameters-3)
|
|
37
|
-
* [
|
|
37
|
+
* [filter](#filter)
|
|
38
38
|
* [Parameters](#parameters-4)
|
|
39
|
-
* [
|
|
39
|
+
* [initializeServiceWorker](#initializeserviceworker)
|
|
40
40
|
* [Parameters](#parameters-5)
|
|
41
|
-
* [
|
|
41
|
+
* [toggleOrderBy](#toggleorderby)
|
|
42
42
|
* [Parameters](#parameters-6)
|
|
43
|
-
* [
|
|
43
|
+
* [sortable](#sortable)
|
|
44
44
|
* [Parameters](#parameters-7)
|
|
45
|
+
* [sorter](#sorter)
|
|
46
|
+
* [Parameters](#parameters-8)
|
|
47
|
+
* [keyPrefixStore](#keyprefixstore)
|
|
48
|
+
* [Parameters](#parameters-9)
|
|
49
|
+
|
|
50
|
+
## tokens
|
|
51
|
+
|
|
52
|
+
Split property path into tokens
|
|
53
|
+
|
|
54
|
+
### Parameters
|
|
55
|
+
|
|
56
|
+
* `string` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
57
|
+
|
|
58
|
+
Returns **Iterator<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
59
|
+
|
|
60
|
+
## setAttribute
|
|
61
|
+
|
|
62
|
+
Set Object attribute.
|
|
63
|
+
The name may be a property path like 'a.b.c'.
|
|
64
|
+
|
|
65
|
+
### Parameters
|
|
66
|
+
|
|
67
|
+
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
68
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
69
|
+
* `value` **any** 
|
|
70
|
+
|
|
71
|
+
## getAttribute
|
|
72
|
+
|
|
73
|
+
Deliver attribute value.
|
|
74
|
+
The name may be a property path like 'a.b.c'.
|
|
75
|
+
|
|
76
|
+
### Parameters
|
|
77
|
+
|
|
78
|
+
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
79
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
80
|
+
|
|
81
|
+
Returns **any** value associated with the given property name
|
|
82
|
+
|
|
83
|
+
## getAttributeAndOperator
|
|
84
|
+
|
|
85
|
+
Deliver attribute value.
|
|
86
|
+
The name may be a property path like 'a.b.c'.
|
|
87
|
+
|
|
88
|
+
### Parameters
|
|
89
|
+
|
|
90
|
+
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
91
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
92
|
+
|
|
93
|
+
Returns **any** value associated with the given property name
|
|
45
94
|
|
|
46
95
|
## filter
|
|
47
96
|
|
|
@@ -112,28 +161,6 @@ Create a derived store where all the object keys are prefixed.
|
|
|
112
161
|
|
|
113
162
|
Returns **WriteableStore** 
|
|
114
163
|
|
|
115
|
-
## tokens
|
|
116
|
-
|
|
117
|
-
Split property path into tokens.
|
|
118
|
-
|
|
119
|
-
### Parameters
|
|
120
|
-
|
|
121
|
-
* `string` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
122
|
-
|
|
123
|
-
Returns **Iterator<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
124
|
-
|
|
125
|
-
## getAttribute
|
|
126
|
-
|
|
127
|
-
Deliver attribute value.
|
|
128
|
-
The name may be a property path like 'a.b.c'.
|
|
129
|
-
|
|
130
|
-
### Parameters
|
|
131
|
-
|
|
132
|
-
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
133
|
-
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
134
|
-
|
|
135
|
-
Returns **any** value associated with the given property name
|
|
136
|
-
|
|
137
164
|
# install
|
|
138
165
|
|
|
139
166
|
With [npm](http://npmjs.org) do:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"c8": "^7.12.0",
|
|
46
46
|
"documentation": "^14.0.1",
|
|
47
47
|
"mf-styling": "^1.7.43",
|
|
48
|
-
"npm-pkgbuild": "^11.
|
|
48
|
+
"npm-pkgbuild": "^11.2.6",
|
|
49
49
|
"semantic-release": "^20.1.0",
|
|
50
50
|
"stylelint": "^14.16.1",
|
|
51
51
|
"stylelint-config-standard": "^29.0.0",
|
package/src/filter.mjs
CHANGED
|
@@ -38,6 +38,7 @@ export function filter(filterBy, getters = {}) {
|
|
|
38
38
|
// console.log("KEY", key, op, value, av);
|
|
39
39
|
|
|
40
40
|
switch (typeof value) {
|
|
41
|
+
case "bigint":
|
|
41
42
|
case "number":
|
|
42
43
|
return numberOp(av, value, op);
|
|
43
44
|
case "string":
|
|
@@ -71,7 +72,7 @@ export function filter(filterBy, getters = {}) {
|
|
|
71
72
|
case "number":
|
|
72
73
|
return numberOp(av, value, op);
|
|
73
74
|
case "boolean":
|
|
74
|
-
return
|
|
75
|
+
return value == av;
|
|
75
76
|
}
|
|
76
77
|
return false;
|
|
77
78
|
};
|