MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / _decode

Function _decode

scripts/createInvisibleText.js:264–276  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

262 return String.fromCodePoint(charCode);
263};
264const _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};
277export const decode = (text) => {
278 if (!canDecode(text)) return text;
279 return text.replace(encodedPattern, `>${_decode(text)}<`);

Callers 1

decodeFunction · 0.85

Calls 2

decodeCharFunction · 0.85
execMethod · 0.45

Tested by

no test coverage detected