Metakit / @doeixd/metakit/language

restrict

function · packages/metakit/src/language.ts:233

function restrict<F extends FamilyMap, const S extends FamilySelection<F>>(
  language: Language<F>,
  selection: S & NoUnknownFamilies<F, S>,
): Language<RestrictedFamilies<F, S>>

Derive a smaller host-specific vocabulary (e.g. a browser-safe subset) from language. Each kept operation is passed as the member itself, e.g. restrict(lang, { billing: { applyFee: lang.families.billing.applyFee } }); a member that is not one of the named family's own throws. Default SQL lowerings are kept for the retained operations.