summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2022-02-16 15:13:06 +0000
committerGravatar GitHub Actions <actions@github.com> 2022-02-16 15:13:06 +0000
commitb4dcc0f8d38a2b520154fb9b80f7f04e14aec248 (patch)
tree5c71287a4c66ec7942085244f03761451c4ad6e3
parent102161761de629fe1bfee7d151d4956c57ea2f42 (diff)
downloadastro-b4dcc0f8d38a2b520154fb9b80f7f04e14aec248.tar.gz
astro-b4dcc0f8d38a2b520154fb9b80f7f04e14aec248.tar.zst
astro-b4dcc0f8d38a2b520154fb9b80f7f04e14aec248.zip
[ci] yarn format
-rw-r--r--packages/astro/src/runtime/client/idle.ts10
-rw-r--r--packages/astro/src/runtime/client/load.ts8
-rw-r--r--packages/astro/src/runtime/client/media.ts8
-rw-r--r--packages/astro/src/runtime/client/only.ts8
-rw-r--r--packages/astro/src/runtime/client/visible.ts8
5 files changed, 21 insertions, 21 deletions
diff --git a/packages/astro/src/runtime/client/idle.ts b/packages/astro/src/runtime/client/idle.ts
index 6a5bf15e1..4d7d52245 100644
--- a/packages/astro/src/runtime/client/idle.ts
+++ b/packages/astro/src/runtime/client/idle.ts
@@ -7,21 +7,21 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
export default async function onIdle(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) {
const cb = async () => {
const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`);
- if(roots.length === 0) {
+ if (roots.length === 0) {
throw new Error(`Unable to find the root for the component ${options.name}`);
}
-
+
let innerHTML: string | null = null;
let fragment = roots[0].querySelector(`astro-fragment`);
- if(fragment == null && roots[0].hasAttribute('tmpl')) {
+ if (fragment == null && roots[0].hasAttribute('tmpl')) {
// If there is no child fragment, check to see if there is a template.
// This happens if children were passed but the client component did not render any.
let template = roots[0].querySelector(`template[data-astro-template]`);
- if(template) {
+ if (template) {
innerHTML = template.innerHTML;
template.remove();
}
- } else if(fragment) {
+ } else if (fragment) {
innerHTML = fragment.innerHTML;
}
const hydrate = await getHydrateCallback();
diff --git a/packages/astro/src/runtime/client/load.ts b/packages/astro/src/runtime/client/load.ts
index 73bb441cf..a9a6fcf6b 100644
--- a/packages/astro/src/runtime/client/load.ts
+++ b/packages/astro/src/runtime/client/load.ts
@@ -5,21 +5,21 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
*/
export default async function onLoad(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) {
const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`);
- if(roots.length === 0) {
+ if (roots.length === 0) {
throw new Error(`Unable to find the root for the component ${options.name}`);
}
let innerHTML: string | null = null;
let fragment = roots[0].querySelector(`astro-fragment`);
- if(fragment == null && roots[0].hasAttribute('tmpl')) {
+ if (fragment == null && roots[0].hasAttribute('tmpl')) {
// If there is no child fragment, check to see if there is a template.
// This happens if children were passed but the client component did not render any.
let template = roots[0].querySelector(`template[data-astro-template]`);
- if(template) {
+ if (template) {
innerHTML = template.innerHTML;
template.remove();
}
- } else if(fragment) {
+ } else if (fragment) {
innerHTML = fragment.innerHTML;
}
diff --git a/packages/astro/src/runtime/client/media.ts b/packages/astro/src/runtime/client/media.ts
index f5ae240c1..56d67d95f 100644
--- a/packages/astro/src/runtime/client/media.ts
+++ b/packages/astro/src/runtime/client/media.ts
@@ -5,21 +5,21 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
*/
export default async function onMedia(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) {
const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`);
- if(roots.length === 0) {
+ if (roots.length === 0) {
throw new Error(`Unable to find the root for the component ${options.name}`);
}
let innerHTML: string | null = null;
let fragment = roots[0].querySelector(`astro-fragment`);
- if(fragment == null && roots[0].hasAttribute('tmpl')) {
+ if (fragment == null && roots[0].hasAttribute('tmpl')) {
// If there is no child fragment, check to see if there is a template.
// This happens if children were passed but the client component did not render any.
let template = roots[0].querySelector(`template[data-astro-template]`);
- if(template) {
+ if (template) {
innerHTML = template.innerHTML;
template.remove();
}
- } else if(fragment) {
+ } else if (fragment) {
innerHTML = fragment.innerHTML;
}
diff --git a/packages/astro/src/runtime/client/only.ts b/packages/astro/src/runtime/client/only.ts
index cc4efb99d..472a6badd 100644
--- a/packages/astro/src/runtime/client/only.ts
+++ b/packages/astro/src/runtime/client/only.ts
@@ -5,21 +5,21 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
*/
export default async function onLoad(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) {
const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`);
- if(roots.length === 0) {
+ if (roots.length === 0) {
throw new Error(`Unable to find the root for the component ${options.name}`);
}
let innerHTML: string | null = null;
let fragment = roots[0].querySelector(`astro-fragment`);
- if(fragment == null && roots[0].hasAttribute('tmpl')) {
+ if (fragment == null && roots[0].hasAttribute('tmpl')) {
// If there is no child fragment, check to see if there is a template.
// This happens if children were passed but the client component did not render any.
let template = roots[0].querySelector(`template[data-astro-template]`);
- if(template) {
+ if (template) {
innerHTML = template.innerHTML;
template.remove();
}
- } else if(fragment) {
+ } else if (fragment) {
innerHTML = fragment.innerHTML;
}
const hydrate = await getHydrateCallback();
diff --git a/packages/astro/src/runtime/client/visible.ts b/packages/astro/src/runtime/client/visible.ts
index 101551ec0..1e6f7ea3c 100644
--- a/packages/astro/src/runtime/client/visible.ts
+++ b/packages/astro/src/runtime/client/visible.ts
@@ -7,21 +7,21 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
*/
export default async function onVisible(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) {
const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`);
- if(roots.length === 0) {
+ if (roots.length === 0) {
throw new Error(`Unable to find the root for the component ${options.name}`);
}
let innerHTML: string | null = null;
let fragment = roots[0].querySelector(`astro-fragment`);
- if(fragment == null && roots[0].hasAttribute('tmpl')) {
+ if (fragment == null && roots[0].hasAttribute('tmpl')) {
// If there is no child fragment, check to see if there is a template.
// This happens if children were passed but the client component did not render any.
let template = roots[0].querySelector(`template[data-astro-template]`);
- if(template) {
+ if (template) {
innerHTML = template.innerHTML;
template.remove();
}
- } else if(fragment) {
+ } else if (fragment) {
innerHTML = fragment.innerHTML;
}