UNPKG

strip-diacritics

Version:

Remove diacritics (accents, special characters, and marks) from text, making it easier to normalize, search, and process text across multiple languages.

8 lines (5 loc) 226 B
function replaceDiacritics(text, replacementMap = {}) { if (typeof text !== 'string') return ''; return text.split('').map(char => replacementMap[char] || char).join(''); } module.exports = replaceDiacritics;