visionmedia/rework — pull request #57 by jonathanong (2013-03-14 10:11:02+00:00)
Title: Refactor extends

Fixes #46 #52 #53

Quite different than your method as it's rewritten in its entirety. I have a feeling that it may be slower, but I believe it's the correct implementation.

Some notes:

* Adds `utils.cleanRules` that cleans rules with an empty selector array or empty declarations array. Basically a "tidy" utility as mentioned in #46. Not sure if you wanted to use it as a utility or as a mixin.
* Adds a `utils.escapeRegExp` to escape strings for use with a RegExp (for the next point).
* You can extend from a nested/combined selector: see `fixtures/extend.combined.selectors`
* Adds five additional tests for extend, passes all of them.