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/hash/BatchedHash.js | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/node_modules/webpack/lib/util/hash/BatchedHash.js b/node_modules/webpack/lib/util/hash/BatchedHash.js
index e750125..bbae7ee 100644
--- a/node_modules/webpack/lib/util/hash/BatchedHash.js
+++ b/node_modules/webpack/lib/util/hash/BatchedHash.js
@@ -6,18 +6,24 @@
"use strict";
const Hash = require("../Hash");
+const { digest, update } = require("./hash-digest");
+/** @type {number} */
const MAX_SHORT_STRING = require("./wasm-hash").MAX_SHORT_STRING;
/** @typedef {import("../../../declarations/WebpackOptions").HashDigest} Encoding */
class BatchedHash extends Hash {
/**
+ * Creates an instance of BatchedHash.
* @param {Hash} hash hash
*/
constructor(hash) {
super();
+ /** @type {undefined | string} */
this.string = undefined;
+ /** @type {undefined | Encoding} */
this.encoding = undefined;
+ /** @type {Hash} */
this.hash = hash;
}
@@ -51,9 +57,9 @@
return this;
}
if (this.encoding) {
- this.hash.update(this.string, this.encoding);
+ update(this.hash, this.string, this.encoding);
} else {
- this.hash.update(this.string);
+ update(this.hash, this.string);
}
this.string = undefined;
}
@@ -66,12 +72,12 @@
this.string = data;
this.encoding = inputEncoding;
} else if (inputEncoding) {
- this.hash.update(data, inputEncoding);
+ update(this.hash, data, inputEncoding);
} else {
- this.hash.update(data);
+ update(this.hash, data);
}
} else {
- this.hash.update(data);
+ update(this.hash, data);
}
return this;
}
@@ -95,15 +101,15 @@
digest(encoding) {
if (this.string !== undefined) {
if (this.encoding) {
- this.hash.update(this.string, this.encoding);
+ update(this.hash, this.string, this.encoding);
} else {
- this.hash.update(this.string);
+ update(this.hash, this.string);
}
}
if (!encoding) {
- return this.hash.digest();
+ return digest(this.hash);
}
- return this.hash.digest(encoding);
+ return digest(this.hash, encoding);
}
}
--
Gitblit v1.9.3