docs: correct scale parameter JSDoc type in stats/base/dists/levy#12027
Merged
docs: correct scale parameter JSDoc type in stats/base/dists/levy#12027
stats/base/dists/levy#12027Conversation
The JSDoc `@param` tag for the scale parameter `c` was annotated as `NonNegativeNumber` in `lib/main.js`, `lib/factory.js`, and `lib/native.js`. The runtime guard rejects `c <= 0.0` (returning `NaN`), so `c = 0` is not a valid input and the correct annotation is `PositiveNumber`. The remaining 11 packages in `@stdlib/stats/base/dists/levy/*` consistently use `PositiveNumber` for `c` (92% conformance).
The native binding wrapper documented the scale parameter `c` with the loose JSDoc type `number`, while the corresponding `lib/main.js` and the rest of the namespace use `PositiveNumber` (82% conformance across native binding wrappers in the same namespace). The runtime returns `NaN` for `c <= 0.0`, so `PositiveNumber` is the type that matches actual behavior.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
May 9, 2026
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 tightens the JSDoc
@paramannotation for the scale parametercin two outlier packages within@stdlib/stats/base/dists/levy/*so that the documented type matches the runtime behavior and the rest of the namespace.Namespace summary
cdf,ctor,entropy,logcdf,logpdf,mean,median,mode,pdf,quantile,stdev,variance).package.jsonshape, README headings,manifest.jsonshape, test/benchmark/example file naming, public signatures, validation prologues, error construction, JSDoc shape, and source dependencies.@paramtype for the scale parameterc.ctorpackage legitimately has no native addon), R benchmark files (present only in distribution-function packages), Julia test fixtures (varies by package; not mechanically synthesizable),lib/factory.jspresence (only relevant for distribution-function packages), and## NotesREADME section (specific to packages with non-trivial domain notes).Per outlier package
@stdlib/stats/base/dists/levy/quantileCorrects the JSDoc
@paramannotation for the scale parametercinlib/main.js,lib/factory.js, andlib/native.jsfromNonNegativeNumbertoPositiveNumber. The runtime guard returnsNaNforc <= 0.0, so zero is not a valid input and the looser annotation was incorrect. Brings this package into alignment with the 11 other Lévy distribution packages that already usePositiveNumberforc(92% conformance).@stdlib/stats/base/dists/levy/cdfCorrects the JSDoc type annotation for the scale parameter
cinlib/native.jsfrom{number}to{PositiveNumber}, bringing the native binding wrapper into conformance with the 82% majority pattern across analogous wrappers and withlib/main.js, which already documents the parameter correctly. The looser{number}annotation is inaccurate: the runtime returnsNaNforc <= 0, soPositiveNumberis the precise type. No logic changes.Validation
Checked via:
package.jsonshape, README headings,manifest.jsonshape, test/benchmark/example file naming).docs/types/index.d.tsdeclarations use barenumberand tests verify runtime behavior viatape), and structural review (n/a; the change is a JSDoc tag edit, not a structural addition).Deliberately excluded:
ctorlacking native binding files because it is a class constructor, not a math function).Related Issues
No.
Questions
No.
Other
Total diff: 4 lines across 4 files in 2 outlier packages. Each commit groups all corrections per outlier package.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code via an automated cross-package API drift detection routine. The routine extracts structural and semantic features from every non-autogenerated package in a randomly selected stdlib namespace, identifies the majority pattern per feature, and flags deviating packages. Proposed corrections were validated by three independent agents (semantic review, cross-reference review, structural review) before being applied. All applied changes are mechanical JSDoc type corrections that preserve runtime behavior.
Generated by Claude Code