Traqula
    Preparing search index...

    Hierarchy

    Index

    Constructors

    Methods

    • Protected

      Function to shallow clone an object.

      Type Parameters

      • T

      Parameters

      • obj: T

      Returns T

    • Protected

      Function that will call the visitor callback only on true objects. If the provided value is an array object, it will callback on all members

      Parameters

      • value: unknown
      • mapper: (some: object) => any

      Returns unknown

    • Transform a single node. The transformation calls the preVisitor from starting from the startObject. The preVisitor can dictate whether transformation should be stopped. Note that stopping the transformation also prevets further copying. The transformer itself transforms object starting with the deepest one that can be visited. The transformer callback is performed on a copy of the original.

      Type Parameters

      • Safe extends "safe" | "unsafe" = "safe"

      Parameters

      • startObject: object
      • nodeCallBacks: {
            add?: {
                preVisitor?: (op: Algebra.Add) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Add>) => any;
            };
            alt?: {
                preVisitor?: (op: Algebra.Alt) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Alt>) => any;
            };
            ask?: {
                preVisitor?: (op: Algebra.Ask) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Ask>) => any;
            };
            bgp?: {
                preVisitor?: (op: Algebra.Bgp) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Bgp>) => any;
            };
            clear?: {
                preVisitor?: (op: Algebra.Clear) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Clear>) => any;
            };
            compositeupdate?: {
                preVisitor?: (op: Algebra.CompositeUpdate) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.CompositeUpdate>) => any;
            };
            construct?: {
                preVisitor?: (op: Algebra.Construct) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Construct>) => any;
            };
            copy?: {
                preVisitor?: (op: Algebra.Copy) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Copy>) => any;
            };
            create?: {
                preVisitor?: (op: Algebra.Create) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Create>) => any;
            };
            deleteinsert?: {
                preVisitor?: (op: Algebra.DeleteInsert) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.DeleteInsert>) => any;
            };
            describe?: {
                preVisitor?: (op: Algebra.Describe) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Describe>) => any;
            };
            distinct?: {
                preVisitor?: (op: Algebra.Distinct) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Distinct>) => any;
            };
            drop?: {
                preVisitor?: (op: Algebra.Drop) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Drop>) => any;
            };
            expression?: {
                preVisitor?: (op: Algebra.Expression) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Expression>) => any;
            };
            extend?: {
                preVisitor?: (op: Algebra.Extend) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Extend>) => any;
            };
            filter?: {
                preVisitor?: (op: Algebra.Filter) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Filter>) => any;
            };
            from?: {
                preVisitor?: (op: Algebra.From) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.From>) => any;
            };
            graph?: {
                preVisitor?: (op: Algebra.Graph) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Graph>) => any;
            };
            group?: {
                preVisitor?: (op: Algebra.Group) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Group>) => any;
            };
            inv?: {
                preVisitor?: (op: Algebra.Inv) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Inv>) => any;
            };
            join?: {
                preVisitor?: (op: Algebra.Join) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Join>) => any;
            };
            leftjoin?: {
                preVisitor?: (op: Algebra.LeftJoin) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.LeftJoin>) => any;
            };
            link?: {
                preVisitor?: (op: Algebra.Link) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Link>) => any;
            };
            load?: {
                preVisitor?: (op: Algebra.Load) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Load>) => any;
            };
            minus?: {
                preVisitor?: (op: Algebra.Minus) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Minus>) => any;
            };
            move?: {
                preVisitor?: (op: Algebra.Move) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Move>) => any;
            };
            nop?: {
                preVisitor?: (op: Algebra.Nop) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Nop>) => any;
            };
            nps?: {
                preVisitor?: (op: Algebra.Nps) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Nps>) => any;
            };
            OneOrMorePath?: {
                preVisitor?: (op: Algebra.OneOrMorePath) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.OneOrMorePath>) => any;
            };
            orderby?: {
                preVisitor?: (op: Algebra.OrderBy) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.OrderBy>) => any;
            };
            path?: {
                preVisitor?: (op: Algebra.Path) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Path>) => any;
            };
            pattern?: {
                preVisitor?: (op: Algebra.Pattern) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Pattern>) => any;
            };
            project?: {
                preVisitor?: (op: Algebra.Project) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Project>) => any;
            };
            reduced?: {
                preVisitor?: (op: Algebra.Reduced) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Reduced>) => any;
            };
            seq?: {
                preVisitor?: (op: Algebra.Seq) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Seq>) => any;
            };
            service?: {
                preVisitor?: (op: Algebra.Service) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Service>) => any;
            };
            slice?: {
                preVisitor?: (op: Algebra.Slice) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Slice>) => any;
            };
            union?: {
                preVisitor?: (op: Algebra.Union) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Union>) => any;
            };
            values?: {
                preVisitor?: (op: Algebra.Values) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.Values>) => any;
            };
            ZeroOrMorePath?: {
                preVisitor?: (op: Algebra.ZeroOrMorePath) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.ZeroOrMorePath>) => any;
            };
            ZeroOrOnePath?: {
                preVisitor?: (op: Algebra.ZeroOrOnePath) => VisitContext;
                transform?: (op: SafeWrap<Safe, Algebra.ZeroOrOnePath>) => any;
            };
        }

      Returns any

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

      Parameters

      • startObject: object

        object to start iterating from

      • mapper: (some: object) => any

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

      • OptionalpreVisitor: (some: object) => VisitContext

        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

    • Similar to this.transformNode, but without copying the startObject. The pre-visitor visits starting from the root, going deeper, while the actual visitor goes in reverse.

      Parameters

      • startObject: object
      • nodeCallBacks: {
            add?: {
                preVisitor?: (op: Algebra.Add) => VisitContext;
                visitor?: (op: Algebra.Add) => void;
            };
            alt?: {
                preVisitor?: (op: Algebra.Alt) => VisitContext;
                visitor?: (op: Algebra.Alt) => void;
            };
            ask?: {
                preVisitor?: (op: Algebra.Ask) => VisitContext;
                visitor?: (op: Algebra.Ask) => void;
            };
            bgp?: {
                preVisitor?: (op: Algebra.Bgp) => VisitContext;
                visitor?: (op: Algebra.Bgp) => void;
            };
            clear?: {
                preVisitor?: (op: Algebra.Clear) => VisitContext;
                visitor?: (op: Algebra.Clear) => void;
            };
            compositeupdate?: {
                preVisitor?: (op: Algebra.CompositeUpdate) => VisitContext;
                visitor?: (op: Algebra.CompositeUpdate) => void;
            };
            construct?: {
                preVisitor?: (op: Algebra.Construct) => VisitContext;
                visitor?: (op: Algebra.Construct) => void;
            };
            copy?: {
                preVisitor?: (op: Algebra.Copy) => VisitContext;
                visitor?: (op: Algebra.Copy) => void;
            };
            create?: {
                preVisitor?: (op: Algebra.Create) => VisitContext;
                visitor?: (op: Algebra.Create) => void;
            };
            deleteinsert?: {
                preVisitor?: (op: Algebra.DeleteInsert) => VisitContext;
                visitor?: (op: Algebra.DeleteInsert) => void;
            };
            describe?: {
                preVisitor?: (op: Algebra.Describe) => VisitContext;
                visitor?: (op: Algebra.Describe) => void;
            };
            distinct?: {
                preVisitor?: (op: Algebra.Distinct) => VisitContext;
                visitor?: (op: Algebra.Distinct) => void;
            };
            drop?: {
                preVisitor?: (op: Algebra.Drop) => VisitContext;
                visitor?: (op: Algebra.Drop) => void;
            };
            expression?: {
                preVisitor?: (op: Algebra.Expression) => VisitContext;
                visitor?: (op: Algebra.Expression) => void;
            };
            extend?: {
                preVisitor?: (op: Algebra.Extend) => VisitContext;
                visitor?: (op: Algebra.Extend) => void;
            };
            filter?: {
                preVisitor?: (op: Algebra.Filter) => VisitContext;
                visitor?: (op: Algebra.Filter) => void;
            };
            from?: {
                preVisitor?: (op: Algebra.From) => VisitContext;
                visitor?: (op: Algebra.From) => void;
            };
            graph?: {
                preVisitor?: (op: Algebra.Graph) => VisitContext;
                visitor?: (op: Algebra.Graph) => void;
            };
            group?: {
                preVisitor?: (op: Algebra.Group) => VisitContext;
                visitor?: (op: Algebra.Group) => void;
            };
            inv?: {
                preVisitor?: (op: Algebra.Inv) => VisitContext;
                visitor?: (op: Algebra.Inv) => void;
            };
            join?: {
                preVisitor?: (op: Algebra.Join) => VisitContext;
                visitor?: (op: Algebra.Join) => void;
            };
            leftjoin?: {
                preVisitor?: (op: Algebra.LeftJoin) => VisitContext;
                visitor?: (op: Algebra.LeftJoin) => void;
            };
            link?: {
                preVisitor?: (op: Algebra.Link) => VisitContext;
                visitor?: (op: Algebra.Link) => void;
            };
            load?: {
                preVisitor?: (op: Algebra.Load) => VisitContext;
                visitor?: (op: Algebra.Load) => void;
            };
            minus?: {
                preVisitor?: (op: Algebra.Minus) => VisitContext;
                visitor?: (op: Algebra.Minus) => void;
            };
            move?: {
                preVisitor?: (op: Algebra.Move) => VisitContext;
                visitor?: (op: Algebra.Move) => void;
            };
            nop?: {
                preVisitor?: (op: Algebra.Nop) => VisitContext;
                visitor?: (op: Algebra.Nop) => void;
            };
            nps?: {
                preVisitor?: (op: Algebra.Nps) => VisitContext;
                visitor?: (op: Algebra.Nps) => void;
            };
            OneOrMorePath?: {
                preVisitor?: (op: Algebra.OneOrMorePath) => VisitContext;
                visitor?: (op: Algebra.OneOrMorePath) => void;
            };
            orderby?: {
                preVisitor?: (op: Algebra.OrderBy) => VisitContext;
                visitor?: (op: Algebra.OrderBy) => void;
            };
            path?: {
                preVisitor?: (op: Algebra.Path) => VisitContext;
                visitor?: (op: Algebra.Path) => void;
            };
            pattern?: {
                preVisitor?: (op: Algebra.Pattern) => VisitContext;
                visitor?: (op: Algebra.Pattern) => void;
            };
            project?: {
                preVisitor?: (op: Algebra.Project) => VisitContext;
                visitor?: (op: Algebra.Project) => void;
            };
            reduced?: {
                preVisitor?: (op: Algebra.Reduced) => VisitContext;
                visitor?: (op: Algebra.Reduced) => void;
            };
            seq?: {
                preVisitor?: (op: Algebra.Seq) => VisitContext;
                visitor?: (op: Algebra.Seq) => void;
            };
            service?: {
                preVisitor?: (op: Algebra.Service) => VisitContext;
                visitor?: (op: Algebra.Service) => void;
            };
            slice?: {
                preVisitor?: (op: Algebra.Slice) => VisitContext;
                visitor?: (op: Algebra.Slice) => void;
            };
            union?: {
                preVisitor?: (op: Algebra.Union) => VisitContext;
                visitor?: (op: Algebra.Union) => void;
            };
            values?: {
                preVisitor?: (op: Algebra.Values) => VisitContext;
                visitor?: (op: Algebra.Values) => void;
            };
            ZeroOrMorePath?: {
                preVisitor?: (op: Algebra.ZeroOrMorePath) => VisitContext;
                visitor?: (op: Algebra.ZeroOrMorePath) => void;
            };
            ZeroOrOnePath?: {
                preVisitor?: (op: Algebra.ZeroOrOnePath) => VisitContext;
                visitor?: (op: Algebra.ZeroOrOnePath) => void;
            };
        }

      Returns void

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

      Parameters

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

      Returns void