@metreeca/keep
    Preparing search index...

    Builds a Flake from a Shape and an optional retrieval template.

    • Builds a flake from a shape, capturing its full structural reach.

      The reach extends into embedded resources and captive references. Other references stay leaves, since their targets have an independent lifecycle. A non-resource root yields a leaf flake with no property branches.

      Warning

      Cyclic captive shapes are not supported: building a flake over a captive reference whose target leads back to it exhausts the call stack.

      Parameters

      • shape: Lazy<Shape>

        The lazy root shape

      Returns Flake

      An immutable Flake over the structural reach of shape

    • Builds a flake from a shape and a retrieval template, keeping only the properties the template addresses.

      The root carries the whole template as its drain. Each branch carries the query requested for its property as its own drain, including the criteria of a collection query. Property branches form only on a resource root: a non-resource root yields a leaf flake with no drain.

      Parameters

      • shape: Lazy<Shape>

        The lazy root shape

      • model: Template

        The retrieval template selecting the properties to keep

      Returns Flake

      An immutable Flake restricted to the properties model addresses

      RangeError If a query in model takes no form its property admits