first commit

This commit is contained in:
Raul Lugo
2024-12-25 20:30:57 +01:00
commit 6ef22531bb
165 changed files with 53426 additions and 0 deletions

17
dist/esm/utils.js vendored Normal file
View File

@@ -0,0 +1,17 @@
import { ValidationError } from "./types/errors.js";
export function toBlob(content) {
if (content instanceof Blob)
return content;
return new Blob([content]);
}
export async function handleResponse(response) {
if (!response.ok) {
const errorData = await response.json().catch(() => ({
message: response.statusText,
status: `${response.status}`,
}));
throw new ValidationError(errorData.message || "Unknown error", response.status);
}
const data = await response.json();
return data;
}