autoprefixer 10.5.2 → 10.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/brackets.js CHANGED
@@ -19,9 +19,13 @@ let brackets = {
19
19
  }
20
20
 
21
21
  if (sym === ')') {
22
- stack.pop()
23
- current = last(stack)
24
- current.push('')
22
+ if (stack.length > 1) {
23
+ stack.pop()
24
+ current = last(stack)
25
+ current.push('')
26
+ } else {
27
+ current[current.length - 1] += sym
28
+ }
25
29
  continue
26
30
  }
27
31
 
@@ -55,6 +55,10 @@ class Gradient extends Value {
55
55
  continue
56
56
  }
57
57
 
58
+ if (param.length === 0) {
59
+ continue
60
+ }
61
+
58
62
  let color = parser.stringify(param[0])
59
63
  if (param[1] && param[1].type === 'word') {
60
64
  pos = param[1].value
@@ -75,7 +79,7 @@ class Gradient extends Value {
75
79
 
76
80
  let div = param[param.length - 1]
77
81
  params[i] = [{ type: 'word', value: stop }]
78
- if (div.type === 'div' && div.value === ',') {
82
+ if (div && div.type === 'div' && div.value === ',') {
79
83
  item = params[i].push(div)
80
84
  }
81
85
  result.push(item)
@@ -184,6 +188,9 @@ class Gradient extends Value {
184
188
  * Replace old direction to new
185
189
  */
186
190
  newDirection(params) {
191
+ if (!params[0]) {
192
+ return params
193
+ }
187
194
  if (params[0].value === 'to') {
188
195
  return params
189
196
  }
@@ -297,7 +304,7 @@ class Gradient extends Value {
297
304
  oldDirection(params) {
298
305
  let div = this.cloneDiv(params[0])
299
306
 
300
- if (params[0][0].value !== 'to') {
307
+ if (!params[0][0] || params[0][0].value !== 'to') {
301
308
  return params.unshift([
302
309
  { type: 'word', value: Gradient.oldDirections.bottom },
303
310
  div
@@ -328,6 +335,9 @@ class Gradient extends Value {
328
335
  if (this.name !== 'linear-gradient') {
329
336
  return false
330
337
  }
338
+ if (nodes.length === 0) {
339
+ return false
340
+ }
331
341
  if (nodes[0] && nodes[0].value.includes('deg')) {
332
342
  return false
333
343
  }
package/lib/selector.js CHANGED
@@ -38,10 +38,12 @@ class Selector extends Prefixer {
38
38
  return false
39
39
  }
40
40
 
41
+ let beforeSelector = list.comma(before.selector).join(', ')
42
+
41
43
  let some = false
42
44
  for (let key in prefixeds[this.name]) {
43
45
  let prefixed = prefixeds[this.name][key]
44
- if (before.selector === prefixed) {
46
+ if (beforeSelector === prefixed) {
45
47
  if (prefix === key) {
46
48
  return true
47
49
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoprefixer",
3
- "version": "10.5.2",
3
+ "version": "10.5.4",
4
4
  "description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
5
5
  "keywords": [
6
6
  "autoprefixer",
@@ -33,8 +33,8 @@
33
33
  "main": "lib/autoprefixer.js",
34
34
  "types": "lib/autoprefixer.d.ts",
35
35
  "dependencies": {
36
- "browserslist": "^4.28.4",
37
- "caniuse-lite": "^1.0.30001799",
36
+ "browserslist": "^4.28.6",
37
+ "caniuse-lite": "^1.0.30001806",
38
38
  "fraction.js": "^5.3.4",
39
39
  "picocolors": "^1.1.1",
40
40
  "postcss-value-parser": "^4.2.0"