-
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.
fix(*): added types for node-fetch and adapted config
- Loading branch information
Filipe Torrado
committed
Mar 28, 2022
1 parent
0a8c5cd
commit 6afe755
Showing
9 changed files
with
2,263 additions
and
1,670 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
/* global fetch, Headers, btoa */ | ||
import { IsoApiReader, ApiReaderOptions } from './IsoApiReader'; | ||
|
||
module.exports.ApiReader = class ApiReader extends IsoApiReader { | ||
export class ApiReader extends IsoApiReader { | ||
constructor(baseUrl: string, options: ApiReaderOptions) { | ||
super( | ||
{ | ||
fetch, | ||
Headers, | ||
btoa | ||
fetch: window.fetch, | ||
Headers: window.Headers, | ||
btoa: window.btoa | ||
}, | ||
baseUrl, | ||
options | ||
); | ||
} | ||
}; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { RequestInfo, RequestInit } from 'node-fetch'; | ||
const fetch = (url: RequestInfo, init?: RequestInit) => import('node-fetch').then(({default: fetch}) => fetch(url, init)); | ||
|
||
export default fetch; |
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
Oops, something went wrong.