-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@kanaabe => [Publishing] Fix missing reduce start value #494
Conversation
joinParts(children, delimiter = ", ") { | ||
const joined = _.compact(children).reduce((prev, curr) => { | ||
return [prev, delimiter, curr] | ||
}, []) |
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.
Was missing []
.
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.
Actually, this is a bit stranger now that I'm looking at it closer. For some reason auto-infering a start value leads to correct test results, but compacting an end value with a start value errors out. Looking...
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.
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.
And arr.reduce(callback[, initialValue])
is the signature -- no starting value required
Going to close this since @kanaabe is aware and its on the list |
Generated by 🚫 dangerJS |
Just noticed a weird issue in this Webpack PR where it was erroring out due to a missing start value in a
reduce
fn. I double checked the rest of the projects so ignore other changes as Prettier. Odd that this never came up before.