From 996f97168a2547e7440136d0060ffeb6534772ab Mon Sep 17 00:00:00 2001 From: Caleb Eby Date: Wed, 26 Jul 2023 09:22:25 -0700 Subject: [PATCH] Run prettier v3 --- src/connect-to-browser.ts | 2 +- src/index.ts | 9 ++++++--- src/user-util/index.ts | 21 ++++++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/connect-to-browser.ts b/src/connect-to-browser.ts index dc7a165f..acff571c 100644 --- a/src/connect-to-browser.ts +++ b/src/connect-to-browser.ts @@ -73,7 +73,7 @@ const connectToCachedBrowser = async ( return puppeteer .connect({ browserWSEndpoint: cachedWSEndpoint }) .catch( - () => ({ connected: false, previousValue: cachedWSEndpoint } as const), + () => ({ connected: false, previousValue: cachedWSEndpoint }) as const, ); } diff --git a/src/index.ts b/src/index.ts index ca56b11d..3e984cf9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -204,9 +204,12 @@ export const withBrowser: WithBrowser = (...args: any[]) => { ); } - await ctx.page.evaluate((...colorErr) => { - console.log(...colorErr); - }, ...(ansiColorsLog(...failureMessage) as any)); + await ctx.page.evaluate( + (...colorErr) => { + console.log(...colorErr); + }, + ...(ansiColorsLog(...failureMessage) as any), + ); } await cleanup(true); diff --git a/src/user-util/index.ts b/src/user-util/index.ts index 0f55927d..cd83167d 100644 --- a/src/user-util/index.ts +++ b/src/user-util/index.ts @@ -141,15 +141,18 @@ export const error = ( literals: TemplateStringsArray, ...placeholders: (InterpolableIntoError | InterpolableIntoError[])[] ) => ({ - error: literals.reduce((acc, val, i) => { - if (i !== 0) { - const item = placeholders[i - 1]; - if (Array.isArray(item)) acc.push(...item); - else acc.push(item); - } - if (val !== '') acc.push(val); - return acc; - }, [] as (string | Element | number | boolean)[]), + error: literals.reduce( + (acc, val, i) => { + if (i !== 0) { + const item = placeholders[i - 1]; + if (Array.isArray(item)) acc.push(...item); + else acc.push(item); + } + if (val !== '') acc.push(val); + return acc; + }, + [] as (string | Element | number | boolean)[], + ), }); const capitalizeText = (text: string) => text[0].toUpperCase() + text.slice(1);