This file contains hidden or 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
| /* | |
| no :) | |
| */ |
This file contains hidden or 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
| export async function api( | |
| url: string, | |
| type: 'json' | 'text' | 'buffer' = 'json' | |
| ) { | |
| const a = await fetch(url); | |
| switch (type) { | |
| case 'buffer': | |
| return await a.arrayBuffer(); | |
| case 'text': | |
| return await a.text(); |
This file contains hidden or 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
| function arr(x: any) { | |
| return Array.from(x); | |
| } | |
| function num(x: any) { | |
| return Number(x) || 0; | |
| } | |
| function str(x: any) { | |
| return String(x); | |
| } | |
| function isEmpty(xs: any) { |
NewerOlder