ApplyDepthPopulate
ApplyDepthPopulate<
TCollectionSlug,TPopulate> =TCollectionSlugextends keyofDocumentBySlug?TCollectionSlugextends keyofCollectionsPopulateMap?ApplyContainerPopulate<DocumentBySlug[TCollectionSlug],CollectionsPopulateMap[TCollectionSlug],TPopulate> :DocumentBySlug[TCollectionSlug] :never
Defined in: packages/core/src/db/types.ts:378
Unconstrained counterpart of Populated for DepthPopulated’s own
use — TPopulate carries NO extends PopulateShape<TCollectionSlug>
bound.
DepthPopulate’s own walk is ALWAYS a valid PopulateShape by
construction, so nothing needs to re-verify it — but Populated’s own
constrained second parameter forced exactly that (via an
& PopulateShape<TCollectionSlug> bridge, needed only because
DepthPopulate’s mapped-type key domain is a separate, though
equivalent, expression from PopulateShape’s own — see DepthPopulate’s
own doc comment). That bridge multiplies TWO already-recursive container
walks (the depth walk AND the populate-shape walk) together for every
instantiation, which overflows TypeScript’s instantiation depth limit
(TS2589) on a real, many-collection project — DepthPopulate’s OWN
“practical depth limit: 3” note is about ITS OWN recursion; the
intersection bridge made the COMBINED cost worse than either alone.
Internal-use only — never accept arbitrary caller-supplied TPopulate
through this alias; it has no key-safety checking at all.
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends CollectionSlug
TPopulate
Section titled “TPopulate”TPopulate