Skip to content

Commit

Permalink
Fix linting errors (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
floatdrop authored and leo committed Mar 20, 2017
1 parent e769ff2 commit 0b4a520
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const TESTING = process.env.NODE_ENV === 'test'

const serve = fn => server((req, res) => exports.run(req, res, fn))

module.exports = exports = serve
module.exports = serve
exports = serve

exports.send = send
exports.sendError = sendError
Expand All @@ -30,7 +31,7 @@ exports.run = (req, res, fn) =>
})
.catch(err => sendError(req, res, err))

// maps requests to buffered raw bodies so that
// Maps requests to buffered raw bodies so that
// multiple calls to `json` work as expected
const rawBodyMap = new WeakMap()

Expand Down Expand Up @@ -97,7 +98,7 @@ function send(res, code, obj = null) {
let str = obj

if (typeof obj === 'object' || typeof obj === 'number') {
// we stringify before setting the header
// We stringify before setting the header
// in case `JSON.stringify` throws and a
// 500 has to be sent instead

Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test('send(200, <Object>)', async t => {

test('send(200, <Number>)', async t => {
const fn = async (req, res) => {
// chosen by fair dice roll. guaranteed to be random.
// Chosen by fair dice roll. guaranteed to be random.
send(res, 200, 4)
}

Expand All @@ -59,7 +59,7 @@ test('send(200, <Number>)', async t => {

test('send(200, <Buffer>)', async t => {
const fn = async (req, res) => {
send(res, 200, new Buffer('muscle'))
send(res, 200, Buffer.from('muscle'))
}

const url = await getUrl(fn)
Expand Down Expand Up @@ -153,7 +153,7 @@ test('return <Object>', async t => {

test('return <Number>', async t => {
const fn = async () => {
// chosen by fair dice roll. guaranteed to be random.
// Chosen by fair dice roll. guaranteed to be random.
return 4
}

Expand All @@ -166,7 +166,7 @@ test('return <Number>', async t => {
})

test('return <Buffer>', async t => {
const fn = async () => new Buffer('Hammer')
const fn = async () => Buffer.from('Hammer')

const url = await getUrl(fn)
const res = await request(url)
Expand Down

0 comments on commit 0b4a520

Please sign in to comment.