BeechCMS / @beechcms/core / InMemorySeedRegistry
Class: InMemorySeedRegistry
Named subclass of SeedRegistry for use in test suites. Gives tests a semantic name without requiring any dependency on factory.ts.
Extends
Constructors
Constructor
new InMemorySeedRegistry(
seeds):InMemorySeedRegistry
Parameters
seeds
Seed[]
Returns
InMemorySeedRegistry
Inherited from
Methods
all()
all():
Seed[]
Returns all seeds as a flat array, preserving insertion order. Decouples callers from the internal storage shape so the registry implementation can change without touching every route handler.
Returns
Seed[]
Inherited from
draftEnabled()
draftEnabled():
Seed[]
Returns seeds that have the draft workflow enabled. Eliminates the seeds.filter(s => s.allowDrafts) pattern.
Returns
Seed[]
Inherited from
get()
get(
slug):Seed|null
Returns the seed with the given slug, or null if not found. Provides a single lookup point that can be overridden in tests without rebuilding the full registry object.
Parameters
slug
string
Returns
Seed | null
Inherited from
publicReadable()
publicReadable():
Seed[]
Returns seeds that have allowPublicRead enabled. Eliminates the seeds.filter(s => s.allowPublicRead) pattern.
Returns
Seed[]
Inherited from
visibleInDashboard()
visibleInDashboard():
Seed[]
Returns seeds that are visible in the dashboard sidebar. A seed is visible when dashboard.hidden is not explicitly true. Eliminates the seeds.filter(s => !s.dashboard?.hidden) pattern that would otherwise be duplicated across route handlers.
Returns
Seed[]