Hi Jimi, during my review I wanted to mess around a bit with the code and in the process ended up writing two extra unit tests (in mocha) which I thought might be useful.
Also, I implemented the simplification I proposed in a comment on the pull request you sent me.
I didn't want to push it straight to your branch in case you disagree, but if you don't you can merge this and then merge your PR.
Hi Jimi, during my review I wanted to mess around a bit with the code and in the process ended up writing two extra unit tests (in mocha) which I thought might be useful. Also, I implemented the simplification I proposed in a comment on the pull request you sent me.
I didn't want to push it straight to your branch in case you disagree, but if you don't you can merge this and then merge your PR.