JosephMoniz/UnderscoreKit — pull request #1 by traleig1 (2012-10-16 07:24:53+00:00)
Title: Fix error with take/dropWhile when offsetWhile returns -1

When `offsetWhile` fails to find an item in a list, it returns -1: according to the tests this is the intended behavior. However, when `take` is passed a negative number, it returns the list truncated by that amount; i.e., `_.take(-2,[1,2,3,4])` returns `[1,2]`.

I've fixed this in takeWhile and dropWhile by checking if offsetWhile returns -1, and swapping it for list.length, but you might instead just want to change the behavior of offsetWhile.