File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const Monitor = require('./lib/monitor')
6
6
7
7
const DEFAULT_BLOCK_SIZE = 2 ** 16
8
8
9
- module . exports = class Hyperblobs {
9
+ class Hyperblobs {
10
10
constructor ( core , opts = { } ) {
11
11
this . core = core
12
12
this . blockSize = opts . blockSize || DEFAULT_BLOCK_SIZE
@@ -36,6 +36,10 @@ module.exports = class Hyperblobs {
36
36
return this . core . close ( )
37
37
}
38
38
39
+ snapshot ( ) {
40
+ return new Hyperblobs ( this . core . snapshot ( ) )
41
+ }
42
+
39
43
async put ( blob , opts ) {
40
44
if ( ! b4a . isBuffer ( blob ) ) blob = b4a . from ( blob )
41
45
const blockSize = ( opts && opts . blockSize ) || this . blockSize
@@ -120,3 +124,5 @@ module.exports = class Hyperblobs {
120
124
this . core . off ( 'download' , this . _boundOnDownload )
121
125
}
122
126
}
127
+
128
+ module . exports = Hyperblobs
You can’t perform that action at this time.
0 commit comments