documentcloud/underscore-contrib — pull request #51 by evilhackerdude (2013-06-15 21:07:39+00:00)
Title: Make _.getPath and _.hasPath not consume `ks` argument

When using a partially applied `_.getPath` I noticed it only acted upon the first element in the list. The reason is that it consumes the `ks` argument. I presume `_.getPath` and `_.hasPath` are not supposed to consume any of their arguments.

`shift` [mutates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift), so I've replaced the shift call with `_.first` and `_.rest` calls.

I've also added a test which asserts that `ks` isn't mutated.