code: function unescape(str) {
  
      return str.replace(constants.REGEX.unescape, (match, hex1, hex2, hex3, octal, special) => {
  
          let hex = hex1 !== undefined ? hex1 : hex2 !== undefined ? hex2 : hex3 !== undefined ? hex3 : undefined;
  
          if (hex !== undefined) {
              return String.fromCodePoint(parseInt(hex, 16));
  
          } else if (octal !== undefined) {
              return String.fromCodePoint(parseInt(octal, 8));
  
          } else {
              return constants.SPECIAL_CHARS[special];
          }
  
      });
  
  }
docs: https://mathiasbynens.be/notes/javascript-escapes