Skip to content

docs: fix JSDoc in string/base/repeat and string/base/slice - #16255

Merged
kgryte merged 2 commits into
developfrom
claude/cool-johnson-rupxj5
Oct 24, 2026
Merged

kgryte merged 2 commits into
developfrom
claude/cool-johnson-rupxj5

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes two JSDoc comments in string/base that differ from the convention their sibling packages follow.

Namespace summary. string/base has 60 members: 59 function packages and the distances sub-namespace, which is excluded from the semantic checks. We compared file trees, package.json keys and values, README section order, index.js/main.js JSDoc shape, validation prologues, error construction and dependencies. Every feature had a clear majority (at least 75%). The structural features conform 100% across the function packages.

@stdlib/string/base/repeat

The lib/index.js module example binds the import to replace but calls repeat(...), so the example throws a ReferenceError as written. This renames the binding to repeat. 58 of 59 siblings (98%) use the same identifier in the binding and in the calls.

@stdlib/string/base/slice

@returns in lib/main.js describes the return value as "input string", but the function returns a new substring. This changes it to "output string", which matches the package's own docs/types/index.d.ts and docs/repl.txt and its siblings slice-code-points and slice-grapheme-clusters. Only the for-each* family keeps "input string", because those functions do return their input.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation. The structural features were extracted with a script over each package. The semantic features were extracted by agents that read lib/main.js and lib/index.js for every package. A separate review then checked each candidate for intentional deviation and for tests, examples or sibling docs that depend on the current text. Neither change touches runtime code, tests or public signatures.

Deliberately excluded:

  • format-interpolate builds its error messages by string concatenation instead of format. This is intentional: string/format depends on it, so using format would create a circular dependency.
  • Several packages give the implementation function a different name from the package (lpad, rtrim, kebabCase). These names are internal and not part of the public API.
  • percent-encode, atob and format-interpolate each have an open PR, so this PR leaves them alone.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code, as part of an automated check for API drift across the packages in a namespace.


@stdlib-js/reviewers


Generated by Claude Code

Renamed the `require` binding in the `lib/index.js` module example from `replace` to `repeat`, matching the identifier used in the example calls (consistent with 58/59, or 98%, of `string/base` siblings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHWHhHHqjV8UFohsfxoPku
Changed the `@returns` description from "input string" to "output string", matching the package's own TypeScript declarations and REPL text and the `string/base/slice-code-points` and `string/base/slice-grapheme-clusters` siblings (21/22 non-identity string-returning siblings use "output string").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHWHhHHqjV8UFohsfxoPku
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
string/base/repeat $\\color{green}276/276$
$\\color{green}+100.00\\%$
$\\color{green}16/16$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}276/276$
$\\color{green}+100.00\\%$
string/base/slice $\\color{green}94/94$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}94/94$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Oct 24, 2026
@kgryte
kgryte marked this pull request as ready for review October 24, 2026 02:42
@kgryte
kgryte requested a review from a team October 24, 2026 02:42
@kgryte
kgryte merged commit 27a9ec9 into develop Oct 24, 2026
34 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-rupxj5 branch October 24, 2026 02:43
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants