Skip to content

Chibi Dev Branch#3534

Merged
lolamtisch merged 4 commits intomasterfrom
devChibi
Mar 2, 2026
Merged

Chibi Dev Branch#3534
lolamtisch merged 4 commits intomasterfrom
devChibi

Conversation

@lolamtisch
Copy link
Copy Markdown
Member

No description provided.

@lolamtisch lolamtisch marked this pull request as ready for review February 26, 2026 14:38
Copilot AI review requested due to automatic review settings February 26, 2026 14:38
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.

Pull request overview

This PR refactors the toHalfWidth string function to use the standard Unicode normalization API by renaming it to normalize and replacing the custom character conversion logic with JavaScript's built-in String.prototype.normalize() method.

Changes:

  • Renamed toHalfWidth function to normalize with support for different normalization forms
  • Updated implementation to use native String.prototype.normalize() instead of custom character replacement logic
  • Updated all references across test files and implementation code

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/chibiScript/functions/stringFunctions.ts Renamed function from toHalfWidth to normalize, replaced custom logic with native normalization API
src/pages-chibi/implementations/ComicDays/main.ts Updated function call from toHalfWidth() to normalize()
test/src/chibiScript/functions/stringFunctions.test.ts Updated test suite name and function calls to use new normalize name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* Converts full-width ASCII characters or number to its half-width character
* Converts full-width characters to half-width character
* @input string
* @form 'NFC' | 'NFD' | 'NFKC' | 'NFKD' - Normalization form (default: 'NFKC')
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The JSDoc tag should be @param instead of @form to properly document the function parameter.

Suggested change
* @form 'NFC' | 'NFD' | 'NFKC' | 'NFKD' - Normalization form (default: 'NFKC')
* @param {'NFC' | 'NFD' | 'NFKC' | 'NFKD'} form - Normalization form (default: 'NFKC')

Copilot uses AI. Check for mistakes.
* Converts full-width characters to half-width character
* @input string
* @form 'NFC' | 'NFD' | 'NFKC' | 'NFKD' - Normalization form (default: 'NFKC')
* @returns Its half-width characters or number
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The @returns description is outdated and doesn't accurately describe the normalize function's behavior. It should describe that the function returns the normalized form of the string according to the specified Unicode normalization form.

Suggested change
* @returns Its half-width characters or number
* @returns The normalized form of the string according to the specified Unicode normalization form

Copilot uses AI. Check for mistakes.
@lolamtisch lolamtisch merged commit b8efa2d into master Mar 2, 2026
10 of 14 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.

3 participants