Skip to content

lib: fix misleading maxLength param on string pad* methods#63504

Open
youngspe wants to merge 2 commits into
microsoft:mainfrom
youngspe:string-pad-params
Open

lib: fix misleading maxLength param on string pad* methods#63504
youngspe wants to merge 2 commits into
microsoft:mainfrom
youngspe:string-pad-params

Conversation

@youngspe
Copy link
Copy Markdown

@youngspe youngspe commented May 25, 2026

Fixes #63503

  • Rename the maxLength parameter for String.padStart and String.padEnd to targetLength, which matches the MDN documentation.
  • Update the documentation on those methods to match the current wording from MDN and include a documentation link

Note: As of the time the PR was created, the related issue has not been triaged. Please let me know if I didn't follow the right procedure here.

Copilot AI review requested due to automatic review settings May 25, 2026 02:54
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog May 25, 2026
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@youngspe

This comment was marked as resolved.

Comment thread src/lib/es2017.string.d.ts Outdated
* Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
* The padding is applied from the start (left) of the current string.
* Pads this string with a given string (repeated and/or truncated, if needed) so that the resulting string has a given length.
* The padding is applied from the start of this string.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this string" is ambiguous in this phrasing - it could refer to the string invoked on, or the string passed in as padding

@github-project-automation github-project-automation Bot moved this from Not started to Waiting on author in PR Backlog May 26, 2026
@youngspe youngspe requested a review from RyanCavanaugh May 26, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Waiting on author

Development

Successfully merging this pull request may close these issues.

Name of String.padStart's maxLength parameter is misleading

4 participants