@metreeca/blue - v0.10.0
    Preparing search index...

    Function getModelVariants

    • Picks every variant compatible with a retrieval model.

      Routes a retrieval model to all variants it can draw from, so callers retrieving against a polymorphic union need not know which branch was persisted. A model is matched by kind alone, its value immaterial, so it may span several variants and retrieve each; only a model matching no variant is unsatisfiable and reported as no match. An IRI model addresses the reference variants; a structure-expanded resource template addresses the variants whose target resource it shapes.

      Type Parameters

      • V extends ValuesShape

        The variant shape type, preserved from the input array to the returned variants

      Parameters

      • model: unknown

        The retrieval model to route

      • variants: readonly V[]

        The union variants to choose among

      Returns readonly V[] | undefined

      Every variant the model fits, or undefined when it fits none (unsatisfiable)