natefaubion / sparkler

Native pattern matching for JavaScript
MIT License
693 stars 18 forks source link

Simplify extractor protocol result checks #6

Closed natefaubion closed 10 years ago

natefaubion commented 10 years ago

It's assumed that unapply returns an array or null, and unapplyObject returns an object or null, so we shouldn't ave to do the tag check on the result. Just check r != null.