hypercore-storage 1.1.2 → 1.1.3
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/index.js +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -240,14 +240,18 @@ class HypercoreStorage {
|
|
|
240
240
|
const d = this.core.dependencies[i]
|
|
241
241
|
|
|
242
242
|
if (dep !== null && d.length > dep.length) {
|
|
243
|
-
|
|
243
|
+
if (d.dataPointer !== dep.dataPointer) {
|
|
244
|
+
deps.push({ dataPointer: d.dataPointer, length: dep.length })
|
|
245
|
+
}
|
|
244
246
|
return deps
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
deps.push(d)
|
|
248
250
|
}
|
|
249
251
|
|
|
250
|
-
if (dep !== null
|
|
252
|
+
if (dep !== null && (deps.length === 0 || deps[deps.length - 1].dataPointer !== dep.dataPointer)) {
|
|
253
|
+
deps.push(dep)
|
|
254
|
+
}
|
|
251
255
|
return deps
|
|
252
256
|
}
|
|
253
257
|
|