hypercore 10.0.0-alpha.16 → 10.0.0-alpha.17

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -87,7 +87,7 @@ Options include
87
87
 
88
88
  ``` js
89
89
  {
90
- wait: true, // wait for index to be downloaded
90
+ wait: true, // wait for block to be downloaded
91
91
  onwait: () => {}, // hook that is called if the get is waiting for download
92
92
  timeout: 0, // wait at max some milliseconds (0 means no timeout)
93
93
  valueEncoding: 'json' | 'utf-8' | 'binary' // defaults to the core's valueEncoding
package/index.js CHANGED
@@ -416,6 +416,7 @@ module.exports = class Hypercore extends EventEmitter {
416
416
  if (this.core.bitfield.get(index)) {
417
417
  block = await this.core.blocks.get(index)
418
418
  } else {
419
+ if (opts && opts.wait === false) return null
419
420
  if (opts && opts.onwait) opts.onwait(index)
420
421
  block = await this.replicator.requestBlock(index)
421
422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.0.0-alpha.16",
3
+ "version": "10.0.0-alpha.17",
4
4
  "description": "Hypercore 10",
5
5
  "main": "index.js",
6
6
  "scripts": {