File tree Expand file tree Collapse file tree 7 files changed +1518
-792
lines changed
Expand file tree Collapse file tree 7 files changed +1518
-792
lines changed Original file line number Diff line number Diff line change 1818 "semicolon" : false
1919 },
2020 "dependencies" : {
21- "array-uniq" : " ^1.0.3" ,
2221 "colors-regex" : " ^1.0.0" ,
2322 "css-color-names" : " ^0.0.4" ,
24- "css-shorthand-expand" : " ^1.1 .0" ,
23+ "css-shorthand-expand" : " ^1.2 .0" ,
2524 "css-unit-sort" : " ^1.1.1" ,
2625 "path" : " ^0.12.7" ,
27- "postcss" : " ^6.0.14 " ,
26+ "postcss" : " ^6.0.22 " ,
2827 "postcss-values-parser" : " ^1.5.0" ,
2928 "specificity" : " ^0.3.2"
3029 },
3130 "devDependencies" : {
32- "ava" : " ^0.24 .0" ,
33- "coveralls" : " ^3.0.0 " ,
34- "nyc" : " ^11.4.1 " ,
35- "xo" : " ^0.18 .1"
31+ "ava" : " ^0.25 .0" ,
32+ "coveralls" : " ^3.0.1 " ,
33+ "nyc" : " ^12.0.2 " ,
34+ "xo" : " ^0.21 .1"
3635 },
3736 "nyc" : {
3837 "reporter" : [
Original file line number Diff line number Diff line change 1- # css-analyzer [ ![ Build Status] ( https://travis-ci.org/projectwallace/css-analyzer.svg?branch=master )] ( https://travis-ci.org/projectwallace/css-analyzer ) [ ![ Known Vulnerabilities] ( https://snyk.io/test/github/projectwallace/css-analyzer/badge.svg )] ( https://snyk.io/test/github/projectwallace/css-analyzer ) [ ![ Coverage Status] ( https://coveralls.io/repos/github/projectwallace/css-analyzer/badge.svg?branch=master )] ( https://coveralls.io/github/projectwallace/css-analyzer?branch=master )
1+ # css-analyzer [ ![ Build Status] ( https://travis-ci.org/projectwallace/css-analyzer.svg?branch=master )] ( https://travis-ci.org/projectwallace/css-analyzer ) [ ![ Known Vulnerabilities] ( https://snyk.io/test/github/projectwallace/css-analyzer/badge.svg )] ( https://snyk.io/test/github/projectwallace/css-analyzer ) [ ![ Coverage Status] ( https://coveralls.io/repos/github/projectwallace/css-analyzer/badge.svg?branch=master )] ( https://coveralls.io/github/projectwallace/css-analyzer?branch=master ) ![ Dependencies Status ] ( https://img.shields.io/david/projectwallace/css-analyzer.svg ) ![ Dependencies Status ] ( https://img.shields.io/david/dev/projectwallace/css-analyzer.svg )
22
33> Analyze your CSS completely
44
Original file line number Diff line number Diff line change 1- const arrayUniq = require ( 'array-uniq' )
2-
31module . exports = declarations => {
42 const all = declarations
53 const importants = require ( './importants' ) ( all )
6- const unique = arrayUniq (
7- all . map ( declaration => {
8- return `${ declaration . property } : ${ declaration . value } `
9- } )
10- ) . sort ( )
4+ const unique = [ ...new Set ( all . map ( declaration => {
5+ return `${ declaration . property } : ${ declaration . value } `
6+ } ) ) ] . sort ( )
117
128 return {
139 total : all . length ,
Original file line number Diff line number Diff line change 1- const arrayUniq = require ( 'array-uniq' )
2-
31module . exports = selectors => {
42 const all = selectors
5- const unique = arrayUniq ( all )
3+ const unique = [ ... new Set ( all ) ]
64 const js = require ( './js' ) ( all )
75 const id = require ( './id' ) ( all )
86 const universal = require ( './universal' ) ( all )
Original file line number Diff line number Diff line change 11const specificity = require ( 'specificity' )
2- const arrayUniq = require ( 'array-uniq' )
32
43module . exports = selectors => {
5- const all = arrayUniq ( selectors )
4+ const all = [ ... new Set ( selectors ) ]
65 . sort ( )
76 . sort ( specificity . compare )
87 . reverse ( )
Original file line number Diff line number Diff line change @@ -9,12 +9,10 @@ function stringCompare(a, b) {
99module . exports = ( values , sortFn ) => {
1010 sortFn = sortFn || stringCompare
1111
12- const reduced = Array . from (
13- values . reduce ( ( map , value ) => {
14- // Create a Map of unique values and their counts
15- return map . set ( value , map . get ( value ) + 1 || 1 )
16- } , new Map ( ) )
17- ) . map ( value => {
12+ const reduced = [ ...values . reduce ( ( map , value ) => {
13+ // Create a Map of unique values and their counts
14+ return map . set ( value , map . get ( value ) + 1 || 1 )
15+ } , new Map ( ) ) ] . map ( value => {
1816 // Create an array of [{value, count}]
1917 return {
2018 value : value [ 0 ] ,
You can’t perform that action at this time.
0 commit comments