@kkitahara/unicode-tools
v1.0.8
Published
ECMAScript modules which implement some of the Unicode® Standard.
Downloads
42
Maintainers
Readme
UnicodeTools
ECMAScript modules which implement some of the Unicode® Standard.
Currently, only the default/canonical case folding (the Unicode® Standard 12.0.0, section 3.13, R4/D145) is implemented.
New functionalities may be added on (author's) demand in future.
Installation
npm install @kkitahara/unicode-tools
Examples
import { toCaseFold } from '@kkitahara/unicode-tools'
'\u{00c5}' === '\u{00e5}' // false
toCaseFold('\u{00c5}') === '\u{00e5}' // true
'\u{0041}\u{030a}' === '\u{0061}\u{030a}' // false
toCaseFold('\u{0041}\u{030a}') === '\u{0061}\u{030a}' // true
// return the input value if it is not a string
toCaseFold(null) // null
toCaseFold(false) // false
import { toCanonicalCaseFold } from '@kkitahara/unicode-tools'
'\u{00c5}' === '\u{00e5}' // false
toCanonicalCaseFold('\u{00c5}') === '\u{00e5}' // false
toCanonicalCaseFold('\u{00c5}') === '\u{0061}\u{030a}' // true
'\u{0041}\u{030a}' === '\u{0061}\u{030a}' // false
toCanonicalCaseFold('\u{0041}\u{030a}') === '\u{0061}\u{030a}' // true
// return the input value if it is not a string
toCanonicalCaseFold(null) // null
toCanonicalCaseFold(false) // false
NOTICE
This software uses data extracted from the Unicode® Character Database.
See NOTICE and the Unicode Data Files and Software License for more details.
Unicode is a registered trademark of Unicode, Inc. in the United States and other countries.
LICENSE
© 2019 Koichi Kitahara
Apache 2.0