From 518331f56074d768561114e00f4e5f38d7efaaba Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Thu, 10 Mar 2022 00:10:48 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/render/result.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts index fc53428e09..2175e112e0 100644 --- a/packages/astro/src/core/render/result.ts +++ b/packages/astro/src/core/render/result.ts @@ -25,21 +25,21 @@ class Slots { #cache = new Map(); #result: SSRResult; #slots: Record | null; - + constructor(result: SSRResult, slots: Record | null) { this.#result = result; this.#slots = slots; if (slots) { for (const key of Object.keys(slots)) { if ((this as any)[key] !== undefined) { - throw new Error(`Unable to create a slot named "${key}". "${key}" is a reserved slot name!\nPlease update the name of this slot.`) + throw new Error(`Unable to create a slot named "${key}". "${key}" is a reserved slot name!\nPlease update the name of this slot.`); } Object.defineProperty(this, key, { get() { return true; }, - enumerable: true - }) + enumerable: true, + }); } } } @@ -52,11 +52,11 @@ class Slots { public async render(name: string) { if (!this.#slots) return undefined; if (this.#cache.has(name)) { - const result = this.#cache.get(name) + const result = this.#cache.get(name); return result; - }; + } if (!this.has(name)) return undefined; - const content = await renderSlot(this.#result, this.#slots[name]).then(res => res != null ? res.toString() : res); + const content = await renderSlot(this.#result, this.#slots[name]).then((res) => (res != null ? res.toString() : res)); this.#cache.set(name, content); return content; }