summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar natemoo-re <natemoo-re@users.noreply.github.com> 2023-01-30 20:13:41 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2023-01-30 20:13:41 +0000
commit1a4cb6bc6ed767845546ee7705aa3853398552d5 (patch)
tree124d207f95f4c71a7e2fa0411505d2c69ee86c64
parent41e97158ba90d23d346b6e3ff6c7c14b5ecbe903 (diff)
downloadastro-1a4cb6bc6ed767845546ee7705aa3853398552d5.tar.gz
astro-1a4cb6bc6ed767845546ee7705aa3853398552d5.tar.zst
astro-1a4cb6bc6ed767845546ee7705aa3853398552d5.zip
[ci] format
-rw-r--r--packages/astro/src/runtime/server/astro-component.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/astro/src/runtime/server/astro-component.ts b/packages/astro/src/runtime/server/astro-component.ts
index 975be7054..44428b929 100644
--- a/packages/astro/src/runtime/server/astro-component.ts
+++ b/packages/astro/src/runtime/server/astro-component.ts
@@ -1,14 +1,14 @@
import type { PropagationHint } from '../../@types/astro';
-import type { AstroComponentFactory } from './render/index.js';
import { AstroError, AstroErrorData } from '../../core/errors/index.js';
+import type { AstroComponentFactory } from './render/index.js';
function validateArgs(args: unknown[]): args is Parameters<AstroComponentFactory> {
if (args.length !== 3) return false;
- if (!args[0] ||typeof args[0] !== 'object') return false;
+ if (!args[0] || typeof args[0] !== 'object') return false;
return true;
}
function baseCreateComponent(cb: AstroComponentFactory, moduleId?: string): AstroComponentFactory {
- const name = moduleId?.split('/').pop()?.replace('.astro', '') ?? ''
+ const name = moduleId?.split('/').pop()?.replace('.astro', '') ?? '';
const fn = (...args: Parameters<AstroComponentFactory>) => {
if (!validateArgs(args)) {
throw new AstroError({
@@ -17,7 +17,7 @@ function baseCreateComponent(cb: AstroComponentFactory, moduleId?: string): Astr
});
}
return cb(...args);
- }
+ };
Object.defineProperty(fn, 'name', { value: name, writable: false });
// Add a flag to this callback to mark it as an Astro component
fn.isAstroComponentFactory = true;