postcss 8.3.9 → 8.3.10

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.

@@ -48,23 +48,21 @@ class PreviousMap {
48
48
  }
49
49
 
50
50
  getAnnotationURL(sourceMapString) {
51
- return sourceMapString
52
- .match(/\/\*\s*# sourceMappingURL=((?:(?!sourceMappingURL=).)*)\*\//)[1]
53
- .trim()
51
+ console.log(sourceMapString)
52
+ return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim()
54
53
  }
55
54
 
56
55
  loadAnnotation(css) {
57
- let annotations = css.match(
58
- /\/\*\s*# sourceMappingURL=(?:(?!sourceMappingURL=).)*\*\//gm
59
- )
56
+ let comments = css.match(/\/\*\s*# sourceMappingURL=/gm)
57
+ if (!comments) return
60
58
 
61
- if (annotations && annotations.length > 0) {
62
- // Locate the last sourceMappingURL to avoid picking up
63
- // sourceMappingURLs from comments, strings, etc.
64
- let lastAnnotation = annotations[annotations.length - 1]
65
- if (lastAnnotation) {
66
- this.annotation = this.getAnnotationURL(lastAnnotation)
67
- }
59
+ // sourceMappingURLs from comments, strings, etc.
60
+ let start = css.lastIndexOf(comments.pop())
61
+ let end = css.indexOf('*/', start)
62
+
63
+ if (start > -1 && end > -1) {
64
+ // Locate the last sourceMappingURL to avoid pickin
65
+ this.annotation = this.getAnnotationURL(css.substring(start, end))
68
66
  }
69
67
  }
70
68
 
package/lib/processor.js CHANGED
@@ -6,7 +6,7 @@ let Root = require('./root')
6
6
 
7
7
  class Processor {
8
8
  constructor(plugins = []) {
9
- this.version = '8.3.9'
9
+ this.version = '8.3.10'
10
10
  this.plugins = this.normalize(plugins)
11
11
  }
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.3.9",
3
+ "version": "8.3.10",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -64,8 +64,8 @@
64
64
  "url": "https://github.com/postcss/postcss/issues"
65
65
  },
66
66
  "dependencies": {
67
- "nanoid": "^3.1.28",
68
- "picocolors": "^0.2.1",
67
+ "nanoid": "^3.1.30",
68
+ "picocolors": "^1.0.0",
69
69
  "source-map-js": "^0.6.2"
70
70
  },
71
71
  "browser": {