Enhance class matching to accept space-separated list or array

Previously class matching was happening by simple equality checking. This update allows `options.class` to be (or return) either a space-separated string or an array of strings. Also adds a test for both of these.
Ah, right on, thanks.

Anand Thakker
mobile: 617-833-3899
email: thakker@gmail.com
web: http://anandthakker.net


On Sun, Aug 10, 2014 at 2:45 PM, Chris Dickinson <notifications@github.com>
wrote:

> In index.js:
>
> > @@ -160,6 +161,17 @@ function parse(selector, options) {
> >      }
> >    }
> >
> > +  function listContains(type, data) {
> > +    return function(node) {
> > +      var val = options[type](node)
> > +      val =
> > +        (val instanceof Array) ? val :
> > +        (val) ? val.split(/\s+/) :
> > +        []
>
> (to avoid crashing if the returned val does not have a split method)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/chrisdickinson/cssauron/pull/5/files#r16032655>.
>