The implementation of deburr is too naive and fails with a lot of characters.
If you check Lodash implementation it's more complex: https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L326
Same for https://github.com/sindresorhus/transliterate
Example:
_.deburr('Hællæ, hva skjera?'); // => Haellae, hva skjera?
transliterate('Hællæ, hva skjera?'); // => Haellae, hva skjera?
=> works as expected
deburr fails:
deburr('Hællæ, hva skjera?'); // => Hællæ, hva skjera?
=> doesn't work as expected
I've tried to fix deburr implementation but it requires a lot of code.
Instead I suggest that moderndash documentation points to https://github.com/sindresorhus/transliterate and https://github.com/sindresorhus/slugify (both are well written, maintained and already popular) and deprecate deburr.
Check sindresorhus/transliterate
It's quite some work!
One could imagine for deburr to be a facade for https://github.com/sindresorhus/transliterate but I don't see the benefit (you probably want to keep moderndash without any runtime dependency).
kebabCase uses deburr so it has the same problems.
The implementation of
deburris too naive and fails with a lot of characters.If you check Lodash implementation it's more complex: https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L326
Same for https://github.com/sindresorhus/transliterate
Example:
=> works as expected
deburrfails:=> doesn't work as expected
I've tried to fix
deburrimplementation but it requires a lot of code.Instead I suggest that moderndash documentation points to https://github.com/sindresorhus/transliterate and https://github.com/sindresorhus/slugify (both are well written, maintained and already popular) and deprecate
deburr.Check sindresorhus/transliterate
It's quite some work!
One could imagine for deburr to be a facade for https://github.com/sindresorhus/transliterate but I don't see the benefit (you probably want to keep moderndash without any runtime dependency).
kebabCaseusesdeburrso it has the same problems.