From efbc2ffe6a1ee5ec38a4396305561d6515d0943e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 30 Aug 2024 17:21:18 +0800 Subject: node fixes, updates --- node_modules/postcss/lib/previous-map.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'node_modules/postcss/lib/previous-map.js') 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. -- cgit v1.2.3