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

Issue #3313: DRY up etag and wetag code. #3314

Closed
wants to merge 3 commits into from
Closed

Conversation

lpage
Copy link
Contributor

@lpage lpage commented May 18, 2017

After implementing the code, all tests passed and performance benchmarks checked out.

lib/utils.js Outdated
* @api private
*/

function setTag(weak) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please place the non-exported function with the others at the bottom of the file.

lib/utils.js Outdated
? new Buffer(body, encoding)
: body;

return etag(buf, {weak: weak});
Copy link
Contributor

Choose a reason for hiding this comment

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

@lpage
Copy link
Contributor Author

lpage commented May 18, 2017

Submitted new version of code contribution. Per feedback, I moved the helper function I created to the bottom of the file, ran the JS Standard tool against my contribution and made changes per its recommendations, but only to the code I touched. Note: the JS Standard tool found a number of issues with the code in ./lib/utils.js that do NOT relate to the code refactoring I did.

@dougwilson
Copy link
Contributor

Awesome! And yea, it is not expected at this time that the files will pass; changing the style will cause almost every line to change, so rather than wholesale change every line all of a sudden, breaking all outstanding PRs, just styling changed lines is what the plan is.

lib/utils.js Outdated
* @api private
*/

function setTag (weak) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed this is "setTag" instead of like "setETag". Is the missing "e" a typo?

@lpage
Copy link
Contributor Author

lpage commented May 18, 2017

Per your feedback, I've updated the name of the helper function from "setTag" to "setETag." Thanks for pointing this out. Cheers.

@dougwilson dougwilson self-assigned this Sep 28, 2017
@dougwilson dougwilson added this to the 4.16 milestone Sep 28, 2017
@dougwilson dougwilson mentioned this pull request Sep 28, 2017
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants