Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace normalize-strings dependency #2992

Open
steffenkleinle opened this issue Nov 18, 2024 · 0 comments
Open

Replace normalize-strings dependency #2992

steffenkleinle opened this issue Nov 18, 2024 · 0 comments
Assignees
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers ready shared Affects the shared project Task

Comments

@steffenkleinle
Copy link
Member

Is your feature request related to a problem? Please describe.
We currently use normalize-strings to get rid of special characters. However, this library did not receive any updates in 4 years and can easily be replaced using String.normalize.

Describe the solution you'd like
Remove normalize-strings from our dependencies and replace the functionality as done in digitalfabrik/entitlementcard#1782:

// eslint-disable-next-line no-control-regex
const nonAsciiRegex = /[^\x00-\x7F]/g

const normalizeToAscii = (str: string): string => str.normalize('NFKD').replace(nonAsciiRegex, '')

const normalizeString = (str: string): string => normalizeToAscii(str).toLowerCase().trim()

export default normalizeString

Describe alternatives you've considered
Keep the current solution or look for other dependencies to do this.

Additional context
Done for the entitlementcard in digitalfabrik/entitlementcard#1782.

@steffenkleinle steffenkleinle added good first issue Good for newcomers dependencies Pull requests that update a dependency file ready shared Affects the shared project labels Nov 18, 2024
@steffenkleinle steffenkleinle moved this to Next Up in team-app Nov 19, 2024
@steffenkleinle steffenkleinle moved this from Next Up to In Progress in team-app Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers ready shared Affects the shared project Task
Projects
Status: In Progress
Development

No branches or pull requests

2 participants