Skip to content

Commit

Permalink
lint: move removed middlewares list to a variable
Browse files Browse the repository at this point in the history
closes #3558
closes #3677
closes #3678
  • Loading branch information
LinusU authored and dougwilson committed Sep 13, 2018
1 parent f3fa758 commit 431f653
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports.urlencoded = bodyParser.urlencoded
* Replace removed middleware with an appropriate error message.
*/

;[
var removedMiddlewares = [
'bodyParser',
'compress',
'cookieSession',
Expand All @@ -101,8 +101,10 @@ exports.urlencoded = bodyParser.urlencoded
'directory',
'limit',
'multipart',
'staticCache',
].forEach(function (name) {
'staticCache'
]

removedMiddlewares.forEach(function (name) {
Object.defineProperty(exports, name, {
get: function () {
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
Expand Down

0 comments on commit 431f653

Please sign in to comment.