Skip to content
This repository was 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 8227bce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 95 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
6 changes: 3 additions & 3 deletions test/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const CommonFactory = require('./utils/interface-common-factory')
const IPFSApi = require('../src')
const isWindows = process.platform && process.platform === 'win32'

describe('interface-ipfs-core tests', () => {
describe.only('interface-ipfs-core tests', () => {
const defaultCommonFactory = CommonFactory.create()

tests.bitswap(defaultCommonFactory, {
Expand Down 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 8227bce

Please sign in to comment.