mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 08:13:27 +01:00
17 lines
490 B
TypeScript
17 lines
490 B
TypeScript
import { readFile, readTextFile } from '@tauri-apps/plugin-fs';
|
|
import type { HttpResponse } from '@yaakapp/api';
|
|
|
|
export async function getResponseBodyText(response: HttpResponse): Promise<string | null> {
|
|
if (response.bodyPath) {
|
|
return await readTextFile(response.bodyPath);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
export async function getResponseBodyBlob(response: HttpResponse): Promise<Uint8Array | null> {
|
|
if (response.bodyPath) {
|
|
return readFile(response.bodyPath);
|
|
}
|
|
return null;
|
|
}
|