0.0.1 • Published 4 years ago

normalize-unicode-text v0.0.1

Weekly downloads
162
License
MIT
Repository
github
Last release
4 years ago

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.

  • Diacritics
  • Zero-width characters
  • Uncommon white spaces
  • 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