Closed isaacs closed 9 years ago
Thanks for the contribution, @isaacs though I am concerned about standard
compatibility ;)
I don't think that we should be embracing standard
, though we should still show it empathy.
> require('./')(require('standard'))
'Empathy!'
This adds tests, but also makes some slight semantic changes that I think may have been the original intent.
With this change, calling
MaybeHug(cutie)
returns either'HUG!'
or'Empathy!'
, rather than returning nothing.Passing null or undefined as the cutie causes it to eagerly throw a TypeError, rather than throwing later when it tries to hug. (In other words, don't try to hug ghosts like null and undefined, they never like it, and are offended by the offer.)
There is now 100% test coverage as well.