This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +22
-10
lines changed
Expand file tree Collapse file tree 5 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 3737 },
3838 "homepage" : " https://github.com/ipfs/js-ipfs#readme" ,
3939 "devDependencies" : {
40- "aegir" : " ^2.1.1 " ,
40+ "aegir" : " ^2.1.2 " ,
4141 "async" : " ^1.5.2" ,
4242 "buffer-loader" : " 0.0.1" ,
4343 "chai" : " ^3.5.0" ,
7070 "ipfs-multipart" : " ^0.1.0" ,
7171 "ipfs-repo" : " ^0.6.1" ,
7272 "joi" : " ^8.0.2" ,
73- "libp2p-ipfs" : " ^0.3.2 " ,
73+ "libp2p-ipfs" : " ^0.3.3 " ,
7474 "lodash.get" : " ^4.2.1" ,
7575 "lodash.set" : " ^4.0.0" ,
7676 "multiaddr" : " ^1.3.0" ,
Original file line number Diff line number Diff line change @@ -205,7 +205,9 @@ function IPFS (repo) {
205205 patch : {
206206 appendData : ( multihash , data , callback ) => {
207207 this . object . get ( multihash , ( err , obj ) => {
208- if ( err ) { return callback ( err ) }
208+ if ( err ) {
209+ return callback ( err )
210+ }
209211 obj . data = Buffer . concat ( [ obj . data , data ] )
210212 dagS . add ( obj , ( err ) => {
211213 if ( err ) {
@@ -217,7 +219,9 @@ function IPFS (repo) {
217219 } ,
218220 addLink : ( multihash , link , callback ) => {
219221 this . object . get ( multihash , ( err , obj ) => {
220- if ( err ) { return callback ( err ) }
222+ if ( err ) {
223+ return callback ( err )
224+ }
221225 obj . addRawLink ( link )
222226 dagS . add ( obj , ( err ) => {
223227 if ( err ) {
@@ -229,7 +233,9 @@ function IPFS (repo) {
229233 } ,
230234 rmLink : ( multihash , linkRef , callback ) => {
231235 this . object . get ( multihash , ( err , obj ) => {
232- if ( err ) { return callback ( err ) }
236+ if ( err ) {
237+ return callback ( err )
238+ }
233239 obj . links = obj . links . filter ( ( link ) => {
234240 // filter by name when linkRef is a string, or by hash otherwise
235241 if ( typeof linkRef === 'string' ) {
Original file line number Diff line number Diff line change @@ -89,8 +89,15 @@ exports = module.exports = function HttpApi (repo) {
8989 this . stop = ( callback ) => {
9090 const repoPath = this . ipfs . repo . path ( )
9191 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+ }
95102 }
96103}
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ describe('http api', () => {
2828 after ( ( done ) => {
2929 api . stop ( ( err ) => {
3030 expect ( err ) . to . not . exist
31-
3231 clean ( repoTests )
3332 done ( )
3433 } )
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ module.exports = (httpAPI) => {
9999 it ( 'updates value for request with both args and JSON flag with valid JSON argument' , ( done ) => {
100100 api . inject ( {
101101 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'
103103 } , ( res ) => {
104104 expect ( res . statusCode ) . to . equal ( 200 )
105105 expect ( res . result . Key ) . to . equal ( 'Datastore.Path' )
You can’t perform that action at this time.
0 commit comments