mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2026-01-21 05:02:05 +00:00
perf(bundle): drop js-base64
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user