Skip to content

feat(string/dedent): add dedent function for removing common leading whitespace#1679

Open
sukvvon wants to merge 3 commits intotoss:mainfrom
sukvvon:feat/string-dedent
Open

feat(string/dedent): add dedent function for removing common leading whitespace#1679
sukvvon wants to merge 3 commits intotoss:mainfrom
sukvvon:feat/string-dedent

Conversation

@sukvvon
Copy link
Copy Markdown
Contributor

@sukvvon sukvvon commented Apr 3, 2026

Summary

  • Add dedent function that removes common leading whitespace from multi-line strings
  • Supports both regular function calls and tagged template literals
  • Normalizes CRLF to LF, strips leading/trailing empty lines, preserves relative indentation
  • 100% test coverage (15 test cases including edge cases)
  • Docs in all 4 languages (en, ko, ja, zh_hans)

Closes #842

Test Plan

  • Basic whitespace removal
  • Relative indentation preservation
  • Tagged template literal with interpolations
  • Empty lines, single line, empty string
  • Tab indentation, mixed indentation levels
  • Windows line endings (CRLF)
  • All-empty-line input
  • 100% code coverage
  • Full test suite passes (4346 tests)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
es-toolkit Ready Ready Preview, Comment Apr 3, 2026 3:14am

Request Review

@sukvvon sukvvon marked this pull request as ready for review April 3, 2026 02:06
@sukvvon sukvvon marked this pull request as draft April 3, 2026 02:06
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (cd553ee) to head (1adf7ab).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1679   +/-   ##
=======================================
  Coverage   99.97%   99.97%           
=======================================
  Files         497      498    +1     
  Lines        4662     4702   +40     
  Branches     1348     1358   +10     
=======================================
+ Hits         4661     4701   +40     
  Misses          1        1           
🚀 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.

@sukvvon sukvvon marked this pull request as ready for review April 3, 2026 03:08
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.

feature: dedent

2 participants