From aaa61ff254ee424acd59d1b205b7551ee8cff696 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Fri, 18 Feb 2022 22:07:52 +0000 Subject: [PATCH] [ci] yarn format --- examples/env-vars/src/env.d.ts | 4 ++-- examples/env-vars/src/scripts/client.ts | 2 +- packages/astro/src/vite-plugin-env/index.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/env-vars/src/env.d.ts b/examples/env-vars/src/env.d.ts index a1befd0f0..1cc8ccabc 100644 --- a/examples/env-vars/src/env.d.ts +++ b/examples/env-vars/src/env.d.ts @@ -1,10 +1,10 @@ /// interface ImportMetaEnv { - readonly DB_PASSWORD: string; + readonly DB_PASSWORD: string; readonly PUBLIC_SOME_KEY: string; } interface ImportMeta { - readonly env: ImportMetaEnv + readonly env: ImportMetaEnv; } diff --git a/examples/env-vars/src/scripts/client.ts b/examples/env-vars/src/scripts/client.ts index 05961d399..b01c6029e 100644 --- a/examples/env-vars/src/scripts/client.ts +++ b/examples/env-vars/src/scripts/client.ts @@ -6,4 +6,4 @@ // PUBLIC_SOME_KEY is available everywhere console.log({ SSR, PUBLIC_SOME_KEY }); -})() +})(); diff --git a/packages/astro/src/vite-plugin-env/index.ts b/packages/astro/src/vite-plugin-env/index.ts index 803b97a14..c216b7111 100644 --- a/packages/astro/src/vite-plugin-env/index.ts +++ b/packages/astro/src/vite-plugin-env/index.ts @@ -14,7 +14,7 @@ function getPrivateEnv(viteConfig: vite.ResolvedConfig, astroConfig: AstroConfig envPrefixes = Array.isArray(viteConfig.envPrefix) ? viteConfig.envPrefix : [viteConfig.envPrefix]; } const fullEnv = loadEnv(viteConfig.mode, viteConfig.envDir ?? fileURLToPath(astroConfig.projectRoot), ''); - const privateKeys = Object.keys(fullEnv).filter(key => { + const privateKeys = Object.keys(fullEnv).filter((key) => { // don't expose any variables also on `process.env` // note: this filters out `CLI_ARGS=1` passed to node! if (typeof process.env[key] !== 'undefined') return false; @@ -26,16 +26,16 @@ function getPrivateEnv(viteConfig: vite.ResolvedConfig, astroConfig: AstroConfig // Otherwise, this is a private variable defined in an `.env` file return true; - }) + }); if (privateKeys.length === 0) { return null; } - return Object.fromEntries(privateKeys.map(key => [key, fullEnv[key]])); + return Object.fromEntries(privateKeys.map((key) => [key, fullEnv[key]])); } function referencesPrivateKey(source: string, privateEnv: Record) { for (const key of Object.keys(privateEnv)) { - if (source.includes(key)) return true; + if (source.includes(key)) return true; } return false; }