diff options
author | 2022-03-10 00:10:48 +0000 | |
---|---|---|
committer | 2022-03-10 00:10:48 +0000 | |
commit | 518331f56074d768561114e00f4e5f38d7efaaba (patch) | |
tree | 34100a4af881f753333fec0743f7b87f7db806ff | |
parent | ae8d925666dac0008d8a607afa5f6223f95689a4 (diff) | |
download | astro-518331f56074d768561114e00f4e5f38d7efaaba.tar.gz astro-518331f56074d768561114e00f4e5f38d7efaaba.tar.zst astro-518331f56074d768561114e00f4e5f38d7efaaba.zip |
[ci] format
Diffstat (limited to '')
-rw-r--r-- | packages/astro/src/core/render/result.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts index fc53428e0..2175e112e 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<string, string>(); #result: SSRResult; #slots: Record<string, any> | null; - + constructor(result: SSRResult, slots: Record<string, any> | 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; } |