From 1a0425820d1d301955f3f3f8728b0da18c2d18a2 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 28 Jun 2021 12:17:24 -0400 Subject: [PATCH] format --- packages/astro/src/config.ts | 2 +- packages/astro/src/runtime.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/config.ts b/packages/astro/src/config.ts index 3dde8f632..7d0ef05ad 100644 --- a/packages/astro/src/config.ts +++ b/packages/astro/src/config.ts @@ -38,7 +38,7 @@ function validateConfig(config: any): void { throw new Error('[config] buildOptions.site must be a valid URL'); } } - if(config.buildOptions.drafts !== undefined && typeof config.buildOptions.drafts !== 'boolean') { + if (config.buildOptions.drafts !== undefined && typeof config.buildOptions.drafts !== 'boolean') { throw new Error(`[config] buildOptions.drafts: ${JSON.stringify(config.buildOptions.drafts)}\n Expected boolean, received ${type(config.buildOptions.drafts)}.`); } } diff --git a/packages/astro/src/runtime.ts b/packages/astro/src/runtime.ts index a719bb497..559bc6088 100644 --- a/packages/astro/src/runtime.ts +++ b/packages/astro/src/runtime.ts @@ -155,9 +155,9 @@ async function load(config: RuntimeConfig, rawPathname: string | undefined): Pro let data: any[] = await loadData({ params: currentParams }); if (!data) throw new Error(`[createCollection] \`data()\` returned nothing (empty data)"`); if (!Array.isArray(data)) data = [data]; // note: this is supposed to be a little friendlier to the user, but should we error out instead? - data = data.filter(entry => !entry.hasOwnProperty('published') || (entry.hasOwnProperty('published') && entry.published)); + data = data.filter(entry => !entry.hasOwnProperty('published') || (entry.hasOwnProperty('published') && entry.published)); if (!buildOptions.draft && config.mode === "production") { - data = data.filter(entry => !entry.hasOwnProperty('draft') || (entry.hasOwnProperty('draft') && !entry.draft)); + data = data.filter(entry => !entry.hasOwnProperty('draft') || (entry.hasOwnProperty('draft') && !entry.draft)); } // handle RSS