postcss 8.4.20 → 8.4.21

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/input.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ProcessOptions } from './postcss.js'
1
+ import { CssSyntaxError, ProcessOptions } from './postcss.js'
2
2
  import PreviousMap from './previous-map.js'
3
3
 
4
4
  export interface FilePosition {
@@ -147,4 +147,39 @@ export default class Input {
147
147
  * @param offset Source offset.
148
148
  */
149
149
  fromOffset(offset: number): { line: number; col: number } | null
150
+
151
+ /**
152
+ * Returns `CssSyntaxError` with information about the error and its position.
153
+ */
154
+ error(
155
+ message: string,
156
+ line: number,
157
+ column: number,
158
+ opts?: { plugin?: CssSyntaxError['plugin'] }
159
+ ): CssSyntaxError
160
+ error(
161
+ message: string,
162
+ offset: number,
163
+ opts?: { plugin?: CssSyntaxError['plugin'] }
164
+ ): CssSyntaxError
165
+ error(
166
+ message: string,
167
+ start:
168
+ | {
169
+ offset: number
170
+ }
171
+ | {
172
+ line: number
173
+ column: number
174
+ },
175
+ end:
176
+ | {
177
+ offset: number
178
+ }
179
+ | {
180
+ line: number
181
+ column: number
182
+ },
183
+ opts?: { plugin?: CssSyntaxError['plugin'] }
184
+ ): CssSyntaxError
150
185
  }
package/lib/input.js CHANGED
@@ -108,7 +108,7 @@ class Input {
108
108
  if (line && typeof line === 'object') {
109
109
  let start = line
110
110
  let end = column
111
- if (typeof line.offset === 'number') {
111
+ if (typeof start.offset === 'number') {
112
112
  let pos = this.fromOffset(start.offset)
113
113
  line = pos.line
114
114
  column = pos.col
package/lib/processor.js CHANGED
@@ -7,7 +7,7 @@ let Root = require('./root')
7
7
 
8
8
  class Processor {
9
9
  constructor(plugins = []) {
10
- this.version = '8.4.20'
10
+ this.version = '8.4.21'
11
11
  this.plugins = this.normalize(plugins)
12
12
  }
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.4.20",
3
+ "version": "8.4.21",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"