### Package to replace `escape-html` ### Suggested replacement(s) ```js const map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' } function escapeHtml(string) { return string.replace(/[&<>"']/g, char => map[char]) } ``` ### Manifest type micro-utility (tiny utility replaceable with native code or removal) ### Rationale It's a simple util ### Availability _No response_ ### Code example (optional) ```js ```
Activity
43081j commentedon Aug 17, 2026
it uses an iterative approach for performance reasons i imagine. since the early exit and the jump ahead is faster than a
replacemost likely.in common cases where that level of perf doesn't matter as much, your example does work well.
i'm not sure if we should add it or not in that case though. let's see what @ghostdevv thinks
gameroman commentedon Aug 17, 2026
It is just an old package that wasn't updated for a decade, so that's why it uses that, not for perf reasons
gameroman commentedon Aug 26, 2026
Also
html-escaper