-
Notifications
You must be signed in to change notification settings - Fork 30k
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
writeFileSync data
as Object
throws type error despite docs listing Object as a supported type
#39152
Comments
The object has to have a Unfortunately it seems the documentation did not get updated properly for every API that was touched by these changes (#34993). |
I think the current documentation is sufficient. The docs for
And for
If we added this line to every function with similar parameters to
Makes more sense to me to have the specifics detailed under writeFile and direct people to them for all the related functions, which is what we currently do. |
Ah yes. I think the asterisk as @mscdex described should be added. Otherwise it feels like Gryzzl's T&Cs. The object needing to have an own |
@JakobJingleheimer definitely agree it could be clearer - where would this be added though? |
I think the various (writeFile, writeFileSync, etc) type defs should all have the asterisk, and it would be fine for the related caveat to be detailed in the one place. I can put together a PR for that if acceptable 🙂 |
Sure thing. (I'm not an official contributor/maintainer btw, just someone who stumbled across this issue) While you're at it might be worth doing the same for |
Sure! I was thinking to add the asterisk for all related to this (which already link back to the 1 detailed explanation). Incoming |
Fixes: #39152 PR-URL: #39167 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #39152 PR-URL: #39167 Reviewed-By: Antoine du Hamel <[email protected]>
14.17.0
&16.4.0
local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
100% (no special conditions)
What is the expected behavior?
The type(s) for
data
listed in the docs to work.What do you see instead?
Additional information
fs docs for 14.x and 16.x both include
<Object>
as a type for writeFileSync'sdata
argument:The text was updated successfully, but these errors were encountered: