Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 7bb237d

Browse files
Pedro SantosAlan Shaw
Pedro Santos
authored and
Alan Shaw
committed
chore: update object links api with real example (#548)
1 parent f33fb89 commit 7bb237d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

SPEC/OBJECT.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,16 @@ A great source of [examples][] can be found in the tests for this API.
168168
**Example:**
169169

170170
```JavaScript
171-
const multihash = 'QmPb5f92FxKPYdT3QNBd1GKiL4tZUXUrzF4Hkpdr3Gf1gK'
171+
const multihash = 'Qmc5XkteJdb337s7VwFBAGtiaoj2QCEzyxtNRy3iMudc3E'
172172

173173
const links = await ipfs.object.links(multihash)
174-
console.log(links)
174+
const hashes = links.map((link) => link.Hash.toString())
175+
console.log(hashes)
175176
// Logs:
176-
// []
177+
// [
178+
// 'QmZbj5ruYneZb8FuR9wnLqJCpCXMQudhSdWhdhp5U1oPWJ',
179+
// 'QmSo73bmN47gBxMNqbdV6rZ4KJiqaArqJ1nu5TvFhqqj1R'
180+
// ]
177181
```
178182

179183
A great source of [examples][] can be found in the tests for this API.

0 commit comments

Comments
 (0)