corestore 7.0.17 → 7.0.18

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -18,14 +18,14 @@ class StreamTracker {
18
18
 
19
19
  add (stream, isExternal) {
20
20
  const record = { index: 0, stream, isExternal }
21
- this.records.push(record)
21
+ record.index = this.records.push(record) - 1
22
22
  return record
23
23
  }
24
24
 
25
25
  remove (record) {
26
26
  const popped = this.records.pop()
27
27
  if (popped === record) return
28
- this.records[popped.index = record.index] = popped
28
+ this.records[(popped.index = record.index)] = popped
29
29
  }
30
30
 
31
31
  attachAll (core) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corestore",
3
- "version": "7.0.17",
3
+ "version": "7.0.18",
4
4
  "description": "A Hypercore factory that simplifies managing collections of cores.",
5
5
  "main": "index.js",
6
6
  "files": [