(s)
| 239 | return convertedChar.reduce((curr, digit) => curr + CHARS[digit], ""); |
| 240 | }; |
| 241 | const _encode = (s) => { |
| 242 | let converted = []; |
| 243 | for (let c of s) { |
| 244 | converted.push(charConvert(c)); |
| 245 | } |
| 246 | let res = converted.map(charEncode); |
| 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; |
no test coverage detected