Skip to content

Commit 2ff6c39

Browse files
committed
chore: Update formatting
1 parent 2de0782 commit 2ff6c39

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

src/apis/firefox-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import consola from "consola";
33
export function createFirefoxApiClient() {
44
return {
55
getAddon: async (
6-
idOrSlugOrGuid: number | string
6+
idOrSlugOrGuid: number | string,
77
): Promise<Gql.FirefoxAddon> => {
88
consola.info("Fetching " + idOrSlugOrGuid);
99
const url = new URL(
10-
`https://addons.mozilla.org/api/v5/addons/addon/${idOrSlugOrGuid}`
10+
`https://addons.mozilla.org/api/v5/addons/addon/${idOrSlugOrGuid}`,
1111
);
1212
const res = await fetch(url);
1313
if (res.status !== 200)
1414
throw Error(
15-
`${url.href} failed with status: ${res.status} ${res.statusText}`
15+
`${url.href} failed with status: ${res.status} ${res.statusText}`,
1616
);
1717

1818
const json = await res.json();

src/crawlers/chrome-crawler.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HTMLAnchorElement, HTMLElement, parseHTML } from "linkedom";
33

44
export async function crawlExtension(
55
id: string,
6-
lang: string
6+
lang: string,
77
): Promise<Gql.ChromeExtension | undefined> {
88
consola.info("Crawling " + id);
99
const url = `https://chromewebstore.google.com/detail/${id}?hl=${lang}`;
@@ -28,13 +28,13 @@ export async function crawlExtension(
2828
const storeUrl = metaContent(document, "property=og:url");
2929
const iconUrl = metaContent(document, "property=og:image")?.replace(
3030
/=.+?$/,
31-
"=s256"
31+
"=s256",
3232
);
3333
const shortDescription = metaContent(document, "property=og:description");
3434

3535
// Grab the main sections that contain content
3636
const sections = (document as HTMLElement).querySelectorAll(
37-
"main > * > section"
37+
"main > * > section",
3838
);
3939
const header: HTMLElement = sections[0];
4040
const description: HTMLElement = sections[2];
@@ -69,10 +69,10 @@ export async function crawlExtension(
6969
// </span>
7070
// </span>
7171
const ratingRow = header.querySelector(
72-
"div:first-child > div:nth-child(2) > span:last-child"
72+
"div:first-child > div:nth-child(2) > span:last-child",
7373
);
7474
const rating = extractNumber(
75-
ratingRow.querySelector("span:first-child > span:first-child").textContent
75+
ratingRow.querySelector("span:first-child > span:first-child").textContent,
7676
);
7777
const reviewCount = extractNumber(ratingRow.querySelector("p").textContent);
7878

src/graphql.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export function createGraphql(ctx: WxtQueueCtx) {
2121
const start = performance.now();
2222
consola.debug(
2323
`${pc.dim(`←-- [${id}]`)} ${pc.green(method)} ${pc.cyan(
24-
pc.bold(operationName)
25-
)}`
24+
pc.bold(operationName),
25+
)}`,
2626
);
2727

2828
const response = await graphql({
@@ -36,8 +36,8 @@ export function createGraphql(ctx: WxtQueueCtx) {
3636
const end = performance.now();
3737
consola.debug(
3838
`${pc.dim(`--→ [${id}]`)} ${pc.green(method)} ${pc.cyan(
39-
pc.bold(operationName)
40-
)} ${(end - start).toFixed(3)}ms`
39+
pc.bold(operationName),
40+
)} ${(end - start).toFixed(3)}ms`,
4141
);
4242

4343
return response;

src/public/playground.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<title>Playground - wxt-queue v{{VERSION}}</title>
@@ -50,7 +50,7 @@
5050
fetcher,
5151
defaultEditorToolsVisibility: true,
5252
plugins: [explorerPlugin],
53-
})
53+
}),
5454
);
5555
</script>
5656
</body>

src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { createFirefoxService } from "./services/firefox-service";
88

99
const playgroundHtml = playgroundHtmlTemplate.replace(
1010
"{{VERSION}}",
11-
pkg.version
11+
pkg.version,
1212
);
1313

1414
export function createServer(config?: ServerConfig) {
@@ -62,7 +62,7 @@ export function createServer(config?: ServerConfig) {
6262
});
6363

6464
consola.info(
65-
`${pc.cyan("store-api v" + pkg.version)} ${pc.dim("server started")}`
65+
`${pc.cyan("store-api v" + pkg.version)} ${pc.dim("server started")}`,
6666
);
6767
consola.log(` ${pc.bold(pc.green("➜"))} http://localhost:${port}`);
6868
console.log();
@@ -98,7 +98,7 @@ function createResponse(
9898
| FormData
9999
| URLSearchParams
100100
| null,
101-
options?: ResponseInit
101+
options?: ResponseInit,
102102
) {
103103
const res = new Response(body, options);
104104
res.headers.set("Access-Control-Allow-Origin", "*");

src/services/chrome-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function createChromeService() {
77
string,
88
Gql.ChromeExtension | undefined
99
>(DAY_MS, (ids) =>
10-
Promise.all(ids.map((id) => chrome.crawlExtension(id, "en")))
10+
Promise.all(ids.map((id) => chrome.crawlExtension(id, "en"))),
1111
);
1212

1313
return {

src/utils/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface CacheEntry<T> {
3333

3434
export function createCachedDataLoader<K, V>(
3535
ttl: number,
36-
batchLoadFn: DataLoader.BatchLoadFn<K, V>
36+
batchLoadFn: DataLoader.BatchLoadFn<K, V>,
3737
) {
3838
return new DataLoader(batchLoadFn, {
3939
cacheMap: createInMemoryCache({ ttl }),

0 commit comments

Comments
 (0)