1.0.2 • Published 10 years ago

is-diacritical-mark v1.0.2

Weekly downloads
1
License
BSD
Repository
github
Last release
10 years ago

Checks for diacritical marks

This simple module provides 2 methods to check if a character is a diacritical mark, more specifically, accents.

This is useful for cases where you're firing events on everything a user types but you might want to ignore when he types an accent before the character the accent is applied on.

The following accents are detected:

^
`
~
¨
´

Install

npm install is-diacritical-mark

fromCode(code)

Takes a charCode and returns true if the code for the character matches.

fromChar(char)

Takes a character and returns true if the character matches.