UNPKG
css-deadweigth
Version:
latest (1.0.1)
1.0.1
CLI tool to detect unused CSS in your project
css-deadweigth
/
lib
/
compare.js
12 lines
(9 loc)
•
229 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
export
function
findUnusedSelectors
(
allSelectors, usedSelectors
) {
const
unused = [];
for
(
const
selector
of
allSelectors) {
if
(!usedSelectors.
has
(selector)) { unused.
push
(selector); } }
return
unused; }