docs: add missing @throws annotation for c in random/iter/triangular - #14590
Draft
Planeshifter wants to merge 1 commit into
Draft
docs: add missing @throws annotation for c in random/iter/triangular#14590Planeshifter wants to merge 1 commit into
@throws annotation for c in random/iter/triangular#14590Planeshifter wants to merge 1 commit into
Conversation
The `random/iter/triangular` iterator validates its `c` argument and
throws a `TypeError` when `c` is not a number, but the function JSDoc
omitted the corresponding `@throws` annotation. Add the missing
`@throws {TypeError}` tag for `c`, positioned in code order between the
`b` type-check and the `a <= c <= b` range-check annotations.
Every sibling `random/iter` package that validates a positional
argument documents a `@throws` tag for each such argument (40/40
conformance among packages with positional parameters); `triangular`
was the sole outlier. Documentation-only; no change to runtime
behavior.
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 adds a
@throwsannotation that was missing fromrandom/iter/triangularrelative to every other iterator factory in therandom/iternamespace.random/iter/triangularThe
triangulariterator validates itscargument (the distribution mode) and throws aTypeErrorwhencis not a number, yet the function JSDoc documented only theaandbargument throws. Every siblingrandom/iterpackage that validates positional arguments documents a@throwstag for each such argument (40/40 conformance among packages with positional parameters);triangularwas the sole outlier. This change adds the single missing@throws {TypeError}tag forcin code order, between thebtype-check and thea <= c <= brange-check annotations. Documentation only — no executable code, error messages, or test expectations change.Questions
No.
Other
Conformance: 40/40 (100%) of
random/iterpackages that validate positional arguments document one@throwstag per argument;triangularwas the only package documenting fewer tags than it throws. The deviation was surfaced by an automated cross-package drift analysis of the namespace (structural + semantic feature extraction, majority vote at a 75% threshold, per-outlier validation) and confirmed against the package's source, tests, and examples. The fix is a single-line JSDoc addition confined torandom/iter/triangular/lib/main.js.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was produced by an automated cross-package drift-detection routine running in Claude Code. The routine extracted structural and semantic features from every package in the
random/iternamespace, computed the majority documentation pattern, flagged the single deviating package, and validated the finding before applying a one-line JSDoc fix. A maintainer should review before promoting from draft.@stdlib-js/reviewers
Generated by Claude Code