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

Commit

Permalink
fix: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Oct 17, 2018
1 parent a45f748 commit 7fcde72
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 94 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ const ipfs = IpfsApi({

- [name](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md)
- [`ipfs.name.publish(addr, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md#namepublish)
- [`ipfs.name.resolve(addr, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md#nameresolve)
- [`ipfs.name.pubsub.cancel(arg, [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md#namepubsubcancel)
- [`ipfs.name.pubsub.state([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md#namepubsubstate)
- [`ipfs.name.pubsub.subs([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md#namepubsubsubs)
- [`ipfs.name.resolve(addr, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/NAME.md#nameresolve)

#### Node Management

Expand Down
2 changes: 1 addition & 1 deletion src/name/pubsub/cancel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const promisify = require('promisify-es6')

const transform = function (res, callback) {
callback(null, {
canceled: res.Canceled
canceled: res.Canceled === undefined || res.Canceled === true
})
}

Expand Down
4 changes: 1 addition & 3 deletions src/name/pubsub/subs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
const promisify = require('promisify-es6')

const transform = function (res, callback) {
callback(null, {
strings: res.Strings
})
callback(null, res.Strings || [])
}

module.exports = (send) => {
Expand Down
4 changes: 2 additions & 2 deletions test/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ describe('interface-ipfs-core tests', () => {
// name.pubsub.cancel
{
name: 'should cancel a subscription correctly returning true',
reasone: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
reason: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
},
// name.pubsub.subs
{
name: 'should get the list of subscriptions updated after a resolve',
reasone: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
reason: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
}
]
})
Expand Down
87 changes: 0 additions & 87 deletions test/name-pubsub.spec.js

This file was deleted.

0 comments on commit 7fcde72

Please sign in to comment.