(text)
| 247 | return PADDING_START + res.join("") + PADDING_END; |
| 248 | }; |
| 249 | export const encode = (text) => { |
| 250 | let matches = shouldEncodePattern.exec(text); |
| 251 | if (!matches) return text; |
| 252 | return text.replace(shouldEncodePattern, " " + _encode(matches[1])); |
| 253 | }; |
| 254 | const decodeChar = (encodedChar) => { |
| 255 | encodedChar = encodedChar.reverse(); |
| 256 | let curr = 1; |