postcss 8.2.8 → 8.2.9

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.

Potentially problematic release.


This version of postcss might be problematic. Click here for more details.

package/lib/result.js CHANGED
@@ -3,7 +3,7 @@
3
3
  let Warning = require('./warning')
4
4
 
5
5
  class Result {
6
- constructor (processor, root, opts) {
6
+ constructor(processor, root, opts) {
7
7
  this.processor = processor
8
8
  this.messages = []
9
9
  this.root = root
@@ -12,11 +12,11 @@ class Result {
12
12
  this.map = undefined
13
13
  }
14
14
 
15
- toString () {
15
+ toString() {
16
16
  return this.css
17
17
  }
18
18
 
19
- warn (text, opts = {}) {
19
+ warn(text, opts = {}) {
20
20
  if (!opts.plugin) {
21
21
  if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
22
22
  opts.plugin = this.lastPlugin.postcssPlugin
@@ -29,11 +29,11 @@ class Result {
29
29
  return warning
30
30
  }
31
31
 
32
- warnings () {
32
+ warnings() {
33
33
  return this.messages.filter(i => i.type === 'warning')
34
34
  }
35
35
 
36
- get content () {
36
+ get content() {
37
37
  return this.css
38
38
  }
39
39
  }
package/lib/root.d.ts CHANGED
@@ -32,7 +32,7 @@ export default class Root extends Container {
32
32
  parent: undefined
33
33
  raws: RootRaws
34
34
 
35
- constructor (defaults?: RootProps)
35
+ constructor(defaults?: RootProps)
36
36
 
37
37
  /**
38
38
  * Returns a `Result` instance representing the root’s CSS.
@@ -47,5 +47,5 @@ export default class Root extends Container {
47
47
  * @param opts Options.
48
48
  * @return Result with current root’s CSS.
49
49
  */
50
- toResult (options?: ProcessOptions): Result
50
+ toResult(options?: ProcessOptions): Result
51
51
  }
package/lib/root.js CHANGED
@@ -5,13 +5,13 @@ let Container = require('./container')
5
5
  let LazyResult, Processor
6
6
 
7
7
  class Root extends Container {
8
- constructor (defaults) {
8
+ constructor(defaults) {
9
9
  super(defaults)
10
10
  this.type = 'root'
11
11
  if (!this.nodes) this.nodes = []
12
12
  }
13
13
 
14
- removeChild (child, ignore) {
14
+ removeChild(child, ignore) {
15
15
  let index = this.index(child)
16
16
 
17
17
  if (!ignore && index === 0 && this.nodes.length > 1) {
@@ -21,7 +21,7 @@ class Root extends Container {
21
21
  return super.removeChild(child)
22
22
  }
23
23
 
24
- normalize (child, sample, type) {
24
+ normalize(child, sample, type) {
25
25
  let nodes = super.normalize(child)
26
26
 
27
27
  if (sample) {
@@ -41,7 +41,7 @@ class Root extends Container {
41
41
  return nodes
42
42
  }
43
43
 
44
- toResult (opts = {}) {
44
+ toResult(opts = {}) {
45
45
  let lazy = new LazyResult(new Processor(), this, opts)
46
46
  return lazy.stringify()
47
47
  }
package/lib/rule.d.ts CHANGED
@@ -92,8 +92,8 @@ export default class Rule extends Container {
92
92
  */
93
93
  selectors: string[]
94
94
 
95
- constructor (defaults?: RuleProps)
96
- clone (overrides?: Partial<RuleProps>): this
97
- cloneBefore (overrides?: Partial<RuleProps>): this
98
- cloneAfter (overrides?: Partial<RuleProps>): this
95
+ constructor(defaults?: RuleProps)
96
+ clone(overrides?: Partial<RuleProps>): this
97
+ cloneBefore(overrides?: Partial<RuleProps>): this
98
+ cloneAfter(overrides?: Partial<RuleProps>): this
99
99
  }
package/lib/rule.js CHANGED
@@ -4,17 +4,17 @@ let Container = require('./container')
4
4
  let list = require('./list')
5
5
 
6
6
  class Rule extends Container {
7
- constructor (defaults) {
7
+ constructor(defaults) {
8
8
  super(defaults)
9
9
  this.type = 'rule'
10
10
  if (!this.nodes) this.nodes = []
11
11
  }
12
12
 
13
- get selectors () {
13
+ get selectors() {
14
14
  return list.comma(this.selector)
15
15
  }
16
16
 
17
- set selectors (values) {
17
+ set selectors(values) {
18
18
  let match = this.selector ? this.selector.match(/,\s*/) : null
19
19
  let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')
20
20
  this.selector = values.join(sep)
@@ -15,16 +15,16 @@ const DEFAULT_RAW = {
15
15
  semicolon: false
16
16
  }
17
17
 
18
- function capitalize (str) {
18
+ function capitalize(str) {
19
19
  return str[0].toUpperCase() + str.slice(1)
20
20
  }
21
21
 
22
22
  class Stringifier {
23
- constructor (builder) {
23
+ constructor(builder) {
24
24
  this.builder = builder
25
25
  }
26
26
 
27
- stringify (node, semicolon) {
27
+ stringify(node, semicolon) {
28
28
  /* istanbul ignore if */
29
29
  if (!this[node.type]) {
30
30
  throw new Error(
@@ -37,18 +37,18 @@ class Stringifier {
37
37
  this[node.type](node, semicolon)
38
38
  }
39
39
 
40
- root (node) {
40
+ root(node) {
41
41
  this.body(node)
42
42
  if (node.raws.after) this.builder(node.raws.after)
43
43
  }
44
44
 
45
- comment (node) {
45
+ comment(node) {
46
46
  let left = this.raw(node, 'left', 'commentLeft')
47
47
  let right = this.raw(node, 'right', 'commentRight')
48
48
  this.builder('/*' + left + node.text + right + '*/', node)
49
49
  }
50
50
 
51
- decl (node, semicolon) {
51
+ decl(node, semicolon) {
52
52
  let between = this.raw(node, 'between', 'colon')
53
53
  let string = node.prop + between + this.rawValue(node, 'value')
54
54
 
@@ -60,14 +60,14 @@ class Stringifier {
60
60
  this.builder(string, node)
61
61
  }
62
62
 
63
- rule (node) {
63
+ rule(node) {
64
64
  this.block(node, this.rawValue(node, 'selector'))
65
65
  if (node.raws.ownSemicolon) {
66
66
  this.builder(node.raws.ownSemicolon, node, 'end')
67
67
  }
68
68
  }
69
69
 
70
- atrule (node, semicolon) {
70
+ atrule(node, semicolon) {
71
71
  let name = '@' + node.name
72
72
  let params = node.params ? this.rawValue(node, 'params') : ''
73
73
 
@@ -85,7 +85,7 @@ class Stringifier {
85
85
  }
86
86
  }
87
87
 
88
- body (node) {
88
+ body(node) {
89
89
  let last = node.nodes.length - 1
90
90
  while (last > 0) {
91
91
  if (node.nodes[last].type !== 'comment') break
@@ -101,7 +101,7 @@ class Stringifier {
101
101
  }
102
102
  }
103
103
 
104
- block (node, start) {
104
+ block(node, start) {
105
105
  let between = this.raw(node, 'between', 'beforeOpen')
106
106
  this.builder(start + between + '{', node, 'start')
107
107
 
@@ -117,7 +117,7 @@ class Stringifier {
117
117
  this.builder('}', node, 'end')
118
118
  }
119
119
 
120
- raw (node, own, detect) {
120
+ raw(node, own, detect) {
121
121
  let value
122
122
  if (!detect) detect = own
123
123
 
@@ -166,7 +166,7 @@ class Stringifier {
166
166
  return value
167
167
  }
168
168
 
169
- rawSemicolon (root) {
169
+ rawSemicolon(root) {
170
170
  let value
171
171
  root.walk(i => {
172
172
  if (i.nodes && i.nodes.length && i.last.type === 'decl') {
@@ -177,7 +177,7 @@ class Stringifier {
177
177
  return value
178
178
  }
179
179
 
180
- rawEmptyBody (root) {
180
+ rawEmptyBody(root) {
181
181
  let value
182
182
  root.walk(i => {
183
183
  if (i.nodes && i.nodes.length === 0) {
@@ -188,7 +188,7 @@ class Stringifier {
188
188
  return value
189
189
  }
190
190
 
191
- rawIndent (root) {
191
+ rawIndent(root) {
192
192
  if (root.raws.indent) return root.raws.indent
193
193
  let value
194
194
  root.walk(i => {
@@ -205,7 +205,7 @@ class Stringifier {
205
205
  return value
206
206
  }
207
207
 
208
- rawBeforeComment (root, node) {
208
+ rawBeforeComment(root, node) {
209
209
  let value
210
210
  root.walkComments(i => {
211
211
  if (typeof i.raws.before !== 'undefined') {
@@ -224,7 +224,7 @@ class Stringifier {
224
224
  return value
225
225
  }
226
226
 
227
- rawBeforeDecl (root, node) {
227
+ rawBeforeDecl(root, node) {
228
228
  let value
229
229
  root.walkDecls(i => {
230
230
  if (typeof i.raws.before !== 'undefined') {
@@ -243,7 +243,7 @@ class Stringifier {
243
243
  return value
244
244
  }
245
245
 
246
- rawBeforeRule (root) {
246
+ rawBeforeRule(root) {
247
247
  let value
248
248
  root.walk(i => {
249
249
  if (i.nodes && (i.parent !== root || root.first !== i)) {
@@ -260,7 +260,7 @@ class Stringifier {
260
260
  return value
261
261
  }
262
262
 
263
- rawBeforeClose (root) {
263
+ rawBeforeClose(root) {
264
264
  let value
265
265
  root.walk(i => {
266
266
  if (i.nodes && i.nodes.length > 0) {
@@ -277,7 +277,7 @@ class Stringifier {
277
277
  return value
278
278
  }
279
279
 
280
- rawBeforeOpen (root) {
280
+ rawBeforeOpen(root) {
281
281
  let value
282
282
  root.walk(i => {
283
283
  if (i.type !== 'decl') {
@@ -288,7 +288,7 @@ class Stringifier {
288
288
  return value
289
289
  }
290
290
 
291
- rawColon (root) {
291
+ rawColon(root) {
292
292
  let value
293
293
  root.walkDecls(i => {
294
294
  if (typeof i.raws.between !== 'undefined') {
@@ -299,7 +299,7 @@ class Stringifier {
299
299
  return value
300
300
  }
301
301
 
302
- beforeAfter (node, detect) {
302
+ beforeAfter(node, detect) {
303
303
  let value
304
304
  if (node.type === 'decl') {
305
305
  value = this.raw(node, null, 'beforeDecl')
@@ -328,7 +328,7 @@ class Stringifier {
328
328
  return value
329
329
  }
330
330
 
331
- rawValue (node, prop) {
331
+ rawValue(node, prop) {
332
332
  let value = node[prop]
333
333
  let raw = node.raws[prop]
334
334
  if (raw && raw.value === value) {
package/lib/stringify.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  let Stringifier = require('./stringifier')
4
4
 
5
- function stringify (node, builder) {
5
+ function stringify(node, builder) {
6
6
  let str = new Stringifier(builder)
7
7
  str.stringify(node)
8
8
  }
@@ -6,7 +6,7 @@ let tokenizer = require('./tokenize')
6
6
 
7
7
  let Input
8
8
 
9
- function registerInput (dependant) {
9
+ function registerInput(dependant) {
10
10
  Input = dependant
11
11
  }
12
12
 
@@ -28,7 +28,7 @@ const HIGHLIGHT_THEME = {
28
28
  ';': yellow
29
29
  }
30
30
 
31
- function getTokenType ([type, value], processor) {
31
+ function getTokenType([type, value], processor) {
32
32
  if (type === 'word') {
33
33
  if (value[0] === '.') {
34
34
  return 'class'
@@ -47,7 +47,7 @@ function getTokenType ([type, value], processor) {
47
47
  return type
48
48
  }
49
49
 
50
- function terminalHighlight (css) {
50
+ function terminalHighlight(css) {
51
51
  let processor = tokenizer(new Input(css), { ignoreErrors: true })
52
52
  let result = ''
53
53
  while (!processor.endOfFile()) {
package/lib/tokenize.js CHANGED
@@ -25,7 +25,7 @@ const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g
25
25
  const RE_BAD_BRACKET = /.[\n"'(/\\]/
26
26
  const RE_HEX_ESCAPE = /[\da-f]/i
27
27
 
28
- module.exports = function tokenizer (input, options = {}) {
28
+ module.exports = function tokenizer(input, options = {}) {
29
29
  let css = input.css.valueOf()
30
30
  let ignore = options.ignoreErrors
31
31
 
@@ -37,19 +37,19 @@ module.exports = function tokenizer (input, options = {}) {
37
37
  let buffer = []
38
38
  let returned = []
39
39
 
40
- function position () {
40
+ function position() {
41
41
  return pos
42
42
  }
43
43
 
44
- function unclosed (what) {
44
+ function unclosed(what) {
45
45
  throw input.error('Unclosed ' + what, pos)
46
46
  }
47
47
 
48
- function endOfFile () {
48
+ function endOfFile() {
49
49
  return returned.length === 0 && pos >= length
50
50
  }
51
51
 
52
- function nextToken (opts) {
52
+ function nextToken(opts) {
53
53
  if (returned.length) return returned.pop()
54
54
  if (pos >= length) return
55
55
 
@@ -253,7 +253,7 @@ module.exports = function tokenizer (input, options = {}) {
253
253
  return currentToken
254
254
  }
255
255
 
256
- function back (token) {
256
+ function back(token) {
257
257
  returned.push(token)
258
258
  }
259
259
 
package/lib/warn-once.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  let printed = {}
4
4
 
5
- module.exports = function warnOnce (message) {
5
+ module.exports = function warnOnce(message) {
6
6
  if (printed[message]) return
7
7
  printed[message] = true
8
8
 
package/lib/warning.d.ts CHANGED
@@ -89,7 +89,7 @@ export default class Warning {
89
89
  * @param text Warning message.
90
90
  * @param opts Warning options.
91
91
  */
92
- constructor (text: string, opts?: WarningOptions)
92
+ constructor(text: string, opts?: WarningOptions)
93
93
 
94
94
  /**
95
95
  * Returns a warning position and message.
@@ -100,5 +100,5 @@ export default class Warning {
100
100
  *
101
101
  * @return Warning position and message.
102
102
  */
103
- toString (): string
103
+ toString(): string
104
104
  }
package/lib/warning.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  class Warning {
4
- constructor (text, opts = {}) {
4
+ constructor(text, opts = {}) {
5
5
  this.type = 'warning'
6
6
  this.text = text
7
7
 
@@ -14,7 +14,7 @@ class Warning {
14
14
  for (let opt in opts) this[opt] = opts[opt]
15
15
  }
16
16
 
17
- toString () {
17
+ toString() {
18
18
  if (this.node) {
19
19
  return this.node.error(this.text, {
20
20
  plugin: this.plugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.2.8",
3
+ "version": "8.2.9",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -36,7 +36,7 @@
36
36
  "repository": "postcss/postcss",
37
37
  "dependencies": {
38
38
  "colorette": "^1.2.2",
39
- "nanoid": "^3.1.20",
39
+ "nanoid": "^3.1.22",
40
40
  "source-map": "^0.6.1"
41
41
  },
42
42
  "browser": {