Skip to content

refactor: use native padStart() in padLeftZeros utility#4202

Merged
pan-kot merged 2 commits intocloudscape-design:mainfrom
TrevorBurnham:refactor/use-padstart-for-pad-left-zeros
Jan 29, 2026
Merged

refactor: use native padStart() in padLeftZeros utility#4202
pan-kot merged 2 commits intocloudscape-design:mainfrom
TrevorBurnham:refactor/use-padstart-for-pad-left-zeros

Conversation

@TrevorBurnham
Copy link
Contributor

Description

This PR replaces a while loop with padStart for cleaner, more idiomatic code. The padStart method has been widely supported for several years now.

How has this been tested?

This utility function has extensive unit test coverage.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Replace manual while loop with String.prototype.padStart() for cleaner,
more idiomatic code. This native ES2017 method provides the same
functionality with better readability.
@TrevorBurnham TrevorBurnham requested a review from a team as a code owner January 25, 2026 00:58
@TrevorBurnham TrevorBurnham requested review from pan-kot and removed request for a team January 25, 2026 00:58
@pan-kot pan-kot enabled auto-merge January 29, 2026 10:36
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.17%. Comparing base (4129df4) to head (ae40994).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4202      +/-   ##
==========================================
- Coverage   97.17%   97.17%   -0.01%     
==========================================
  Files         882      882              
  Lines       25826    25824       -2     
  Branches     9333     9333              
==========================================
- Hits        25097    25095       -2     
  Misses        682      682              
  Partials       47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pan-kot pan-kot added this pull request to the merge queue Jan 29, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 29, 2026
@pan-kot pan-kot added this pull request to the merge queue Jan 29, 2026
Merged via the queue into cloudscape-design:main with commit 170fdf8 Jan 29, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants