Skip to content

Commit 8e7ee9f

Browse files
committed
chore: update deps
1 parent 7d70dd3 commit 8e7ee9f

File tree

5 files changed

+2947
-570
lines changed

5 files changed

+2947
-570
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Development Guide
44

55
```bash
6-
git clone https://github.com/uetchy/badge-api.git && cd badge.vercel.app
6+
git clone https://github.com/uetchy/badge-api.git && cd badge-api
77
npm install
88

99
npm i -g vercel
@@ -21,15 +21,15 @@ vc dev
2121
If you want your new badge location to be `badge.vercel.app/foobar/:baz`, then create a file named `[baz].ts` in `api/foobar`.
2222

2323
```ts
24-
import { makeBadge } from '../../../lib/badge';
25-
import { json } from '../../../lib/fetch';
24+
import { makeBadge } from "../../../lib/badge";
25+
import { json } from "../../../lib/fetch";
2626

2727
export default makeBadge(async ({ baz }) => {
2828
const response = await json(`https://example.com/api?q=${baz}`);
2929

3030
return {
31-
label: 'foobar',
32-
color: 'magenta',
31+
label: "foobar",
32+
color: "magenta",
3333
status: response.status,
3434
};
3535
});

lib/fetch.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import "cross-fetch/polyfill";
2-
import { JSDOM } from "jsdom";
32
import { GraphQLClient } from "graphql-request";
3+
import { PatchedRequestInit } from "graphql-request/dist/types";
4+
import { JSDOM } from "jsdom";
45

5-
export async function graphql(url: string, query: string, init?: RequestInit) {
6+
export async function graphql(
7+
url: string,
8+
query: string,
9+
init?: PatchedRequestInit
10+
) {
611
const graphQLClient = new GraphQLClient(url, init);
712
return await graphQLClient.request(query);
813
}

0 commit comments

Comments
 (0)