wearefractal/try-parse — pull request #2 by gberger42 (2013-10-03 22:14:36+00:00)
Title: Add methods parseArray and parseAny

When `parseObject` is used with an Array, it returns and Object with properties such as 0, 1, 2...

For a better behavior, I made `parseArray`. It accepts an Array and returns an Array. It works recursively, like parseObject does.

To DRY up the code, I made parseAny, which takes anything, checks its type, and delegates it to `parseValue`, `parseObject` or `parseArray` accordingly.

I made testes for `parseArray`, but couldn't think of a good way to test `parseAny`. I wanted to check it was calling the corresponding functions, but without actually having to call them myself. This is possible with [Jasmine](http://pivotal.github.io/jasmine/) with Spies. Any ideas on this?