(s)
| 262 | return String.fromCodePoint(charCode); |
| 263 | }; |
| 264 | const _decode = (s) => { |
| 265 | s = encodedPattern.exec(s)[1]; |
| 266 | let curr = []; |
| 267 | let res = ""; |
| 268 | for (let c of s) { |
| 269 | curr.push(CHARS_MAP[c]); |
| 270 | if (curr.length >= LEN) { |
| 271 | res += decodeChar(curr); |
| 272 | curr = []; |
| 273 | } |
| 274 | } |
| 275 | return res; |
| 276 | }; |
| 277 | export const decode = (text) => { |
| 278 | if (!canDecode(text)) return text; |
| 279 | return text.replace(encodedPattern, `>${_decode(text)}<`); |
no test coverage detected