feat: add text tools

This commit is contained in:
2026-09-07 10:38:36 +05:00
parent a49785764b
commit e5b76ca3e1
3 changed files with 271 additions and 2 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ export function stripDataUri(text: string): string {
return m ? text.slice(m[0].length) : text.trim();
}
export function base64ToBytes(text: string): Uint8Array {
export function base64ToBytes(text: string): Uint8Array<ArrayBuffer> {
const clean = text.replace(/\s+/g, "");
const binary = atob(clean);
const bytes = new Uint8Array(binary.length);