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

tools: fix nits in tools/doc/preprocess.js #19473

Closed
wants to merge 1 commit into from
Closed

tools: fix nits in tools/doc/preprocess.js #19473

wants to merge 1 commit into from

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Mar 20, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

ES6 nits:

  1. Replace remaining vars with lets.
  2. Replace a common function with an arrow function in .forEach() argument.

RegExp nits:

  1. Simplify [A-Za-z0-9-_] into [\w-].
  2. Remove capturing and not capturing parentheses in includeExpr RegExp: there is no need to group in its case + includeExpr is used only in .match() call that does not return capturing.
  3. Replace .match() with .test() in a boolean context.

Logic nits:

  1. Remove excess check: .match() with g flag can only return null or non-empty array (it cannot return an array with 0 length) + incCount may be changed only after this check.

I've built the docs on Windows (using #19330) before and after these changes and both doc sets are identical + test/doctool/test-make-doc.js is OK.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Mar 20, 2018
@vsemozhetbyt
Copy link
Contributor Author

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/277/

Let me know if we need full CI for this.

@vsemozhetbyt vsemozhetbyt added refactor to ES6+ fast-track PRs that do not need to wait for 48 hours to land. labels Mar 20, 2018
@vsemozhetbyt
Copy link
Contributor Author

Landed in 1d42b20

@vsemozhetbyt vsemozhetbyt deleted the tools-doc-preprocess branch March 21, 2018 10:41
vsemozhetbyt added a commit that referenced this pull request Mar 21, 2018
PR-URL: #19473
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
targos pushed a commit that referenced this pull request Mar 24, 2018
PR-URL: #19473
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
MylesBorins pushed a commit that referenced this pull request Aug 17, 2018
PR-URL: #19473
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants