Home / Function/ mergeSlots() — astro Function Reference

mergeSlots() — astro Function Reference

Architecture documentation for the mergeSlots() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  829cfc56_1157_bf5e_c116_ee8aa18fe3cf["mergeSlots()"]
  c35665ab_15da_1077_3e74_d5bc594df46d["index.ts"]
  829cfc56_1157_bf5e_c116_ee8aa18fe3cf -->|defined in| c35665ab_15da_1077_3e74_d5bc594df46d
  style 829cfc56_1157_bf5e_c116_ee8aa18fe3cf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/index.ts lines 48–59

export function mergeSlots(...slotted: unknown[]) {
	const slots: Record<string, () => any> = {};
	for (const slot of slotted) {
		if (!slot) continue;
		if (typeof slot === 'object') {
			Object.assign(slots, slot);
		} else if (typeof slot === 'function') {
			Object.assign(slots, mergeSlots(slot()));
		}
	}
	return slots;
}

Domain

Subdomains

Frequently Asked Questions

What does mergeSlots() do?
mergeSlots() is a function in the astro codebase, defined in packages/astro/src/runtime/server/index.ts.
Where is mergeSlots() defined?
mergeSlots() is defined in packages/astro/src/runtime/server/index.ts at line 48.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free