Skip to content

Commit 8b3d67f

Browse files
committed
added cleanupBase64FileData
1 parent fd8cfb7 commit 8b3d67f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/helpers/base64.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,11 @@ export function buffersToArrayBuffer(buffer: Buffer[] | Uint8Array): ArrayBuffer
187187
(c.byteOffset || 0) + (c.byteLength || c.length)
188188
);
189189
}
190+
}
191+
192+
export function cleanupBase64FileData(fileData: string) {
193+
const base64Marker = 'base64,';
194+
return (fileData.indexOf(base64Marker) >= 0)
195+
? fileData.slice(fileData.indexOf(base64Marker) + base64Marker.length)
196+
: fileData;
190197
}

0 commit comments

Comments
 (0)