Skip to content

Commit 06e1b68

Browse files
authored
Chore/update deps (#39)
* Replaces array-unique pkg with Set() * Upgrades AVA * Upgrades AVA * Upgrades css-shorthand-expand * Upgrades nyc * Upgrades XO * Upgrades PostCSS * Upgrades coveralls * Adds badges to README about up-to-date-ness of dependencies
1 parent 2d3a8cf commit 06e1b68

File tree

7 files changed

+1518
-792
lines changed

7 files changed

+1518
-792
lines changed

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,20 @@
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": [

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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

src/analyzer/declarations/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
const arrayUniq = require('array-uniq')
2-
31
module.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,

src/analyzer/selectors/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
const arrayUniq = require('array-uniq')
2-
31
module.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)

src/analyzer/selectors/specificity.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
const specificity = require('specificity')
2-
const arrayUniq = require('array-uniq')
32

43
module.exports = selectors => {
5-
const all = arrayUniq(selectors)
4+
const all = [...new Set(selectors)]
65
.sort()
76
.sort(specificity.compare)
87
.reverse()

src/utils/uniquer.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ function stringCompare(a, b) {
99
module.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],

0 commit comments

Comments
 (0)