From c07c25c2d69dddfe5a3bae06775960d5b3f6f08e Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Tue, 9 Jul 2019 10:24:53 -0400 Subject: [PATCH] fix: repo.gc() response format --- SPEC/REPO.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SPEC/REPO.md b/SPEC/REPO.md index 4ff4313c..c0abc44f 100644 --- a/SPEC/REPO.md +++ b/SPEC/REPO.md @@ -16,7 +16,11 @@ Where: - `quiet` writes a minimal output. - `stream-errors` stream errors. -`callback` must follow `function (err, res) {}` signature, where `err` is an Error if the operation was not successful. +`callback` must follow `function (err, res) {}` signature, where +- `err` is an Error if the whole GC operation was not successful. +- `res` is an array of objects that contains the following properties + - `err` is an Error if it was not possible to GC a particular block. + - `cid` is the [CID][cid] of the block that was Garbage Collected. If no `callback` is passed, a promise is returned. @@ -80,3 +84,4 @@ ipfs.repo.version((err, version) => console.log(version)) ``` [1]: https://github.com/MikeMcl/bignumber.js/ +[cid]: https://www.npmjs.com/package/cids