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

    Function getShapeBranches

    • Resolves the branches a shape admits values from.

      Flattens a union to its branches, in the order they were stated, and takes any other shape to the single branch it is, so that a caller routing a value over a shape needs not tell a polymorphic one from a plain one. Branches are resolved, a nested union flattened into the enclosing one, so that a caller routes each alternative without flattening again.

      Resolution also holds the union to coherence: a member name declared by several of the resources its branches describe or link to must denote the same property throughout, so that a caller may resolve it once rather than per branch. The declarations must agree on the member kind, on the forward and reverse predicates the name is mapped to, and on the captive and foreign flags; they may differ in range, cardinality and value domain, which merge into the range a path crossing the union reaches.

      Parameters

      • shape: Lazy<Shape>

        The shape to enumerate, possibly deferred to break definition cycles

      Returns readonly Shape[]

      The branches shape admits values from, in the order they were stated, each resolved and merged where it describes a resource

      TraceError Where a deferred definition reaches itself, or where the branches declare a shared member name inconsistently