This commit is contained in:
xuyue committed 2023-01-13 10:54:34 +08:00
1 parent ab5cb8610b
commit edce7c4cc7
15 files changed
+30 -29

No files matched your search

+2 -2
View File
@@ -5,11 +5,11 @@ import { Code } from "./types"
const http = axios.create({ baseURL: "https://judge0api.hyyz.izhai.net" })
function encode(str: string) {
return btoa(unescape(encodeURIComponent(str || "")))
return btoa(unescape(encodeURIComponent(str ?? "")))
}
function decode(bytes: string) {
let escaped = escape(atob(bytes || ""))
let escaped = escape(atob(bytes ?? ""))
try {
return decodeURIComponent(escaped)
} catch (e) {