Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "crawl"

This an implementation of the visitor pattern

module

crawl

Index

Functions

Functions

crawl

  • crawl(tree: any, visitor: Function, parent?: undefined | string, depth?: number, level?: number): void
  • This an implementation of the visitor pattern. Pass in an object and it will traverse it using breadth first and call your visitor function once for each node it encounters

    Parameters

    • tree: any

      The object to crawl

    • visitor: Function

      The function that will be called for each node. It will receive three parameters: object - the node that was found, name - the name of the node, path - a dot delimited string that indicates depth and membership, depth - indicates how many nodes have been visited level - a integer indicating depth in the object tree,

    • Optional parent: undefined | string

      Intended to be used when called recursively. It is a dot delimited string that indicates depth and membership

    • Default value depth: number = 0

      Intended to be used when called recursively.

    • Default value level: number = 0

      Intended to be used when called recursively.

    Returns void

Generated using TypeDoc