-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3 released ! more optimized response parsing and extra cookie config…
…urations added! beside that handled undefined body and headers edge case!
- Loading branch information
1 parent
5b4142f
commit e493baa
Showing
7 changed files
with
61 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
declare module "fetch-parse" { | ||
type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
type Parser = (res: Response) => Promise<any>; | ||
type Parsers = { [type: string]: true | Parser }; | ||
|
||
function fetchParse(fetch: Fetch, types?: Parsers): Fetch; | ||
|
||
namespace fetchParse { | ||
function fetch( | ||
fetch: Fetch, | ||
types: Parsers, | ||
url: RequestInfo, | ||
opts?: RequestInit | ||
): Promise<Response>; | ||
function parse(types: Parsers, res: Response): Promise<Response>; | ||
function arrayBuffer(res: Response): Promise<ArrayBuffer>; | ||
function text(res: Response): Promise<string>; | ||
function json(res: Response): Promise<any>; | ||
function set(res: Response, body: any): Response; | ||
} | ||
|
||
export = fetchParse; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters