Files
books/main/api.ts
T
2025-05-30 15:58:08 +05:30

11 lines
267 B
TypeScript

import fetch, { RequestInit } from 'node-fetch';
export async function sendAPIRequest(
endpoint: string,
options: RequestInit | undefined
) {
return (await fetch(endpoint, options)).json() as unknown as {
[key: string]: string | number | boolean;
}[];
}