From 9bce51f651aad297ef9eb6df832bfdaf1de05d84 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 14:27:54 +0800
Subject: [PATCH] 青岛推送

---
 node_modules/webpack/lib/util/extractSourceMap.js |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/node_modules/webpack/lib/util/extractSourceMap.js b/node_modules/webpack/lib/util/extractSourceMap.js
index 6b68ca7..de80d40 100644
--- a/node_modules/webpack/lib/util/extractSourceMap.js
+++ b/node_modules/webpack/lib/util/extractSourceMap.js
@@ -10,18 +10,13 @@
 const { isAbsolute, join } = require("./fs");
 
 /** @typedef {import("./fs").InputFileSystem} InputFileSystem */
-
-/**
- * @typedef {(input: string | Buffer<ArrayBufferLike>, resourcePath: string, fs: InputFileSystem) => Promise<{source: string | Buffer<ArrayBufferLike>, sourceMap: string | RawSourceMap | undefined, fileDependencies: string[]}>} SourceMapExtractorFunction
- */
-
+/** @typedef {string | Buffer<ArrayBufferLike>} StringOrBuffer */
+/** @typedef {(input: StringOrBuffer, resourcePath: string, fs: InputFileSystem) => Promise<{ source: StringOrBuffer, sourceMap: string | RawSourceMap | undefined, fileDependencies: string[] }>} SourceMapExtractorFunction */
 /** @typedef {import("webpack-sources").RawSourceMap} RawSourceMap */
+/** @typedef {(resourcePath: string) => Promise<StringOrBuffer>} ReadResource */
 
 /**
- * @typedef {(resourcePath: string) => Promise<string | Buffer<ArrayBufferLike>>} ReadResource
- */
-
-/**
+ * Defines the source mapping url type used by this module.
  * @typedef {object} SourceMappingURL
  * @property {string} sourceMappingURL
  * @property {string} replacementString
@@ -52,6 +47,7 @@
  */
 function getSourceMappingURL(code) {
 	const lines = code.split(/^/m);
+	/** @type {RegExpMatchArray | null | undefined} */
 	let match;
 
 	for (let i = lines.length - 1; i >= 0; i--) {
@@ -104,13 +100,14 @@
  * @param {ReadResource} readResource read resource function
  * @param {string[]} possibleRequests array of possible file paths
  * @param {string} errorsAccumulator accumulated error messages
- * @returns {Promise<{path: string, data?: string}>} source content promise
+ * @returns {Promise<{ path: string, data?: string }>} source content promise
  */
 async function fetchPathsFromURL(
 	readResource,
 	possibleRequests,
 	errorsAccumulator = ""
 ) {
+	/** @type {StringOrBuffer} */
 	let result;
 
 	try {
@@ -146,7 +143,7 @@
  * @param {string} url source URL
  * @param {string=} sourceRoot source root directory
  * @param {boolean=} skipReading whether to skip reading file content
- * @returns {Promise<{sourceURL: string, sourceContent?: string | Buffer<ArrayBufferLike>}>} source content promise
+ * @returns {Promise<{ sourceURL: string, sourceContent?: StringOrBuffer }>} source content promise
  */
 async function fetchFromURL(
 	readResource,
@@ -181,9 +178,11 @@
 	if (isAbsolute(url)) {
 		let sourceURL = path.normalize(url);
 
+		/** @type {undefined | StringOrBuffer} */
 		let sourceContent;
 
 		if (!skipReading) {
+			/** @type {string[]} */
 			const possibleRequests = [sourceURL];
 
 			if (url.startsWith("/")) {
@@ -203,6 +202,7 @@
 
 	// 4. Relative path
 	const sourceURL = getAbsolutePath(context, url, sourceRoot || "");
+	/** @type {undefined | StringOrBuffer} */
 	let sourceContent;
 
 	if (!skipReading) {
@@ -214,10 +214,10 @@
 
 /**
  * Extract source map from code content
- * @param {string | Buffer<ArrayBufferLike>} stringOrBuffer The input code content as string or buffer
+ * @param {StringOrBuffer} stringOrBuffer The input code content as string or buffer
  * @param {string} resourcePath The path to the resource file
  * @param {ReadResource} readResource The read resource function
- * @returns {Promise<{source: string | Buffer<ArrayBufferLike>, sourceMap: string | RawSourceMap | undefined}>} Promise resolving to extracted source map information
+ * @returns {Promise<{ source: StringOrBuffer, sourceMap: string | RawSourceMap | undefined }>} Promise resolving to extracted source map information
  */
 async function extractSourceMap(stringOrBuffer, resourcePath, readResource) {
 	const input =

--
Gitblit v1.9.3