Skip to content

Commit

Permalink
* chore(package): update standard to version 11.0.0
Browse files Browse the repository at this point in the history
* chore(package): update standard to version 11.0.0

* fix(lint): fix linting issue
  • Loading branch information
greenkeeper[bot] authored and thetutlage committed Feb 20, 2018
1 parent 16370e5 commit b2082d2
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -38,7 +38,7 @@
"pify": "^3.0.0",
"semver": "^5.5.0",
"simple-encryptor": "^1.1.1",
"standard": "^10.0.3",
"standard": "^11.0.0",
"supertest": "^3.0.0",
"test-console": "^1.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Event/Fake.js
Expand Up @@ -112,8 +112,8 @@ class EventFake {
*/
pullMany (count) {
const pulledEmits = _.size(this._emits) < count
? this._emits.splice(0)
: this._emits.splice(_.size(this._emits) - count)
? this._emits.splice(0)
: this._emits.splice(_.size(this._emits) - count)
return _.reverse(pulledEmits)
}

Expand Down
4 changes: 2 additions & 2 deletions src/Route/Store.js
Expand Up @@ -146,8 +146,8 @@ class RouteStore {
const isDomain = domain && route.forDomain && route.forDomain.test(domain)

return domain
? (isName() && isDomain) || (isHandler() && isDomain) || (isRoute() && isDomain)
: isName() || isRoute() || isHandler()
? (isName() && isDomain) || (isHandler() && isDomain) || (isRoute() && isDomain)
: isName() || isRoute() || isHandler()
})
}

Expand Down
60 changes: 30 additions & 30 deletions src/Server/index.js
Expand Up @@ -273,11 +273,11 @@ class Server {
}

return new Middleware()
.register(this._middleware.server)
.runner()
.params([ctx])
.resolve(this._resolveMiddleware.bind(this))
.run()
.register(this._middleware.server)
.runner()
.params([ctx])
.resolve(this._resolveMiddleware.bind(this))
.run()
}

/**
Expand All @@ -299,12 +299,12 @@ class Server {
debug('executing %d global and route middleware', middleware.length)

return new Middleware()
.register(middleware)
.runner()
.params([ctx])
.concat([routeHandler])
.resolve(this._resolveMiddleware.bind(this))
.run()
.register(middleware)
.runner()
.params([ctx])
.concat([routeHandler])
.resolve(this._resolveMiddleware.bind(this))
.run()
}

/**
Expand Down Expand Up @@ -636,33 +636,33 @@ class Server {
debug('new request on %s url', request.url())

this._executeServerMiddleware(ctx)
.then(() => {
.then(() => {
/**
* We need to find out whether any of the server middleware has
* ended the response or not.
*
* If they did, then simply do not execute the route.
*/
this._evaluateResponse(response)
if (!response.isPending) {
debug('ending request within server middleware chain')
return
}
this._evaluateResponse(response)
if (!response.isPending) {
debug('ending request within server middleware chain')
return
}

const route = this._getRoute(ctx)
return this._executeRouteHandler(route.route.middlewareList, ctx, {
namespace: this._routeHandler.bind(this),
params: [route.route.handler]
const route = this._getRoute(ctx)
return this._executeRouteHandler(route.route.middlewareList, ctx, {
namespace: this._routeHandler.bind(this),
params: [route.route.handler]
})
})
.then(() => {
debug('ending response for %s url', request.url())
this._endResponse(response)
})
.catch((error) => {
debug('received error on %s url', request.url())
this._handleException(error, ctx)
})
})
.then(() => {
debug('ending response for %s url', request.url())
this._endResponse(response)
})
.catch((error) => {
debug('received error on %s url', request.url())
this._handleException(error, ctx)
})
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/integration/index.spec.js
Expand Up @@ -16,7 +16,7 @@ process.env.HOST = 'localhost'
process.env.PORT = '3333'

setup()
.then(() => {
requireAll(path.join(__dirname, './specs'))
})
.catch(console.log)
.then(() => {
requireAll(path.join(__dirname, './specs'))
})
.catch(console.log)
4 changes: 2 additions & 2 deletions test/unit/route.spec.js
Expand Up @@ -789,8 +789,8 @@ test.group('Route | Manager', (group) => {
RouteManager.get('/product/category/:id', function () {})
RouteManager.get('/product/:id', function () {})
})
.prefix('api')
.formats(['json'])
.prefix('api')
.formats(['json'])

const { route } = RouteManager.match('/api/product/category', 'GET')
assert.equal(route._route, '/api/product/category/:id:format(.json)?')
Expand Down
4 changes: 2 additions & 2 deletions test/unit/server.spec.js
Expand Up @@ -995,8 +995,8 @@ test.group('Server | Calls', (group) => {
Route.get('/', async function ({ ids }) {
return ids
})
.middleware('app:1')
.middleware('app:2')
.middleware('app:1')
.middleware('app:2')

this.server.registerNamed({
'app': 'Middleware/AppMiddleware'
Expand Down

0 comments on commit b2082d2

Please sign in to comment.