summaryrefslogtreecommitdiff
path: root/packages/integrations/solid/server.js
diff options
context:
space:
mode:
authorGravatar natemoo-re <natemoo-re@users.noreply.github.com> 2022-06-23 15:12:46 +0000
committerGravatar github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2022-06-23 15:12:46 +0000
commit059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625 (patch)
tree9b0d289c9fb3df8dd50eff8f6176f8117c0f6084 /packages/integrations/solid/server.js
parent7373d61cdcaedd64bf5fd60521b157cfa4343558 (diff)
downloadastro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.tar.gz
astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.tar.zst
astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.zip
[ci] format
Diffstat (limited to 'packages/integrations/solid/server.js')
-rw-r--r--packages/integrations/solid/server.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/integrations/solid/server.js b/packages/integrations/solid/server.js
index 92b614012..2398ec317 100644
--- a/packages/integrations/solid/server.js
+++ b/packages/integrations/solid/server.js
@@ -1,6 +1,6 @@
import { renderToString, ssr, createComponent } from 'solid-js/web';
-const slotName = str => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase());
+const slotName = (str) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase());
function check(Component, props, children) {
if (typeof Component !== 'function') return false;
@@ -15,14 +15,14 @@ function renderToStaticMarkup(Component, props, { default: children, ...slotted
slots[name] = ssr(`<astro-slot name="${name}">${value}</astro-slot>`);
}
// Note: create newProps to avoid mutating `props` before they are serialized
- const newProps = {
+ const newProps = {
...props,
...slots,
// In Solid SSR mode, `ssr` creates the expected structure for `children`.
children: children != null ? ssr(`<astro-slot>${children}</astro-slot>`) : children,
- }
+ };
const html = renderToString(() => createComponent(Component, newProps));
- return { html }
+ return { html };
}
export default {