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

Fixes functions outputJSON and pathExists execute callbacks even if there are errors/missing args #866

Closed
wants to merge 2 commits into from

Conversation

emarteca
Copy link

@emarteca emarteca commented Feb 3, 2021

Fixes #865

And, adds tests for this new error checking.

@RyanZim
Copy link
Collaborator

RyanZim commented Feb 8, 2021

I'm not keen to duplicate business logic from universalify into every function body; the fact that fs does type checking of arguments is unusual for Node.js, but is necessary since Node core is backed by native code. I don't see the behavior of outputJSON as problematic personally; async functions generally transmit their errors by calling callbacks anyhow.

The pathExists behavior does seem to be a bug, since no error is thrown if only a callback is passed. pathExists should error out if no path is passed to it. I don't particularly care whether the error is thrown or given to the callback, but there should be an error. This also affects using pathExists as a promise; pathExists() should not resolve to false, as it does currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants