Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #219 from netlify/lint/flatten
Browse files Browse the repository at this point in the history
Remove `lodash.flatten`
  • Loading branch information
ehmicky authored Dec 10, 2020
2 parents 26be6aa + 5db4dc5 commit 151b228
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
'promise/prefer-await-to-callbacks': 0,
'promise/prefer-await-to-then': 0,
'unicorn/filename-case': 0,
'you-dont-need-lodash-underscore/flatten': 0,
},
overrides: [...overrides],
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"from2-array": "0.0.4",
"hasha": "^5.0.0",
"lodash.camelcase": "^4.3.0",
"lodash.flatten": "^4.4.0",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
"micro-api-client": "^3.3.0",
Expand Down
4 changes: 2 additions & 2 deletions src/deploy/util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path')

const flatten = require('lodash.flatten')
const pWaitFor = require('p-wait-for')

// Default filter when scanning for files
Expand Down Expand Up @@ -106,7 +105,8 @@ const waitForDeploy = async (api, deployId, siteId, timeout) => {
// Transform the fileShaMap and fnShaMap into a generic shaMap that file-uploader.js can use
const getUploadList = (required, shaMap) => {
if (!required || !shaMap) return []
return flatten(required.map((sha) => shaMap[sha]))
// TODO: use `Array.flatMap()` instead once we remove support for Node <11.0.0
return [].concat(...required.map((sha) => shaMap[sha]))
}

module.exports = {
Expand Down

0 comments on commit 151b228

Please sign in to comment.