freshlogic/whosit — pull request #4 by LarryBattle (2013-11-27 17:57:35+00:00)
Title: Fixed bugs and optimized code 

I had some free time during my lunch to look over your code and here's what I fixed.

- Used hash tables instead of Array.prototype.some() for looking up suffix and salutation.
- Created function to convert from lexical to western order
- Used `Array.prototype.shift()` and `Array.prototype.pop()` instead of `Array.prototype.splice()`
- Forced input to `.parse()` to a string.
- Returns empty object is no input is supplied.
- Bug fix: Trimmed input to avoid creating empty tokens

Example without trimmed input
Input:

whosit.parse(" Larry Battle ")

Returns:

Object {first: "", middle: "Larry", last: "Battle "}

Example with trimmed input
Input:

whosit.parse(" Larry Battle ")

Returns:

Object {first: "Larry", last: "Battle"}