postcss 8.4.31 → 8.4.49

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/rule.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- import Container, { ContainerProps } from './container.js'
1
+ import Container, {
2
+ ContainerProps,
3
+ ContainerWithChildren
4
+ } from './container.js'
2
5
 
3
6
  declare namespace Rule {
4
7
  export interface RuleRaws extends Record<string, unknown> {
@@ -37,14 +40,21 @@ declare namespace Rule {
37
40
  semicolon?: boolean
38
41
  }
39
42
 
40
- export interface RuleProps extends ContainerProps {
43
+ export type RuleProps = {
41
44
  /** Information used to generate byte-to-byte equal node string as it was in the origin input. */
42
45
  raws?: RuleRaws
43
- /** Selector or selectors of the rule. */
44
- selector?: string
45
- /** Selectors of the rule represented as an array of strings. */
46
- selectors?: string[]
47
- }
46
+ } & (
47
+ | {
48
+ /** Selector or selectors of the rule. */
49
+ selector: string
50
+ selectors?: never
51
+ }
52
+ | {
53
+ selector?: never
54
+ /** Selectors of the rule represented as an array of strings. */
55
+ selectors: readonly string[]
56
+ }
57
+ ) & ContainerProps
48
58
 
49
59
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
50
60
  export { Rule_ as default }
@@ -69,8 +79,18 @@ declare namespace Rule {
69
79
  * ```
70
80
  */
71
81
  declare class Rule_ extends Container {
72
- parent: Container | undefined
82
+ nodes: NonNullable<Container['nodes']>
83
+ parent: ContainerWithChildren | undefined
73
84
  raws: Rule.RuleRaws
85
+ type: 'rule'
86
+ constructor(defaults?: Rule.RuleProps)
87
+
88
+ assign(overrides: object | Rule.RuleProps): this
89
+ clone(overrides?: Partial<Rule.RuleProps>): this
90
+
91
+ cloneAfter(overrides?: Partial<Rule.RuleProps>): this
92
+
93
+ cloneBefore(overrides?: Partial<Rule.RuleProps>): this
74
94
  /**
75
95
  * The rule’s full selector represented as a string.
76
96
  *
@@ -80,8 +100,8 @@ declare class Rule_ extends Container {
80
100
  * rule.selector //=> 'a, b'
81
101
  * ```
82
102
  */
83
- selector: string
84
-
103
+ get selector(): string
104
+ set selector(value: string)
85
105
  /**
86
106
  * An array containing the rule’s individual selectors.
87
107
  * Groups of selectors are split at commas.
@@ -97,15 +117,8 @@ declare class Rule_ extends Container {
97
117
  * rule.selector //=> 'a, strong'
98
118
  * ```
99
119
  */
100
- selectors: string[]
101
-
102
- type: 'rule'
103
-
104
- constructor(defaults?: Rule.RuleProps)
105
- assign(overrides: object | Rule.RuleProps): this
106
- clone(overrides?: Partial<Rule.RuleProps>): Rule
107
- cloneAfter(overrides?: Partial<Rule.RuleProps>): Rule
108
- cloneBefore(overrides?: Partial<Rule.RuleProps>): Rule
120
+ get selectors(): string[]
121
+ set selectors(values: string[])
109
122
  }
110
123
 
111
124
  declare class Rule extends Rule_ {}
package/lib/tokenize.js CHANGED
@@ -29,8 +29,8 @@ module.exports = function tokenizer(input, options = {}) {
29
29
  let css = input.css.valueOf()
30
30
  let ignore = options.ignoreErrors
31
31
 
32
- let code, next, quote, content, escape
33
- let escaped, escapePos, prev, n, currentToken
32
+ let code, content, escape, next, quote
33
+ let currentToken, escaped, escapePos, n, prev
34
34
 
35
35
  let length = css.length
36
36
  let pos = 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.4.31",
3
+ "version": "8.4.49",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -74,9 +74,9 @@
74
74
  "url": "https://github.com/postcss/postcss/issues"
75
75
  },
76
76
  "dependencies": {
77
- "nanoid": "^3.3.6",
78
- "picocolors": "^1.0.0",
79
- "source-map-js": "^1.0.2"
77
+ "nanoid": "^3.3.7",
78
+ "picocolors": "^1.1.1",
79
+ "source-map-js": "^1.2.1"
80
80
  },
81
81
  "browser": {
82
82
  "./lib/terminal-highlight": false,