diff --git a/lib/file-list.js b/lib/file-list.js index c73b98ca5..3422b599a 100644 --- a/lib/file-list.js +++ b/lib/file-list.js @@ -230,7 +230,7 @@ Object.defineProperty(List.prototype, 'files', { }) var uniqFlat = function (list) { - return _.uniq(_.flatten(list), 'path') + return _.uniqBy(_.flatten(list), 'path') } return { diff --git a/package.json b/package.json index 6c1c6facd..a1fe89e8c 100644 --- a/package.json +++ b/package.json @@ -266,7 +266,7 @@ "graceful-fs": "^4.1.2", "http-proxy": "^1.13.0", "isbinaryfile": "^3.0.0", - "lodash": "^3.8.0", + "lodash": "^4.0.0", "log4js": "^0.6.28", "mime": "^1.3.4", "minimatch": "^3.0.0", diff --git a/test/unit/file-list.spec.js b/test/unit/file-list.spec.js index 7e22c1652..3c4d09250 100644 --- a/test/unit/file-list.spec.js +++ b/test/unit/file-list.spec.js @@ -13,7 +13,7 @@ var config = require('../../lib/config') var patterns = (...strings) => strings.map(str => new config.Pattern(str)) function pathsFrom (files) { - return _.pluck(from(files), 'path') + return _.map(from(files), 'path') } function findFile (path, files) { @@ -268,7 +268,7 @@ describe('FileList', () => { it('cancels refreshs', () => { var checkResult = files => { - expect(_.pluck(files.served, 'path')).to.contain('/some/a.js', '/some/b.js', '/some/c.js') + expect(_.map(files.served, 'path')).to.contain('/some/a.js', '/some/b.js', '/some/c.js') } var p1 = list.refresh().then(checkResult)