hypercore 10.15.1 → 10.16.1

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/README.md CHANGED
@@ -73,6 +73,7 @@ Note that `tree`, `data`, and `bitfield` are normally heavily sparse files.
73
73
  keyPair: kp, // optionally pass the public key and secret key as a key pair
74
74
  encryptionKey: k, // optionally pass an encryption key to enable block encryption
75
75
  onwait: () => {}, // hook that is called if gets are waiting for download
76
+ timeout: 0, // wait at max some milliseconds (0 means no timeout)
76
77
  writable: true // disable appends and truncates
77
78
  }
78
79
  ```
package/errors.js ADDED
@@ -0,0 +1,2 @@
1
+ // explicitly exposed as hypercore/errors
2
+ module.exports = require('./lib/errors')
package/lib/errors.js CHANGED
@@ -44,6 +44,10 @@ module.exports = class HypercoreError extends Error {
44
44
  return new HypercoreError(msg, 'INVALID_PROOF', HypercoreError.INVALID_PROOF)
45
45
  }
46
46
 
47
+ static BLOCK_NOT_AVAILABLE (msg = 'Block is not available') {
48
+ return new HypercoreError(msg, 'BLOCK_NOT_AVAILABLE', HypercoreError.BLOCK_NOT_AVAILABLE)
49
+ }
50
+
47
51
  static SNAPSHOT_NOT_AVAILABLE (msg = 'Snapshot is not available') {
48
52
  return new HypercoreError(msg, 'SNAPSHOT_NOT_AVAILABLE', HypercoreError.SNAPSHOT_NOT_AVAILABLE)
49
53
  }
package/messages.js ADDED
@@ -0,0 +1,2 @@
1
+ // explicitly exposed as hypercore/messages
2
+ module.exports = require('./lib/messages')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.15.1",
3
+ "version": "10.16.1",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,6 +30,8 @@
30
30
  "homepage": "https://github.com/holepunchto/hypercore#readme",
31
31
  "files": [
32
32
  "index.js",
33
+ "errors.js",
34
+ "messages.js",
33
35
  "lib/**.js"
34
36
  ],
35
37
  "dependencies": {