From 10b72df86ad1a6e86c02a90733168b8e50d55cbb Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 25 Jan 2018 11:21:05 +0000 Subject: [PATCH] add links --- README.md | 7 ++++--- src/repo/version.js | 9 +++++++-- test/repo.spec.js | 2 -- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 98dcea73c..900b5dc76 100644 --- a/README.md +++ b/README.md @@ -187,9 +187,10 @@ $ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"P - [`ipfs.block.put(block, cid, [callback])`](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/BLOCK.md#put) - [`ipfs.block.stat(cid, [callback])`](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/BLOCK.md#stat) -- repo - - `ipfs.repo.stat()` - - `ipfs.repo.gc()` +- [repo](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md) + - [`ipfs.repo.gc([options, callback])`](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#gc) + - [`ipfs.repo.stat([options, callback])`](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#stat) + - [`ipfs.repo.version([callback])`](https://github.com/ipfs/interface-ipfs-core/tree/master/SPEC/REPO.md#version) #### `Graph` diff --git a/src/repo/version.js b/src/repo/version.js index 0b49f78c6..84e2a0008 100644 --- a/src/repo/version.js +++ b/src/repo/version.js @@ -2,15 +2,20 @@ const promisify = require('promisify-es6') +const transform = function (res, callback) { + callback(null, res.Version) +} + module.exports = (send) => { return promisify((opts, callback) => { if (typeof (opts) === 'function') { callback = opts opts = {} } - send({ + + send.andTransform({ path: 'repo/version', qs: opts - }, callback) + }, transform, callback) }) } diff --git a/test/repo.spec.js b/test/repo.spec.js index f3307a19c..baf9525d9 100644 --- a/test/repo.spec.js +++ b/test/repo.spec.js @@ -51,7 +51,6 @@ describe('.repo', function () { ipfs.repo.version((err, res) => { expect(err).to.not.exist() expect(res).to.exist() - expect(res).to.have.a.property('Version') done() }) }) @@ -75,7 +74,6 @@ describe('.repo', function () { return ipfs.repo.version() .then(res => { expect(res).to.exist() - expect(res).to.have.a.property('Version') }) }) })