Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

damassi
Copy link
Member

@damassi damassi commented Jan 23, 2018

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.

joinParts(children, delimiter = ", ") {
const joined = _.compact(children).reduce((prev, curr) => {
return [prev, delimiter, curr]
}, [])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was missing [].

Copy link
Member Author

@damassi damassi Jan 23, 2018

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...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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

@damassi
Copy link
Member Author

damassi commented Jan 23, 2018

Going to close this since @kanaabe is aware and its on the list

@damassi damassi closed this Jan 23, 2018
@damassi damassi deleted the fix-reduce-fn branch January 23, 2018 22:49
@artsy-peril
Copy link
Contributor

artsy-peril bot commented Jan 23, 2018

Fails
🚫

Could not find Dangerfile at danger/pr.ts on damassi/reaction on branch fix-reduce-fn

Full state of PR run:

{
  "branch": "fix-reduce-fn",
  "dangerfileBranchForPR": "fix-reduce-fn",
  "neededDangerfileIsLocalRepo": true,
  "repoForDangerfile": "damassi/reaction",
  "run": {
    "action": "closed",
    "dslType": 0,
    "event": "pull_request",
    "branch": "master",
    "dangerfilePath": "danger/pr.ts",
    "feedback": 0
  },
  "settings": {
    "commentableID": 494,
    "eventID": "Unknown",
    "hasRelatedCommentable": true,
    "installationID": 23511,
    "installationSettings": {
      "env_vars": [
        "SLACK_RFC_WEBHOOK_URL"
      ],
      "ignored_repos": [
        "artsy/looker",
        "artsy/clouds"
      ],
      "modules": [
        "danger-plugin-spellcheck",
        "danger-plugin-yarn",
        "@slack/client"
      ]
    },
    "isRepoEvent": true,
    "isTriggeredByUser": true,
    "repoName": "artsy/reaction",
    "repoSpecificRules": {
      "pull_request": "danger/pr.ts"
    },
    "triggeredByUsername": "damassi"
  }
}

Generated by 🚫 dangerJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants