From e17a48e8a061484a427eacbdbf4cf9adce722611 Mon Sep 17 00:00:00 2001 From: Pedro Santos Date: Tue, 29 Oct 2019 11:58:35 +0000 Subject: [PATCH] chore: update object links api with real example --- SPEC/OBJECT.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SPEC/OBJECT.md b/SPEC/OBJECT.md index 61aed4f7d..d8db3618e 100644 --- a/SPEC/OBJECT.md +++ b/SPEC/OBJECT.md @@ -168,12 +168,16 @@ A great source of [examples][] can be found in the tests for this API. **Example:** ```JavaScript -const multihash = 'QmPb5f92FxKPYdT3QNBd1GKiL4tZUXUrzF4Hkpdr3Gf1gK' +const multihash = 'Qmc5XkteJdb337s7VwFBAGtiaoj2QCEzyxtNRy3iMudc3E' const links = await ipfs.object.links(multihash) -console.log(links) +const hashes = links.map((link) => link.Hash.toString()) +console.log(hashes) // Logs: -// [] +// [ +// 'QmZbj5ruYneZb8FuR9wnLqJCpCXMQudhSdWhdhp5U1oPWJ', +// 'QmSo73bmN47gBxMNqbdV6rZ4KJiqaArqJ1nu5TvFhqqj1R' +// ] ``` A great source of [examples][] can be found in the tests for this API.