This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 4 files changed +16
-14
lines changed
4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 65
65
"dirty-chai" : " ^2.0.1" ,
66
66
"eslint-plugin-react" : " ^7.4.0" ,
67
67
"gulp" : " ^3.9.1" ,
68
- "interface-ipfs-core" : " ~0.32.1 " ,
68
+ "interface-ipfs-core" : " ~0.33.0 " ,
69
69
"hapi" : " ^16.6.2" ,
70
70
"ipfsd-ctl" : " ~0.24.0" ,
71
71
"pre-commit" : " ^1.2.2" ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = (send) => {
16
16
if ( err ) {
17
17
return callback ( err )
18
18
}
19
- callback ( null , res . Pins )
19
+ callback ( null , res . Pins . map ( ( hash ) => ( { hash : hash } ) ) )
20
20
} )
21
21
} )
22
22
}
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const promisify = require ( 'promisify-es6' )
4
+ const _ = require ( 'lodash' )
4
5
5
6
module . exports = ( send ) => {
6
7
return promisify ( ( hash , opts , callback ) => {
8
+ if ( typeof hash === 'function' ) {
9
+ callback = hash
10
+ opts = null
11
+ hash = null
12
+ }
7
13
if ( typeof opts === 'function' ) {
8
14
callback = opts
9
- opts = { }
10
15
}
11
-
12
- if ( typeof hash === 'object' ) {
16
+ if ( hash && hash . type ) {
13
17
opts = hash
14
- hash = undefined
15
- }
16
-
17
- if ( typeof hash === 'function' ) {
18
- callback = hash
19
- hash = undefined
20
- opts = { }
18
+ hash = null
19
+ } else {
20
+ opts = null
21
21
}
22
22
23
23
send ( {
@@ -28,7 +28,9 @@ module.exports = (send) => {
28
28
if ( err ) {
29
29
return callback ( err )
30
30
}
31
- callback ( null , res . Keys )
31
+ callback ( null , _ . keys ( res . Keys ) . map ( hash => (
32
+ { hash, type : res . Keys [ hash ] . Type }
33
+ ) ) )
32
34
} )
33
35
} )
34
36
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = (send) => {
16
16
if ( err ) {
17
17
return callback ( err )
18
18
}
19
- callback ( null , res . Pins )
19
+ callback ( null , res . Pins . map ( ( hash ) => ( { hash : hash } ) ) )
20
20
} )
21
21
} )
22
22
}
You can’t perform that action at this time.
0 commit comments