mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-07-18 14:23:59 +02:00
14
__test__/wumpfetch-tests.ts
Normal file
14
__test__/wumpfetch-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import w from '../index';
|
||||||
|
|
||||||
|
interface Yeetus
|
||||||
|
{
|
||||||
|
yes: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
(async() => {
|
||||||
|
const res = await w('https://myurl.org', { method: 'GET' }).send();
|
||||||
|
const res1 = await w('https://myurl.org', { method: 'GET', chaining: false });
|
||||||
|
|
||||||
|
const d = res.json<Yeetus>();
|
||||||
|
const d1 = res.json();
|
||||||
|
})();
|
||||||
2
index.d.ts
vendored
2
index.d.ts
vendored
@@ -103,7 +103,7 @@ declare namespace w {
|
|||||||
method: URLMethods;
|
method: URLMethods;
|
||||||
data?: NormalObject;
|
data?: NormalObject;
|
||||||
headers?: KVObject;
|
headers?: KVObject;
|
||||||
chain?: boolean;
|
chaining?: boolean;
|
||||||
parse?: 'json' | 'buffer' | 'form';
|
parse?: 'json' | 'buffer' | 'form';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user