@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.
@@ -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.includes('_'))
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 fn = map[expression || 'default'];
99
- if (fn)
100
- return fn();
97
+ const expr = expression == '' ? 'eq' : expression;
98
+ if (map[expr])
99
+ return map[expr]();
101
100
  }
102
101
  catch (e) { }
103
- return false;
102
+ return true;
104
103
  }))) {
105
104
  const item = {
106
105
  ...payload,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "repository": {
5
5
  "url": "https://github.com/livequery/client"
6
6
  },
7
- "version": "2.0.30",
7
+ "version": "2.0.31",
8
8
  "description": "",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",