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

Commit 7fcde72

Browse files
committed
fix: code review
1 parent a45f748 commit 7fcde72

File tree

5 files changed

+5
-94
lines changed

5 files changed

+5
-94
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ const ipfs = IpfsApi({
277277

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

285285
#### Node Management
286286

src/name/pubsub/cancel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const promisify = require('promisify-es6')
44

55
const transform = function (res, callback) {
66
callback(null, {
7-
canceled: res.Canceled
7+
canceled: res.Canceled === undefined || res.Canceled === true
88
})
99
}
1010

src/name/pubsub/subs.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
const promisify = require('promisify-es6')
44

55
const transform = function (res, callback) {
6-
callback(null, {
7-
strings: res.Strings
8-
})
6+
callback(null, res.Strings || [])
97
}
108

119
module.exports = (send) => {

test/interface.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ describe('interface-ipfs-core tests', () => {
190190
// name.pubsub.cancel
191191
{
192192
name: 'should cancel a subscription correctly returning true',
193-
reasone: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
193+
reason: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
194194
},
195195
// name.pubsub.subs
196196
{
197197
name: 'should get the list of subscriptions updated after a resolve',
198-
reasone: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
198+
reason: 'go-ipfs is really slow for publishing and resolving ipns records, unless in offline mode'
199199
}
200200
]
201201
})

test/name-pubsub.spec.js

-87
This file was deleted.

0 commit comments

Comments
 (0)