summaryrefslogtreecommitdiff
path: root/node_modules/postcss/lib/previous-map.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
commitefbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch)
tree2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/postcss/lib/previous-map.js
parent43acceb75957c880a5ba5a31aae221394a36d5f6 (diff)
node fixes, updates
Diffstat (limited to 'node_modules/postcss/lib/previous-map.js')
-rw-r--r--node_modules/postcss/lib/previous-map.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/node_modules/postcss/lib/previous-map.js b/node_modules/postcss/lib/previous-map.js
index f3093dfb..8eba9ad7 100644
--- a/node_modules/postcss/lib/previous-map.js
+++ b/node_modules/postcss/lib/previous-map.js
@@ -41,12 +41,14 @@ class PreviousMap {
let charsetUri = /^data:application\/json;charset=utf-?8,/
let uri = /^data:application\/json,/
- if (charsetUri.test(text) || uri.test(text)) {
- return decodeURIComponent(text.substr(RegExp.lastMatch.length))
+ let uriMatch = text.match(charsetUri) || text.match(uri)
+ if (uriMatch) {
+ return decodeURIComponent(text.substr(uriMatch[0].length))
}
- if (baseCharsetUri.test(text) || baseUri.test(text)) {
- return fromBase64(text.substr(RegExp.lastMatch.length))
+ let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri)
+ if (baseUriMatch) {
+ return fromBase64(text.substr(baseUriMatch[0].length))
}
let encoding = text.match(/data:application\/json;([^,]+),/)[1]
@@ -67,7 +69,7 @@ class PreviousMap {
}
loadAnnotation(css) {
- let comments = css.match(/\/\*\s*# sourceMappingURL=/gm)
+ let comments = css.match(/\/\*\s*# sourceMappingURL=/g)
if (!comments) return
// sourceMappingURLs from comments, strings, etc.