From 5632c342ca488ff333ffe400885f857523460cee Mon Sep 17 00:00:00 2001 From: Antoine Kingue Date: Sat, 29 Jun 2024 13:49:31 +0200 Subject: [PATCH] update with prettier --- src/index.ts | 4 ++-- src/shared/gsc.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 293ceb0..8542a78 100644 --- a/src/index.ts +++ b/src/index.ts @@ -95,7 +95,7 @@ export const index = async (input: string = process.argv[2], options: IndexOptio pages = checkCustomUrls(siteUrl, pages); console.log(`👉 Found ${pages.length} URLs in the provided list`); } - + const statusPerUrl: Record = existsSync(cachePath) ? JSON.parse(readFileSync(cachePath, "utf8")) : {}; @@ -123,7 +123,7 @@ export const index = async (input: string = process.argv[2], options: IndexOptio const shouldRecheck = (status: Status, lastCheckedAt: string) => { const shouldIndexIt = indexableStatuses.includes(status); const isOld = new Date(lastCheckedAt) < new Date(Date.now() - CACHE_TIMEOUT); - return shouldIndexIt && isOld;; + return shouldIndexIt && isOld; }; await batch( diff --git a/src/shared/gsc.ts b/src/shared/gsc.ts index 1815a82..a910ea9 100644 --- a/src/shared/gsc.ts +++ b/src/shared/gsc.ts @@ -130,7 +130,7 @@ export async function checkSiteUrl(accessToken: string, siteUrl: string) { export function checkCustomUrls(siteUrl: string, urls: string[]) { const protocol = siteUrl.startsWith("http://") ? "http://" : "https://"; const domain = siteUrl.replace("https://", "").replace("http://", "").replace("sc-domain:", ""); - const formattedUrls: string[] = urls.map((url) =>{ + const formattedUrls: string[] = urls.map((url) => { url = url.trim(); if (url.startsWith("/")) { // the url is a relative path (e.g. /about) @@ -143,7 +143,7 @@ export function checkCustomUrls(siteUrl: string, urls: string[]) { return `${protocol}${url}`; } else { // the url is a relative path without the leading slash (e.g. about) - return `${protocol}${domain}/${url}` + return `${protocol}${domain}/${url}`; } });