refactor: align stream constructor parameter names with documentation in random/streams#12624
Draft
Planeshifter wants to merge 1 commit into
Draft
refactor: align stream constructor parameter names with documentation in random/streams#12624Planeshifter wants to merge 1 commit into
Planeshifter wants to merge 1 commit into
Conversation
… in random/streams The `RandomStream` constructor, callable/newable, `factory`, and `objectMode` signatures named their distribution parameter `p` (or `k` for the Student's t distribution), diverging from the `@param`/`@throws` TSDoc and the implementation, which use the distribution-appropriate names: - exponential: `p` -> `lambda` (rate parameter) - poisson: `p` -> `lambda` (mean) - rayleigh: `p` -> `sigma` (scale parameter) - chisquare: `p` -> `k` (degrees of freedom) - t: `k` -> `v` (degrees of freedom) Parameter names in ambient declarations are documentation only and do not affect type-checking, so this is a non-behavioral refactor that makes the signatures self-consistent with their TSDoc and the runtime implementation.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request aligns the distribution parameter name in five
random/streamsdeclaration files with their own@param/@throwsTSDoc and the underlying implementation. TheRandomStreamconstructor, callable/newable,factory, andobjectModesignatures named the parameterp(orkfor the Student's t distribution), which did not match the documented/implemented name:streams/exponentialplambda(rate parameter)streams/poissonplambda(mean)streams/rayleighpsigma(scale parameter)streams/chisquarepk(degrees of freedom)streams/tkv(degrees of freedom)Each rename touches the six signature occurrences per package (constructor,
new, callable,factory, the options-onlyfactoryreturn, andobjectMode). Verified against each package'slib/main.js(function RandomStream( lambda, ... ), etc.) and its TSDoc@param/@throwstags.Parameter names in ambient declarations are documentation only and do not affect type-checking, so this is a non-behavioral refactor; no
$ExpectType/$ExpectErrorassertions are affected.Related Issues
No.
Questions
No.
Other
Part of a TypeScript-declaration audit of the
@stdlib/randomnamespace, batched into a single PR at the maintainer's request. (Thestreams/t_sek→_sepprivate-member fix is handled in a separate type PR.)Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
A TypeScript-declaration audit surfaced these inconsistencies using Claude Code; each rename target was independently verified against the implementation and TSDoc, and the changes were reviewed by myself before submitting.
@stdlib-js/reviewers