This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ A great source of [examples][] can be found in the tests for this API.
48
48
49
49
> List all the objects pinned to local storage or under a specific hash.
50
50
51
- ##### ` ipfs.pin.ls([hash ], [options]) `
51
+ ##### ` ipfs.pin.ls([cid ], [options]) `
52
52
53
53
Where:
54
54
55
- - ` hash ` is an IPFS multihash .
55
+ - ` cid ` - a [ CID ] [ cid ] instance or CID as a string or an array of CIDs .
56
56
- ` options ` is an object that can contain the following keys:
57
57
- 'type' - Return also the type of pin (direct, indirect or recursive)
58
58
@@ -107,3 +107,4 @@ console.log(pinset)
107
107
A great source of [ examples] [ ] can be found in the tests for this API.
108
108
109
109
[ examples ] : https://github.com/ipfs/interface-ipfs-core/blob/master/src/pin
110
+ [ cid ] : https://www.npmjs.com/package/cids
Original file line number Diff line number Diff line change @@ -140,5 +140,12 @@ module.exports = (createCommon, options) => {
140
140
hash : fixtures . files [ 0 ] . cid
141
141
} ] )
142
142
} )
143
+
144
+ it ( 'should list pins for multiple CIDs' , async ( ) => {
145
+ const pinset = await ipfs . pin . ls ( [ fixtures . files [ 0 ] . cid , fixtures . files [ 1 ] . cid ] )
146
+ const cids = pinset . map ( ( { hash } ) => hash )
147
+ expect ( cids ) . to . include ( fixtures . files [ 0 ] . cid )
148
+ expect ( cids ) . to . include ( fixtures . files [ 1 ] . cid )
149
+ } )
143
150
} )
144
151
}
You can’t perform that action at this time.
0 commit comments