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

Commit

Permalink
add links
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jan 26, 2018
1 parent d7c1b0e commit 10b72df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
9 changes: 7 additions & 2 deletions src/repo/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
2 changes: 0 additions & 2 deletions test/repo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
Expand All @@ -75,7 +74,6 @@ describe('.repo', function () {
return ipfs.repo.version()
.then(res => {
expect(res).to.exist()
expect(res).to.have.a.property('Version')
})
})
})
Expand Down

0 comments on commit 10b72df

Please sign in to comment.