MCPcopy Create free account
hub / github.com/aghyad97/browserytools / handleEncode

Function handleEncode

src/components/UrlEncoderDecoder.tsx:35–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 } else {
34 setOutput(decodeURIComponent(input));
35 }
36 } catch { setOutput(""); }
37 }, [input, tab, fullUrl]);
38
39 const handleEncode = () => {
40 if (!input.trim()) { toast.error(t("pleaseEnterInput")); return; }
41 try {
42 setOutput(fullUrl ? encodeURI(input) : encodeURIComponent(input));
43 toast.success(t("encodedSuccessfully"));
44 } catch (e) { toast.error(t("encodingFailed", { msg: e instanceof Error ? e.message : String(e) })); }

Callers

nothing calls this directly

Calls 2

errorMethod · 0.80
successMethod · 0.80

Tested by

no test coverage detected