@live-change/dao 0.9.129 → 0.9.131

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.
@@ -76,7 +76,7 @@ class PushObservableTrigger {
76
76
  }
77
77
  }
78
78
  findPointers(value) {
79
- debugPot("FIND POINTERS IN", value)
79
+ debugPot("FIND POINTERS IN", value, 'SCHEMA', JSON.stringify(this.more, null, 2))
80
80
  let depsPointers = []
81
81
  let count = 0
82
82
  for(let dep of this.more) {
@@ -128,10 +128,10 @@ function collect(source, schema, getSource) {
128
128
  let propId = 0
129
129
  for(let key in objectSchema) {
130
130
  let values = collect(source, objectSchema[key], getSource)
131
- propValues[propId] = values.filter(Boolean)
131
+ propValues[propId] = values.filter(x => x !== undefined && x !== null)
132
132
  propValues[propId].many = values.many
133
133
  propId++
134
- }
134
+ }
135
135
  let crossed = cross(propValues)
136
136
  let results = new Array(crossed.length)
137
137
  for(let i = 0; i < crossed.length; i++) {
package/package.json CHANGED
@@ -35,6 +35,6 @@
35
35
  "scripts": {
36
36
  "test": "NODE_ENV=test tape tests/*"
37
37
  },
38
- "version": "0.9.129",
39
- "gitHead": "243c2cc85e556cd6f4de4cf65ae4bf8cb8d584a6"
38
+ "version": "0.9.131",
39
+ "gitHead": "3431deb86db4b740bcf04375b274697e0669fff4"
40
40
  }
@@ -2,7 +2,7 @@ import test from 'tape'
2
2
  import ReactiveDao from "../index.js"
3
3
 
4
4
  test("pointers collector", (t) => {
5
- t.plan(14)
5
+ t.plan(15)
6
6
 
7
7
  t.test("simple property", (t) => {
8
8
  t.plan(2)
@@ -231,6 +231,34 @@ test("pointers collector", (t) => {
231
231
  ], "results match")
232
232
  })
233
233
 
234
-
234
+ t.test("test fetch with parameter equals 0", (t) => {
235
+ t.plan(1)
236
+ let pointers = ReactiveDao.collectPointers({
237
+ id: '[Wf8UAXnGS.0@mzZQq]',
238
+ phase: 0,
239
+ round: 0,
240
+ phaseRound: 0,
241
+ state: 'running',
242
+ lastUpdate: '2025-08-30T10:34:32.258Z',
243
+ roundEndTime: '2025-08-30T18:54:42.257Z',
244
+ roundStartTime: '2025-08-30T10:34:32.257Z',
245
+ event: '[Wf8UAXnGS.0@mzZQq]',
246
+ }, [
247
+ ["speedDating", "myPairByRound", { object: {
248
+ event: '[Wf8UAXnGS.0@mzZQq]',
249
+ round: { property: "round"}
250
+ }}]
251
+ ])
252
+ t.deepEqual(pointers.slice(), [
253
+ [
254
+ "speedDating",
255
+ "myPairByRound",
256
+ {
257
+ "event": "[Wf8UAXnGS.0@mzZQq]",
258
+ "round": 0
259
+ }
260
+ ]
261
+ ], "results match")
262
+ })
235
263
 
236
264
  })