@livequery/client 2.0.30 → 2.0.31
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/build/Collection.js +5 -6
- package/package.json +1 -1
package/build/Collection.js
CHANGED
|
@@ -77,13 +77,12 @@ export class CollectionObservable extends BehaviorSubject {
|
|
|
77
77
|
// Is realtime update that match filters
|
|
78
78
|
from == 'realtime' && Object
|
|
79
79
|
.keys(state.options || {})
|
|
80
|
-
.filter(key => !key.
|
|
80
|
+
.filter(key => !key.startsWith(':'))
|
|
81
81
|
.every(key => {
|
|
82
82
|
const [field, expression] = key.split(':');
|
|
83
83
|
const a = payload[field];
|
|
84
84
|
const b = state.options?.[field];
|
|
85
85
|
const map = {
|
|
86
|
-
'default': () => a == b,
|
|
87
86
|
eq: () => a == b,
|
|
88
87
|
ne: () => a != b,
|
|
89
88
|
lt: () => typeof a == 'number' && typeof b == 'number' && a < b,
|
|
@@ -95,12 +94,12 @@ export class CollectionObservable extends BehaviorSubject {
|
|
|
95
94
|
between: () => typeof a == 'number' && Array.isArray(b) && typeof b[0] == 'number' && b[0] <= a && typeof b[1] == 'number' && a <= b[1]
|
|
96
95
|
};
|
|
97
96
|
try {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
97
|
+
const expr = expression == '' ? 'eq' : expression;
|
|
98
|
+
if (map[expr])
|
|
99
|
+
return map[expr]();
|
|
101
100
|
}
|
|
102
101
|
catch (e) { }
|
|
103
|
-
return
|
|
102
|
+
return true;
|
|
104
103
|
}))) {
|
|
105
104
|
const item = {
|
|
106
105
|
...payload,
|