-
-
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.
Upgrade glob, rename helper methods, fix tests
- Loading branch information
Showing
11 changed files
with
493 additions
and
97 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,19 +1,19 @@ | ||
import fetch from 'node-fetch'; | ||
import { log } from './utils'; | ||
|
||
async function get(url: string): Promise<string> { | ||
async function apiBuffer(url: string): Promise<Buffer> { | ||
log('⤓', url); | ||
return fetch(url).then((res: any) => res.text()); | ||
return fetch(url).then((res: any) => res.buffer()); | ||
} | ||
|
||
async function getJSON(url: string): Promise<any> { | ||
async function apiJson(url: string): Promise<any> { | ||
log('⤓', url); | ||
return fetch(url).then((res: any) => res.json()); | ||
} | ||
|
||
async function getRaw(url: string): Promise<Buffer> { | ||
async function apiText(url: string): Promise<string> { | ||
log('⤓', url); | ||
return fetch(url).then((res: any) => res.buffer()); | ||
return fetch(url).then((res: any) => res.text()); | ||
} | ||
|
||
export { get, getJSON, getRaw }; | ||
export { apiBuffer, apiJson, apiText }; |
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
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
Oops, something went wrong.