Skip to content

Commit

Permalink
refactor: use object destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 19, 2018
1 parent e642b9d commit dd44f8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/middleware.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const path = require('path');
const { posix: { join } } = require('path');
const mime = require('mime');
const DevMiddlewareError = require('./DevMiddlewareError');
const { getFilenameFromUrl, handleRangeHeaders, handleRequest, ready } = require('./util');
Expand Down Expand Up @@ -51,7 +51,7 @@ module.exports = function wrapper(context) {
throw new DevMiddlewareError('next');
}

filename = path.posix.join(filename, index);
filename = join(filename, index);
stat = context.fs.statSync(filename);
if (!stat.isFile()) {
throw new DevMiddlewareError('next');
Expand Down

0 comments on commit dd44f8c

Please sign in to comment.