Skip to content

fix(business): collapse repeated whitespaces in username normalization#49

Open
emre155 wants to merge 1 commit into
marandaneto:mainfrom
emre155:fix/username-normalization-collapse-whitespace-issue-27
Open

fix(business): collapse repeated whitespaces in username normalization#49
emre155 wants to merge 1 commit into
marandaneto:mainfrom
emre155:fix/username-normalization-collapse-whitespace-issue-27

Conversation

@emre155

@emre155 emre155 commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Fixes the username normalization issue where consecutive whitespaces were not being collapsed (closes #27).

Changes

  • Modified normalizeUsername in src/business.js to use the regular expression /\s+/g in the replace method instead of the single space string ' '.
  • This ensures all whitespaces (including tabs, newlines, and multiple consecutive spaces) are collapsed and replaced with a single hyphen.

All related tests now pass cleanly.

Signed-off-by: emreumar emreumar@users.noreply.github.com

Updates normalizeUsername to collapse and replace all consecutive
whitespace sequences with a single hyphen using regex '/\s+/g'
instead of replacing only the first space.

Closes marandaneto#27

Signed-off-by: emreumar <emreumar@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 18, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Normalized usernames keep repeated whitespace

3 participants