feat: ✨ add raw base64 decoder
This commit is contained in:
parent
b71d2c6aae
commit
1abc0d82c4
|
@ -1,4 +1,5 @@
|
||||||
import { JsonValue } from '$std/json/common.ts'
|
import { JsonValue } from '$std/json/common.ts'
|
||||||
|
import { decodeBase64 } from "@std/encoding/base64"
|
||||||
|
|
||||||
export type JsonCompatible = JsonValue | { toJSON(): JsonValue } | unknown
|
export type JsonCompatible = JsonValue | { toJSON(): JsonValue } | unknown
|
||||||
|
|
||||||
|
@ -77,3 +78,8 @@ function getCookie(name: string): string | undefined {
|
||||||
const cookies = Object.fromEntries(cookiesEntries)
|
const cookies = Object.fromEntries(cookiesEntries)
|
||||||
return cookies[name]
|
return cookies[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function base64ToString(base64: string): string {
|
||||||
|
const bytes = decodeBase64(base64)
|
||||||
|
return new TextDecoder().decode(bytes)
|
||||||
|
}
|
Loading…
Reference in a new issue