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

fix: fs.readFile: make options optional #11185

Merged
merged 1 commit into from
Nov 20, 2017
Merged

fix: fs.readFile: make options optional #11185

merged 1 commit into from
Nov 20, 2017

Conversation

felixrieseberg
Copy link
Member

Node documents options in fs.readFile/fs.writeFile operations as optional. We have done so for almost all operations, but made a mistake in fs.readFile - if you don't pass options, you'll get a TypeError that shouldn't be there.

This tiny PR fixes that.

Closes #11182

@felixrieseberg felixrieseberg requested a review from a team November 20, 2017 16:22
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

LGTM.

As an aside, I notice util.isString() and util.isObject() are deprecated. Any idea what the supported way is for doing that now?

@ckerr ckerr merged commit fa37d49 into master Nov 20, 2017
@ckerr ckerr deleted the fs-optional-options branch November 20, 2017 16:57
@felixrieseberg
Copy link
Member Author

@ckerr Oh, good catch! Core moved those out into userland (https://github.com/isaacs/core-util-is), with the argument being that those have no place in core. I'll make another PR that goes with the module rather than the deprecated functions.

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.

fs.readFile(path, null, cb) TypeError: Bad arguments
2 participants