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

crypto: fixing typo's in methods syntax #40981

Closed
wants to merge 1 commit into from

Conversation

khairnarsaurabh23
Copy link

Fixed some typo's in crypto docs.

Fixed some typo's in crypto docs.
@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. labels Nov 26, 2021
@khairnarsaurabh23 khairnarsaurabh23 changed the title Update crypto.md crypto.md docs typo fixing Nov 26, 2021
@khairnarsaurabh23 khairnarsaurabh23 changed the title crypto.md docs typo fixing crypto.md docs typo in methods Nov 26, 2021
@khairnarsaurabh23 khairnarsaurabh23 changed the title crypto.md docs typo in methods crypto: fixing typo's in methods syntax Nov 26, 2021
@mscdex
Copy link
Contributor

mscdex commented Nov 26, 2021

Those aren't typos. They are indicating that that parameter is completely optional. Placing the comma inside the brackets makes that more evident since you can completely remove the brackets and everything in between and still have a syntactically valid function signature.

@khairnarsaurabh23
Copy link
Author

@mscdex Thanking you.

@Trott
Copy link
Member

Trott commented Nov 26, 2021

I think it reflects a UNIX-y man page format and this is not the first time folks have misunderstood it. I do wonder if we might be better off emulating MDN. They don't bother trying to specify the function signature this way. They just call it (for example) setTimeout() and then list out the parameter possibilities separately. See https://developer.mozilla.org/en-US/docs/Web/API/setTimeout for an example.

That may get unwieldy for situations where we have multiple signature possibilities for a single function. And it would be a huge change to our docs. There may be many downsides I haven't considered. So my suggestion here may be a terrible idea.

@richardlau
Copy link
Member

We could do with a doc writing guide (#25548). At the moment it's kind of split between

That may get unwieldy for situations where we have multiple signature possibilities for a single function. And it would be a huge change to our docs. There may be many downsides I haven't considered. So my suggestion here may be a terrible idea.

FWIW there's discussions around adopting Electron's style guide (partly to make it easier to derive type information): #40953

@khairnarsaurabh23
Copy link
Author

@mscdex can we write a note at top of the page or the pop up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants