Checks if a character is a diacritical mark
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
README.md
index.js
package.json

README.md

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.