Skip to content

Commit

Permalink
lint: apply standard 12 style
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Dec 16, 2018
1 parent fdba887 commit 2b73852
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ before_install:
- "npm config set shrinkwrap false"
# Setup Node.js version-specific dependencies
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 6 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)"
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
Expand Down
2 changes: 1 addition & 1 deletion lib/types/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function simpleparser (options) {
}

debug('parse urlencoding')
return parse(body, undefined, undefined, {maxKeys: parameterLimit})
return parse(body, undefined, undefined, { maxKeys: parameterLimit })
}
}

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"type-is": "~1.6.16"
},
"devDependencies": {
"eslint": "4.19.1",
"eslint-config-standard": "11.0.0",
"eslint-plugin-import": "2.13.0",
"eslint": "5.10.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-markdown": "1.0.0-beta.6",
"eslint-plugin-node": "6.0.1",
"eslint-plugin-promise": "3.8.0",
"eslint-plugin-standard": "3.1.0",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-promise": "4.0.1",
"eslint-plugin-standard": "4.0.0",
"istanbul": "0.4.5",
"methods": "1.1.2",
"mocha": "2.5.3",
Expand Down
8 changes: 4 additions & 4 deletions test/body-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ describe('bodyParser()', function () {

describe('with verify option', function () {
it('should apply to json', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x20) throw new Error('no leading space')
}})
} })

request(server)
.post('/')
Expand All @@ -122,9 +122,9 @@ describe('bodyParser()', function () {
})

it('should apply to urlencoded', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x20) throw new Error('no leading space')
}})
} })

request(server)
.post('/')
Expand Down
32 changes: 16 additions & 16 deletions test/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ describe('bodyParser.json()', function () {
})

it('should error from verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x5b) throw new Error('no arrays')
}})
} })

request(server)
.post('/')
Expand All @@ -402,9 +402,9 @@ describe('bodyParser.json()', function () {
})

it('should error with type = "entity.verify.failed"', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x5b) throw new Error('no arrays')
}})
} })

request(server)
.post('/')
Expand All @@ -415,12 +415,12 @@ describe('bodyParser.json()', function () {
})

it('should allow custom codes', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] !== 0x5b) return
var err = new Error('no arrays')
err.status = 400
throw err
}})
} })

request(server)
.post('/')
Expand All @@ -430,12 +430,12 @@ describe('bodyParser.json()', function () {
})

it('should allow custom type', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] !== 0x5b) return
var err = new Error('no arrays')
err.type = 'foo.bar'
throw err
}})
} })

request(server)
.post('/')
Expand All @@ -446,9 +446,9 @@ describe('bodyParser.json()', function () {
})

it('should include original body on error object', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x5b) throw new Error('no arrays')
}})
} })

request(server)
.post('/')
Expand All @@ -459,9 +459,9 @@ describe('bodyParser.json()', function () {
})

it('should allow pass-through', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x5b) throw new Error('no arrays')
}})
} })

request(server)
.post('/')
Expand All @@ -471,9 +471,9 @@ describe('bodyParser.json()', function () {
})

it('should work with different charsets', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x5b) throw new Error('no arrays')
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'application/json; charset=utf-16')
Expand All @@ -482,9 +482,9 @@ describe('bodyParser.json()', function () {
})

it('should 415 on unknown charset prior to verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
throw new Error('unexpected verify call')
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'application/json; charset=x-bogus')
Expand Down
12 changes: 6 additions & 6 deletions test/raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ describe('bodyParser.raw()', function () {
})

it('should error from verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x00) throw new Error('no leading null')
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'application/octet-stream')
Expand All @@ -259,12 +259,12 @@ describe('bodyParser.raw()', function () {
})

it('should allow custom codes', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] !== 0x00) return
var err = new Error('no leading null')
err.status = 400
throw err
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'application/octet-stream')
Expand All @@ -273,9 +273,9 @@ describe('bodyParser.raw()', function () {
})

it('should allow pass-through', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x00) throw new Error('no leading null')
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'application/octet-stream')
Expand Down
16 changes: 8 additions & 8 deletions test/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ describe('bodyParser.text()', function () {
})

it('should error from verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x20) throw new Error('no leading space')
}})
} })

request(server)
.post('/')
Expand All @@ -283,12 +283,12 @@ describe('bodyParser.text()', function () {
})

it('should allow custom codes', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] !== 0x20) return
var err = new Error('no leading space')
err.status = 400
throw err
}})
} })

request(server)
.post('/')
Expand All @@ -298,9 +298,9 @@ describe('bodyParser.text()', function () {
})

it('should allow pass-through', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x20) throw new Error('no leading space')
}})
} })

request(server)
.post('/')
Expand All @@ -310,9 +310,9 @@ describe('bodyParser.text()', function () {
})

it('should 415 on unknown charset prior to verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
throw new Error('unexpected verify call')
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'text/plain; charset=x-bogus')
Expand Down
24 changes: 12 additions & 12 deletions test/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ describe('bodyParser.urlencoded()', function () {
})

it('should error from verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x20) throw new Error('no leading space')
}})
} })

request(server)
.post('/')
Expand All @@ -531,9 +531,9 @@ describe('bodyParser.urlencoded()', function () {
})

it('should error with type = "entity.verify.failed"', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x20) throw new Error('no leading space')
}})
} })

request(server)
.post('/')
Expand All @@ -544,12 +544,12 @@ describe('bodyParser.urlencoded()', function () {
})

it('should allow custom codes', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] !== 0x20) return
var err = new Error('no leading space')
err.status = 400
throw err
}})
} })

request(server)
.post('/')
Expand All @@ -559,12 +559,12 @@ describe('bodyParser.urlencoded()', function () {
})

it('should allow custom type', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] !== 0x20) return
var err = new Error('no leading space')
err.type = 'foo.bar'
throw err
}})
} })

request(server)
.post('/')
Expand All @@ -575,9 +575,9 @@ describe('bodyParser.urlencoded()', function () {
})

it('should allow pass-through', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
if (buf[0] === 0x5b) throw new Error('no arrays')
}})
} })

request(server)
.post('/')
Expand All @@ -587,9 +587,9 @@ describe('bodyParser.urlencoded()', function () {
})

it('should 415 on unknown charset prior to verify', function (done) {
var server = createServer({verify: function (req, res, buf) {
var server = createServer({ verify: function (req, res, buf) {
throw new Error('unexpected verify call')
}})
} })

var test = request(server).post('/')
test.set('Content-Type', 'application/x-www-form-urlencoded; charset=x-bogus')
Expand Down

0 comments on commit 2b73852

Please sign in to comment.