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

docs: use computed key when assigning property to request #2100

Merged
merged 1 commit into from Feb 16, 2020

Conversation

mattmazzola
Copy link
Contributor

@mattmazzola mattmazzola commented Feb 15, 2020

Noticed this when reading through docs on plugins. I think the intention was for the util to be the same in every case, but in the first case it was assigning the value to the literal key property of request instead of the computed value of key using square brackets.

Since it's the first example it confused me, but made sense when I looked further down and noticed the second and third examples using square bracket notation. This makes them all the same.

request.key = value
request[key] = value

Checklist

  • run npm run test and npm run benchmark
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows Code of conduct

Noticed this when reading through docs on plugins.  I think the intention was for the util to be the same in every case, but in the first case it was assigning the value to the literal key property of request instead of the computed value of key using square brackets.

Since it's the first example it confused me, but made since when I looked further down.

```
request.key = value
request[key] = value
```
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

good spot!

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants