basho-labs/riak-js — pull request #9 by TauZero (2012-11-08 21:38:23+00:00)
Title: Add linkwalk functionality

http://docs.basho.com/riak/1.2.1/tutorials/fast-track/Links-and-Link-Walking/

Usage: db.get('bucket', 'key', {links:[{bucket:'foo',tag:'bar',keep:1},...]}

Bucket, tag, and keep will default to '_' if not provided. Order of the array will be the order links are walked.

The returned data consists of objects {meta, data} nested in arrays. In order to keep things more consistent and predictable, I didn't condense single-element arrays. To get the data parsed properly, I modified the _parseMultipartMixed to handle nested boundaries.

Ex: A->B->C, A->C. Linkwalk on A with appropriate bucket and tag values keep:1 would give data:
```
[
[
{B},
{C}
],
[
{C}
]
]
```

Previous tests still pass, added a basic test for the linkwalk.