MCPcopy Index your code
hub / github.com/MALSync/MALSync / xhr

Function xhr

src/api/request/requestWebextension.ts:5–14  ·  view source on GitHub ↗
(method, url)

Source from the content-addressed store, hash-verified

3
4export const requestApi: requestInterface = {
5 async xhr(method, url) {
6 if (typeof requestApi.sendMessage !== 'undefined') {
7 return requestApi.sendMessage({ name: 'xhr', method, url }).then(xhr => {
8 if (xhr.status === 429) throw 'Rate limit Timeout';
9 if (xhr.status === 0) throw xhr.responseText;
10 return xhr;
11 });
12 }
13 throw 'Could not send xhr';
14 },
15
16 async sendMessage(message: sendMessageI): Promise<any> {
17 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls 1

sendMessageMethod · 0.80

Tested by

no test coverage detected