refactor: use format for error messages in stats/base/dists/hypergeometric/ctor - #13799
Closed
Planeshifter wants to merge 1 commit into
Closed
refactor: use format for error messages in stats/base/dists/hypergeometric/ctor#13799Planeshifter wants to merge 1 commit into
format for error messages in stats/base/dists/hypergeometric/ctor#13799Planeshifter wants to merge 1 commit into
Conversation
…eometric/ctor` Route the two constructor `RangeError` messages (`K > N` and `n > N` guards) through `@stdlib/string/format`, matching the canonical error-construction convention. Every other throw in this file already uses `format` (three `TypeError` argument checks and all six property setters), and all 34 `stats/base/dists/*/ctor` packages construct thrown errors via `format` (100% conformance); this package held the only two plain-string throws. Message text is unchanged and the thrown error type remains `RangeError`, so no observable behavior or test expectation changes (tests assert error type only).
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
requested changes
Jul 31, 2026
kgryte
left a comment
Member
There was a problem hiding this comment.
There are no variables to interpolate in the error message string. Closing...
kgryte
deleted the
philipp/drift-stats-base-dists-hypergeometric-2026-07-31
branch
July 31, 2026 11:15
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.
Resolves N/A.
Description
This pull request:
RangeErrormessages in@stdlib/stats/base/dists/hypergeometric/ctor(theK > Nandn > Nguards inlib/main.js) through@stdlib/string/format, the canonical error-construction helper.@stdlib/stats/base/dists/hypergeometric/ctorThe two constructor cross-parameter
RangeErrorguards were the only throws in the package built from plain string literals; every other throw in the same file — the threeTypeErrorargument checks and all six property setters — already usesformat. All 34stats/base/dists/*/ctorpackages construct thrown errors viaformat(100% conformance), leaving these two the sole plain-string outliers. Message text is unchanged and the thrown type staysRangeError, so no observable behavior or test expectation changes.Related Issues
No.
Questions
No.
Other
Diff is +2/-2 in a single file.
formatis already imported. The package tests assert error type (RangeError) only, not message text, andformatreturns a constant (no%-specifier) message unchanged, so the change is mechanical with no cascade into tests, examples, or docs.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running the cross-package drift-detection routine. The namespace
@stdlib/stats/base/dists/hypergeometricwas selected by uniform-random pick over eligible directories (≥8 direct child packages) underlib/node_modules/@stdlib/; structural and per-package semantic features were extracted across all 11 members; majority patterns were computed at the 75% threshold; and three independent validation agents (opus semantic-review, opus cross-reference, sonnet structural-review) confirmed this correction asconfirmed-driftbefore any file was edited. The within-namespace vote was internally consistent (matching prior run #12647); this correction was surfaced by the canonical-formaterror-construction invariant and confirmed by the ≥90% ecosystem-wide gate.@stdlib-js/reviewers
Generated by Claude Code