refactor(string): wrap RangeError throws in format in left-pad and right-pad#13401
Closed
Planeshifter wants to merge 2 commits into
Closed
refactor(string): wrap RangeError throws in format in left-pad and right-pad#13401Planeshifter wants to merge 2 commits into
RangeError throws in format in left-pad and right-pad#13401Planeshifter wants to merge 2 commits into
Conversation
Wraps the empty-pad-string `RangeError` message in `format(...)` to match the file's other four throws and align with the namespace convention (52 of 56 packages in `@stdlib/string` use `format` exclusively; the single plain-string throw here was the only non-conforming call in the file). Message text is unchanged.
Wraps the empty-pad-string `RangeError` message in `format(...)` to match the file's other four throws and align with the namespace convention (52 of 56 packages in `@stdlib/string` use `format` exclusively; the single plain-string throw here was the only non-conforming call in the file). Message text is unchanged.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
These changes are unnecessary as string interpolation is not required. |
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 routes the two remaining plain-string throws in the
@stdlib/stringnamespace through@stdlib/string/format. Namespace conformance forformat-wrapped error construction was 92.9% (52/56 leaf packages) before this change.@stdlib/string/left-padWrap the
RangeErroron line 70 (empty third-argument guard) informat(...), matching the four other throws inlib/main.jsand the 92.9% of@stdlib/stringleaf packages that route every error message through@stdlib/string/format.formatis already imported; the placeholder-free message renders byte-identical.@stdlib/string/right-padWrap the
RangeErroron line 70 (empty pad-string guard) informat(...), the sole remaining raw-string throw inlib/main.js. Import and message text are unchanged.Related Issues
None.
Questions
None.
Other
Neither change alters observable behavior:
formatinvoked on a placeholder-free string returns its input verbatim, so the thrownRangeErrorcarries the same.messageas before. Test suites assert error type only (not text), and no README, REPL,docs/types/test.ts, or example references the affected message strings.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code as part of an automated cross-package drift-detection routine. The routine surveys structural and semantic features across every leaf package in a namespace, identifies majority patterns, and normalizes mechanical outliers. The two throws normalized here were flagged and independently confirmed by three review passes (semantic classification, test/docs cross-reference, structural sanity) before commit. A human reviewer should confirm the interpretation.
@stdlib-js/reviewers
Generated by Claude Code