source: imaps-frontend/node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-media-queries.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 661 bytes
Line 
1var Token = require('../../tokenizer/token');
2
3var serializeAll = require('../../writer/one-time').all;
4var serializeRules = require('../../writer/one-time').rules;
5
6function removeDuplicateMediaQueries(tokens) {
7 var candidates = {};
8 var candidate;
9 var token;
10 var key;
11 var i, l;
12
13 for (i = 0, l = tokens.length; i < l; i++) {
14 token = tokens[i];
15 if (token[0] != Token.NESTED_BLOCK) {
16 continue;
17 }
18
19 key = serializeRules(token[1]) + '%' + serializeAll(token[2]);
20 candidate = candidates[key];
21
22 if (candidate) {
23 candidate[2] = [];
24 }
25
26 candidates[key] = token;
27 }
28}
29
30module.exports = removeDuplicateMediaQueries;
Note: See TracBrowser for help on using the repository browser.