UNPKG

clean-accents

Version:

A utility package for removing accents from string and checking if it has accents.

19 lines 394 B
// src/package/index.ts var cleanAccents = { /** * Remove accents from a given string. */ clean: function(str) { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); }, /** * Check if a given string has accents. */ has: function(str) { return /[\u0300-\u036f]/.test(str.normalize("NFD")); } }; export { cleanAccents }; //# sourceMappingURL=index.js.map