-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
doc: mark the callback argument of crypto.generatePrime as mandatory #58299
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
Merged
Conversation
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
Review requested:
|
729d702
to
51cc18d
Compare
51cc18d
to
44a7fd0
Compare
The current documentation lists the `callback` argument of `crypto.generatePrime` as optional (it's surrounded by square brackets), but this is incorrect - calling the function without a callback will result in an `ERR_INVALID_ARG_TYPE` error: For the record, the correct way to generate a prime synchronously, without a callback, is to use the `generatePrimeSync` API. This patch fixes the documentation and marks the callback argument as mandatory. The `options` (second) argument, is indeed optional, and is marked as such. Fixes: nodejs#58298
44a7fd0
to
4cf5fc2
Compare
jasnell
approved these changes
May 12, 2025
UlisesGascon
approved these changes
May 13, 2025
geeksilva97
approved these changes
May 13, 2025
Landed in 373f2c5 |
targos
pushed a commit
that referenced
this pull request
May 16, 2025
The current documentation lists the `callback` argument of `crypto.generatePrime` as optional (it's surrounded by square brackets), but this is incorrect - calling the function without a callback will result in an `ERR_INVALID_ARG_TYPE` error: For the record, the correct way to generate a prime synchronously, without a callback, is to use the `generatePrimeSync` API. This patch fixes the documentation and marks the callback argument as mandatory. The `options` (second) argument, is indeed optional, and is marked as such. Fixes: #58298 PR-URL: #58299 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Jun 10, 2025
The current documentation lists the `callback` argument of `crypto.generatePrime` as optional (it's surrounded by square brackets), but this is incorrect - calling the function without a callback will result in an `ERR_INVALID_ARG_TYPE` error: For the record, the correct way to generate a prime synchronously, without a callback, is to use the `generatePrimeSync` API. This patch fixes the documentation and marks the callback argument as mandatory. The `options` (second) argument, is indeed optional, and is marked as such. Fixes: #58298 PR-URL: #58299 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
crypto
Issues and PRs related to the crypto subsystem.
doc
Issues and PRs related to the documentations.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current documentation lists the
callback
argument ofcrypto.generatePrime
as optional (it's surrounded by square brackets), but this is incorrect - calling the function without a callback will result in an error:For the record, the correct way to generate a prime synchronously, without a callback, is to use the
generatePrimeSync
API.This PR fixes the documentation and marks the callback argument as mandatory. The
options
(second) argument, is indeed optional, and is marked as such.Fixes: #58298