This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 5 files changed +24
-13
lines changed
5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 37
37
},
38
38
"homepage" : " https://github.com/ipfs/js-ipfs#readme" ,
39
39
"devDependencies" : {
40
- "aegir" : " ^2.1.1 " ,
40
+ "aegir" : " ^2.1.2 " ,
41
41
"async" : " ^1.5.2" ,
42
42
"buffer-loader" : " 0.0.1" ,
43
43
"chai" : " ^3.5.0" ,
44
44
"expose-loader" : " ^0.7.1" ,
45
45
"form-data" : " ^1.0.0-rc3" ,
46
- "idb-plus-blob-store" : " ^1.0.0" ,
47
- "local-storage-blob-store" : " 0.0.3" ,
46
+ "idb-plus-blob-store" : " ^1.1.2" ,
48
47
"lodash" : " ^4.11.1" ,
49
48
"mocha" : " ^2.3.4" ,
50
49
"ncp" : " ^2.0.0" ,
70
69
"ipfs-multipart" : " ^0.1.0" ,
71
70
"ipfs-repo" : " ^0.6.1" ,
72
71
"joi" : " ^8.0.2" ,
73
- "libp2p-ipfs" : " ^0.3.1 " ,
72
+ "libp2p-ipfs" : " ^0.3.3 " ,
74
73
"lodash.get" : " ^4.2.1" ,
75
74
"lodash.set" : " ^4.0.0" ,
76
75
"multiaddr" : " ^1.3.0" ,
111
110
112
111
113
112
]
114
- }
113
+ }
Original file line number Diff line number Diff line change @@ -205,7 +205,9 @@ function IPFS (repo) {
205
205
patch : {
206
206
appendData : ( multihash , data , callback ) => {
207
207
this . object . get ( multihash , ( err , obj ) => {
208
- if ( err ) { return callback ( err ) }
208
+ if ( err ) {
209
+ return callback ( err )
210
+ }
209
211
obj . data = Buffer . concat ( [ obj . data , data ] )
210
212
dagS . add ( obj , ( err ) => {
211
213
if ( err ) {
@@ -217,7 +219,9 @@ function IPFS (repo) {
217
219
} ,
218
220
addLink : ( multihash , link , callback ) => {
219
221
this . object . get ( multihash , ( err , obj ) => {
220
- if ( err ) { return callback ( err ) }
222
+ if ( err ) {
223
+ return callback ( err )
224
+ }
221
225
obj . addRawLink ( link )
222
226
dagS . add ( obj , ( err ) => {
223
227
if ( err ) {
@@ -229,7 +233,9 @@ function IPFS (repo) {
229
233
} ,
230
234
rmLink : ( multihash , linkRef , callback ) => {
231
235
this . object . get ( multihash , ( err , obj ) => {
232
- if ( err ) { return callback ( err ) }
236
+ if ( err ) {
237
+ return callback ( err )
238
+ }
233
239
obj . links = obj . links . filter ( ( link ) => {
234
240
// filter by name when linkRef is a string, or by hash otherwise
235
241
if ( typeof linkRef === 'string' ) {
Original file line number Diff line number Diff line change @@ -89,8 +89,15 @@ exports = module.exports = function HttpApi (repo) {
89
89
this . stop = ( callback ) => {
90
90
const repoPath = this . ipfs . repo . path ( )
91
91
fs . unlinkSync ( path . join ( repoPath , 'api' ) )
92
- this . ipfs . libp2p . stop ( ( ) => {
93
- this . server . stop ( callback )
94
- } )
92
+ let counter = 0
93
+
94
+ this . server . stop ( closed )
95
+ this . ipfs . libp2p . stop ( closed )
96
+
97
+ function closed ( ) {
98
+ if ( ++ counter === 2 ) {
99
+ callback ( )
100
+ }
101
+ }
95
102
}
96
103
}
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ describe('http api', () => {
28
28
after ( ( done ) => {
29
29
api . stop ( ( err ) => {
30
30
expect ( err ) . to . not . exist
31
-
32
31
clean ( repoTests )
33
32
done ( )
34
33
} )
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ module.exports = (httpAPI) => {
99
99
it ( 'updates value for request with both args and JSON flag with valid JSON argument' , ( done ) => {
100
100
api . inject ( {
101
101
method : 'POST' ,
102
- url : '/api/v0/config?arg=Datastore.Path&arg={\ "kitten\ ": true}&json'
102
+ url : '/api/v0/config?arg=Datastore.Path&arg={"kitten": true}&json'
103
103
} , ( res ) => {
104
104
expect ( res . statusCode ) . to . equal ( 200 )
105
105
expect ( res . result . Key ) . to . equal ( 'Datastore.Path' )
You can’t perform that action at this time.
0 commit comments