ericf/css-media-match — pull request #1 by tilomitra (2014-01-07 12:47:44+00:00)
Title: add `doesMQMatch()` fn with unit test coverage

This pull request adds the `doesMQMatch()` function which adds the ability to test a media query against an object. All the media query features that are part of the spec are supported.

## Some examples:

```js
doesMQMatch('screen and (min-width: 767px) and (max-width: 979px)', {type: 'screen', width: 800} // returns true
doesMQMatch('screen and (min-width: 767px) and (max-width: 979px)', {type: 'screen', width: 980} // returns false
doesMQMatch('screen and (min-width: 767px), screen and (color)', {type: 'screen', color: 1} // returns true
```

## TODO
* [ ] Add support for `not` operator.
* [ ] Possible code cleanup

I added a substantial suite of unit tests to make sure this works properly. You can check that out for some more examples. Just run `npm test` from the root directory. I'm interested in getting some feedback on the general logic while I finish the remaining tasks. Is there a simpler way to do what I'm doing in the `doesMQMatch()` function?

Thanks!