Traqula
    Preparing search index...

    Most specific AST transformer that dispatches visit and transform callbacks based on both the type and subType fields of SubTyped nodes.

    Extends TransformerTyped with an additional dispatch level. When a callback is registered for a specific (type, subType) pair, it takes precedence over the type-only callback from TransformerTyped.transformNode.

    This is the recommended transformer for SPARQL ASTs where nodes have both type and subType discriminators (e.g., { type: 'term', subType: 'literal' }).

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    defaultContext: TransformContext
    defaultNodePreVisitor: DefaultNodePreVisitor<Nodes>
    maxStackSize: number

    Methods

    • Protected

      Function to shallow clone any type.

      Type Parameters

      • T

      Parameters

      • obj: T

      Returns T

    • Recursively transforms all objects that are not arrays. Mapper is called on deeper objects first.

      Parameters

      • startObject: object

        object to start iterating from

      • mapper: (copy: object, orig: object) => unknown

        mapper to transform the various objects - argument is a copy of the original

      • OptionalpreVisitor: (orig: object) => TransformContext

        callback that is evaluated before iterating deeper. If continues is false, we do not iterate deeper, current object is still mapped. - default: true If shortcut is true, we do not iterate deeper, nor do we branch out, this mapper will be the last one called.

        • Default false

      Returns unknown

    • Visitor that visits all objects. Visits deeper objects first.

      Parameters

      • startObject: object
      • visitor: (orig: object) => void
      • OptionalpreVisitor: (orig: object) => VisitContext

      Returns void