The secureFilters.uri function uses Buffer to parse utf8 into bytes, which prevents using secure-filters client-side. If we can substitute this out and use String#charCodeAt instead, then we could use EJS client-side too.
Note that charCodeAt gives you the UTF-16 code-point; converting from that to UTF-8 bytes involves math. Probably somebody else has solved this so it's worth hunting around.
The
secureFilters.uri
function uses Buffer to parse utf8 into bytes, which prevents usingsecure-filters
client-side. If we can substitute this out and useString#charCodeAt
instead, then we could use EJS client-side too.