We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
buffer
atob
1 parent 5ecaba8 commit 4dcf345Copy full SHA for 4dcf345
1 file changed
src/utils/fetchData.ts
@@ -1,5 +1,4 @@
1
import { Platform } from 'react-native';
2
-import { Buffer } from 'buffer';
3
4
export async function fetchText(uri?: string): Promise<string | null> {
5
if (!uri) {
@@ -17,10 +16,9 @@ export async function fetchText(uri?: string): Promise<string | null> {
17
16
const decodeBase64Image = (uri: string) => {
18
const decoded = decodeURIComponent(uri);
19
const splitContent = decoded.split(';')[1].split(',');
20
- const dataType = splitContent[0] as BufferEncoding;
21
const content = splitContent.slice(1).join(',');
22
23
- return Buffer.from(content, dataType).toString('utf-8');
+ return atob(content);
24
};
25
26
function dataUriToXml(uri: string): string | null {
0 commit comments