@@ -23,8 +23,10 @@ const result = document.querySelector<HTMLParagraphElement>("#result")!;
23
23
24
24
const fetchButton = document . querySelector < HTMLButtonElement > ( "#fetch" ) ! ;
25
25
const request = async ( ) => {
26
- const specLoader = async ( ) => ( await import ( "./github/spec.ts" ) ) . ZodSpec ;
27
- const fetchGitHub = await newFetch ( specLoader , import . meta. env . DEV ) < typeof GITHUB_API_ORIGIN > ( ) ;
26
+ const specLoader = async ( ) => ( await import ( "./github/spec.ts" ) ) . GitHubSpec ;
27
+ const fetchGitHub = await newFetch ( specLoader , import . meta. env . DEV ) <
28
+ typeof GITHUB_API_ORIGIN
29
+ > ( ) ;
28
30
29
31
result . innerHTML = "Loading..." ;
30
32
const response = await fetchGitHub ( endpoint , { } ) ;
@@ -40,8 +42,12 @@ fetchButton.addEventListener("click", () => request());
40
42
const invalidFetchButton =
41
43
document . querySelector < HTMLButtonElement > ( "#invalid-fetch" ) ! ;
42
44
const invalidRequest = async ( ) => {
43
- const specLoader = async ( ) => ( await import ( "./github/spec.ts" ) ) . InvalidResponseZodSpec ;
44
- const fetchInvalidResponseGitHub = await newFetch ( specLoader , import . meta. env . DEV ) < typeof GITHUB_API_ORIGIN > ( ) ;
45
+ const specLoader = async ( ) =>
46
+ ( await import ( "./github/spec.ts" ) ) . InvalidResponseGitHubSpec ;
47
+ const fetchInvalidResponseGitHub = await newFetch (
48
+ specLoader ,
49
+ import . meta. env . DEV
50
+ ) < typeof GITHUB_API_ORIGIN > ( ) ;
45
51
46
52
result . innerHTML = "Loading..." ;
47
53
try {
0 commit comments