Skip to content

Commit

Permalink
fix: make the linter happy for D#
Browse files Browse the repository at this point in the history
  • Loading branch information
jbenet committed Sep 16, 2016
1 parent 349a44c commit 9a5c0e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module.exports = class Node {
}

startDaemon (flags, done) {
if (typeof(flags) === 'function' && typeof(done) === 'undefined') {
if (typeof flags === 'function' && typeof done === 'undefined') {
done = flags
flags = []
}
Expand All @@ -127,7 +127,7 @@ module.exports = class Node {
parseConfig(node.path, (err, conf) => {
if (err) return done(err)

let stdout = ""
let stdout = ''
let args = ['daemon'].concat(flags || [])

// strategy:
Expand Down Expand Up @@ -179,7 +179,7 @@ module.exports = class Node {
node.apiAddr = apiM[1]
} else {
// daemon ready but no API server? seems wrong...
done2(new Error("daemon ready without api"))
done2(new Error('daemon ready without api'))
}

const gatewayM = stdout.match(/Gateway \((readonly|writable)\) server listening on (.*)\n/)
Expand Down
10 changes: 5 additions & 5 deletions test/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-env mocha */
/* eslint max-nested-callbacks: ["error", 8] */
'use strict'

const ipfsd = require('../src')
Expand Down Expand Up @@ -374,15 +375,14 @@ describe('node startDaemon', () => {
it('allows passing flags', (done) => {
ipfsd.disposable((err, node) => {
if (err) throw err
node.startDaemon(["--should-not-exist"], (err, ignore) => {
node.startDaemon(['--should-not-exist'], (err, ignore) => {
if (!err) {
throw new Error("should have errored")
throw new Error('should have errored')
}

let errStr = "Unrecognized option 'should-not-exist'"
let errStr = 'Unrecognized option \'should-not-exist\''

err = ""+ err
if (err.indexOf(errStr) >= 0) {
if (String(err).indexOf(errStr) >= 0) {
done() // correct error
}

Expand Down

0 comments on commit 9a5c0e2

Please sign in to comment.