multi-vector
easily iterate and restructure deeply nested trees
Usage
var MultiVector = ; var mv = 'a' 'b' 'c'; // list the index names mv;mv; mv;//=> 'hello' { console;} // Iterate the trees mv; // 'hello', 'foo', 2, 3// 'howdy', 'foo', 2, 4 mv; // custom ordering of callback arguments // 'hello', 3, 'foo', 2// 'howdy', 4, 'foo', 2 mv;/*{ 'foo': { '2': { '3': 'hello', '4': 'howdy' } }}*/ mv; // reshape or pivot the exported data/*{ '3': { 'foo': { '2': 'hello' } }, '4': { 'foo': { '2': 'howdy' } }}*/
License
MIT © James Talmage