substack/js-traverse — Issue #16: can't chain functions
Author: boxxxie
Created: 2011-12-02 20:58:04+00:00
State: open

````
var removeHeirachy= traverse(ReportData).
//remove the hierarchy stupid thing
map(function (o){
if(this.key == 'hierarchy'){this.remove();};
if(this.key == 'company'){
this.update(_.extend(o,{groups:o.hierarchy.groups}));
}}).
//apply stores stats to the terminals
map(function(o){
if(o.terminals){
console.log(_(o.terminals).map(extendFromParentToChild({number:'storeNumber',storeName:'storeName'})(o)));
}
});
````

with this i get an error that my object has no map (because of the second map).
since i'm wrapping my object in a traverse, it would be nice if i could chain my functions, and maybe call a .value() function to get my result object back from the chain.

is this possible with the current code base?