You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
478 B
JavaScript
22 lines
478 B
JavaScript
5 years ago
|
var stringifyAll = require('../stringifier/one-time').all;
|
||
|
|
||
|
function removeDuplicateMediaQueries(tokens) {
|
||
|
var candidates = {};
|
||
|
|
||
|
for (var i = 0, l = tokens.length; i < l; i++) {
|
||
|
var token = tokens[i];
|
||
|
if (token[0] != 'block')
|
||
|
continue;
|
||
|
|
||
|
var key = token[1][0] + '%' + stringifyAll(token[2]);
|
||
|
var candidate = candidates[key];
|
||
|
|
||
|
if (candidate)
|
||
|
candidate[2] = [];
|
||
|
|
||
|
candidates[key] = token;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = removeDuplicateMediaQueries;
|