Skip to content

Commit

Permalink
new top-level map forEach paths and nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Sep 4, 2010
1 parent 2cdd854 commit e508823
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/traverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,18 @@ Traverse.clone = function (obj) {
return Traverse(obj).get();
};

Traverse.map = function (obj, f) {
return Traverse(obj).modify(f).get();
};

Traverse.forEach = function (obj, f) {
Traverse(obj).forEach(f);
};

Traverse.paths = function () {
return Traverse(obj).paths();
};

Traverse.nodes = function () {
return Traverse(obj).nodes();
};

0 comments on commit e508823

Please sign in to comment.