FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: ensure return value type of `options.filter` in `cpSync` consistent with doc by kylo5aby · Pull Request #52461 · nodejs/node · GitHub

/ node Public

fs: ensure return value type of options.filter in cpSync consistent with doc - #52461

Closed
kylo5aby wants to merge 1 commit into
nodejs:mainfrom
kylo5aby:fs-cpSync
Closed

fs: ensure return value type of options.filter in cpSync consistent with doc#52461
kylo5aby wants to merge 1 commit into
nodejs:mainfrom
kylo5aby:fs-cpSync

Conversation

Copy link
Copy Markdown
Contributor

Ensure return type of options.filter in cpsync matches doc.
according to the documentation, the return value of options.filter has boolean type.

nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Apr 11, 2024
lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2024

lpinca commented Apr 13, 2024

Copy link
Copy Markdown
Member

Can you add a test?

github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor Author

Can you add a test?

Hi, I have added related test

Comment on lines -67 to +66
if (isPromise(shouldCopy)) {
if (typeof shouldCopy !== 'boolean') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I have the feeling this was done on purpose, to support truthy values, and there's a Promise check to prevent mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for your feedback. and I have a question, for

opt.filter = (value) => {
 //
}

its return type contradicts the documentation, which states Returns: <boolean>, but it wont throw an error. Should here use a more precise description, such as the type that is coercible to boolean type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

/cc @nodejs/fs @bcoe @aduh95

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm fine with either (changing the code or the docs); if we change the code, let's land this as semver-major.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think I might prefer changing the docs to changing the code here.

aduh95 added the semver-major PRs that contain breaking changes and should be released in the next major version. label Apr 24, 2024

Copy link
Copy Markdown
Member

Closed in favor of #52742.

legendecas closed this Jun 19, 2024
nodejs-github-bot pushed a commit that referenced this pull request Jun 19, 2024
PR-URL: #52742
Refs: #52461
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
targos pushed a commit that referenced this pull request Jun 20, 2024
PR-URL: #52742
Refs: #52461
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
soophoo pushed a commit to soophoo/node that referenced this pull request Jun 20, 2024
PR-URL: nodejs#52742
Refs: nodejs#52461
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Jul 19, 2024
PR-URL: #52742
Refs: #52461
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL