unescape vs standards compliant replacement

Benchmark created on


Description

Remove unescape from codebase and replace with compliant replacement

Setup

let str = 'PasswordMaker©€𤭢';

Test runner

Ready to run.

Testing in
TestOps/sec
unescape
unescape(encodeURI(str));
ready
replacement
encodeURI(str).replace(/%[\da-f]{2}/gi, (char) => String.fromCodePoint(parseInt(char.replace(/%/, ""), 16)));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.