This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 6565 "dirty-chai" : " ^2.0.1" ,
6666 "eslint-plugin-react" : " ^7.4.0" ,
6767 "gulp" : " ^3.9.1" ,
68- "interface-ipfs-core" : " ~0.32.1 " ,
68+ "interface-ipfs-core" : " ~0.33.0 " ,
6969 "hapi" : " ^16.6.2" ,
7070 "ipfsd-ctl" : " ~0.24.0" ,
7171 "pre-commit" : " ^1.2.2" ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = (send) => {
1616 if ( err ) {
1717 return callback ( err )
1818 }
19- callback ( null , res . Pins )
19+ callback ( null , res . Pins . map ( ( hash ) => ( { hash : hash } ) ) )
2020 } )
2121 } )
2222}
Original file line number Diff line number Diff line change 11'use strict'
22
33const promisify = require ( 'promisify-es6' )
4+ const _ = require ( 'lodash' )
45
56module . exports = ( send ) => {
67 return promisify ( ( hash , opts , callback ) => {
8+ if ( typeof hash === 'function' ) {
9+ callback = hash
10+ opts = null
11+ hash = null
12+ }
713 if ( typeof opts === 'function' ) {
814 callback = opts
9- opts = { }
1015 }
11-
12- if ( typeof hash === 'object' ) {
16+ if ( hash && hash . type ) {
1317 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
2121 }
2222
2323 send ( {
@@ -28,7 +28,9 @@ module.exports = (send) => {
2828 if ( err ) {
2929 return callback ( err )
3030 }
31- callback ( null , res . Keys )
31+ callback ( null , _ . keys ( res . Keys ) . map ( hash => (
32+ { hash, type : res . Keys [ hash ] . Type }
33+ ) ) )
3234 } )
3335 } )
3436}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = (send) => {
1616 if ( err ) {
1717 return callback ( err )
1818 }
19- callback ( null , res . Pins )
19+ callback ( null , res . Pins . map ( ( hash ) => ( { hash : hash } ) ) )
2020 } )
2121 } )
2222}
You can’t perform that action at this time.
0 commit comments