perf(bundle): drop js-base64

This commit is contained in:
rusconn
2024-09-19 02:59:34 +09:00
parent 90ba9f4f8e
commit f12adfa296
4 changed files with 17 additions and 11 deletions

View File

@@ -1,9 +1,9 @@
"use client";
import { useCallback, useState } from "react";
import { decode, encode, isValid } from "js-base64";
import { toolGroups } from "@/config/tools";
import { decode, encode } from "@/lib/base64";
import { Textarea, TextareaProps } from "@/components/ui/textarea";
import * as Button from "@/components/buttons";
import { ControlMenu } from "@/components/control-menu";
@@ -24,10 +24,10 @@ export default function Page() {
}, []);
const setFormByEncoded = useCallback((text: string) => {
const newDecoded = decode(text);
const newDecoded = decode(text) ?? "";
setForm({
decoded: isValid(text) && !newDecoded.includes("<22>") ? newDecoded : "",
decoded: newDecoded.includes("<22>") ? "" : newDecoded,
encoded: text,
});
}, []);