Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

normalize-unicode-text

frandiox6kMIT0.0.1TypeScript support: included

Normalize strings with diacritics, zero-width whitespaces and other non-latin characters

normalize, text, string, unicode, diacritics, zero-width, latin

readme

Normalize Unicode Text

Small typed function (~330 bytes) without dependencies that normalizes unicode text. Useful for normalizing strings such as shipping addresses for third party APIs.

  • <input checked="" disabled="" type="checkbox"> Diacritics
  • <input checked="" disabled="" type="checkbox"> Zero-width characters
  • <input checked="" disabled="" type="checkbox"> Uncommon white spaces
  • <input checked="" disabled="" type="checkbox"> Non-latin characters (see this list, PRs with more characters are welcome)

Installation & Usage

yarn add normalize-unicode-text

Or drop it as <script src="https://unpkg.com/normalize-unicode-text">. In this case, use window.normalizeUnicodeText.

Usage

import { normalizeUnicodeText } from 'normalize-unicode-text'

console.log(normalizeUnicodeText('øqßweŁffÆǣ'))
// oqssweLffAEae

console.log(normalizeUnicodeText('äÄàÀãÃçÇõÕûÛýÝñ'))
// aAaAaAcCoOuUyYn