![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/core-js/modules/ |
'use strict'; var $ = require('../internals/export'); var toString = require('../internals/to-string'); var fromCharCode = String.fromCharCode; var hex2 = /^[\da-f]{2}$/i; var hex4 = /^[\da-f]{4}$/i; // `unescape` method // https://tc39.es/ecma262/#sec-unescape-string $({ global: true }, { unescape: function unescape(string) { var str = toString(string); var result = ''; var length = str.length; var index = 0; var chr, slice; while (index < length) { chr = str.charAt(index++); if (chr === '%') { if (str.charAt(index) === 'u') { slice = str.slice(index + 1, index + 5); if (hex4.test(slice)) { result += fromCharCode(parseInt(slice, 16)); index += 5; continue; } } else { slice = str.slice(index, index + 2); if (hex2.test(slice)) { result += fromCharCode(parseInt(slice, 16)); index += 2; continue; } } } result += chr; } return result; } });