Initial commit

This commit is contained in:
Kyle Carberry 2025-05-27 14:27:57 -04:00
commit b0713a844c
19 changed files with 2003 additions and 0 deletions

17
src/split-data-url.ts Normal file
View file

@ -0,0 +1,17 @@
export function splitDataUrl(dataUrl: string): {
mimeType: string | undefined;
base64Content: string | undefined;
} {
try {
const [header, base64Content] = dataUrl.split(",");
return {
mimeType: header?.split(";")[0]?.split(":")[1],
base64Content,
};
} catch (error) {
return {
mimeType: undefined,
base64Content: undefined,
};
}
}