a zip code crypto-currency system good for red ONLY

remove-duplicate-media-queries.js 661B

12345678910111213141516171819202122232425262728293031
  1. var Token = require('../../tokenizer/token');
  2. var serializeAll = require('../../writer/one-time').all;
  3. var serializeRules = require('../../writer/one-time').rules;
  4. function removeDuplicateMediaQueries(tokens) {
  5. var candidates = {};
  6. var candidate;
  7. var token;
  8. var key;
  9. var i, l;
  10. for (i = 0, l = tokens.length; i < l; i++) {
  11. token = tokens[i];
  12. if (token[0] != Token.NESTED_BLOCK) {
  13. continue;
  14. }
  15. key = serializeRules(token[1]) + '%' + serializeAll(token[2]);
  16. candidate = candidates[key];
  17. if (candidate) {
  18. candidate[2] = [];
  19. }
  20. candidates[key] = token;
  21. }
  22. }
  23. module.exports = removeDuplicateMediaQueries;