Skip to content

Commit

Permalink
slot may be an arbitrary object
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Apr 10, 2024
1 parent aa9e33f commit 40200e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/astro/src/core/render/slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Logger } from '../logger/core.js';

function getFunctionExpression(slot: any) {
if (!slot) return;
const expressions = slot?.expressions.filter((e: unknown) => isRenderInstruction(e) === false);
const expressions = slot?.expressions?.filter((e: unknown) => isRenderInstruction(e) === false);
if (expressions?.length !== 1) return
return expressions[0] as (...args: any[]) => any;
}
Expand Down

0 comments on commit 40200e1

Please sign in to comment.