/StructureWalker

Javascript structure map/filter walker

Primary LanguageJavaScript

StructureWalker

Javascript structure map/filter walker.

structureWalker extends the idea of map, reduce, filter over Arrays and Objects onto arbitrary structures of Arrays, Objects and Primitives.

Example uses:

Convert data table (Object of Arrays) into JS style Array of Objects.

Combine two structures with the same or similar shapes

Map fields and groups of fields in a object to differently named fields in a new object. (an aesthetic).

Map back to the original.

Build compound filters that can be built in one aesthetic and operate on another.

Requirements

Requires underscore.js

Examples

see structureWalker_tests.js for more examples.

Getting Started

Testing

This project includes unit tests for the structureWalker functionality.

Requires node.js. See structureWalker.tests for details.