Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@ extend(Walker.prototype, {
walkImpl(obj, traversalStrategy, visitor, null, context);
},

// Recursively traverses `obj` in a depth-first fashion, invoking the
// `preVisitor` function for each object before traversing its children
// and the `postVisitor` function after traversing its children
// `traversalStrategy` is intended for internal callers, and is not part
// of the public API.
walk: function(obj, preVisitor, postVisitor, context, traversalStrategy) {
traversalStrategy = traversalStrategy || this._traversalStrategy;
walkImpl(obj, traversalStrategy, preVisitor, postVisitor, context);
},

// Builds up a single value by doing a post-order traversal of `obj` and
// calling the `visitor` function on each object in the tree. For leaf
// objects, the `memo` argument to `visitor` is the value of the `leafMemo`
Expand Down