npm module: match selectors in an object