chore(deps): update dependency @netlify/eslint-config-node to ^2.2.7 #324
Conversation
@@ -111,6 +111,7 @@ const waitForDeploy = async (api, deployId, siteId, timeout) => { | |||
const getUploadList = (required, shaMap) => { | |||
if (!required || !shaMap) return [] | |||
// TODO: use `Array.flatMap()` instead once we remove support for Node <11.0.0 | |||
// eslint-disable-next-line unicorn/prefer-spread | |||
return [].concat(...required.map((sha) => shaMap[sha])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ehmicky what do think about this change? I don't think array spread can be easily used to flatten arrays like concat
.
However on Node.js >=11 Array.flat
would be a better choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change only works when the number of array to flattened is known (as in the examples in the PR). This is not the case for required
above.
Specifically, [...required.map(...)]
would not flatten arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like required
is an array of strings, not an array of arrays though.
Line 104 in 8b01b76
const { id: deployId, required: requiredFiles, required_functions: requiredFns } = deploy |
https://github.com/netlify/open-api/blob/master/swagger.yml#L2321
If that's the case, then the following should work:
return required.map((sha) => shaMap[sha])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe shaMap
is a mapping between a string (sha
) to an array of objects.
We would like to get a flattened array of all those objects.
Please correct me if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right!
Then we probably need to keep the current code as is.
This PR contains the following updates:
^2.2.5
->^2.2.7
Release Notes
netlify/eslint-config-node
v2.2.7
Compare Source
Renovate configuration
馃搮 Schedule: At any time (no schedule defined).
馃殾 Automerge: Disabled by config. Please merge this manually once you are satisfied.
鈾伙笍 Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.
馃敃 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.