From 6529f8c789306a26c4883c3efc33c9ea7e504b5a Mon Sep 17 00:00:00 2001 From: hai-x <98948357+hai-x@users.noreply.github.com> Date: Mon, 8 Sep 2025 19:58:12 +0800 Subject: [PATCH] fix: type (#19881) --- lib/cache/PackFileCacheStrategy.js | 10 ++++++++++ lib/serialization/SerializerMiddleware.js | 4 +--- lib/util/StackedCacheMap.js | 2 -- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/cache/PackFileCacheStrategy.js b/lib/cache/PackFileCacheStrategy.js index 779c54aec..e88cee53a 100644 --- a/lib/cache/PackFileCacheStrategy.js +++ b/lib/cache/PackFileCacheStrategy.js @@ -53,10 +53,15 @@ class PackContainer { ) { /** @type {Pack | (() => Pack) } */ this.data = data; + /** @type {string} */ this.version = version; + /** @type {Snapshot} */ this.buildSnapshot = buildSnapshot; + /** @type {BuildDependencies} */ this.buildDependencies = buildDependencies; + /** @type {ResolveResults} */ this.resolveResults = resolveResults; + /** @type {Snapshot} */ this.resolveBuildDependenciesSnapshot = resolveBuildDependenciesSnapshot; } @@ -105,10 +110,15 @@ class PackItemInfo { * @param {Data} value fresh value of item */ constructor(identifier, etag, value) { + /** @type {string} */ this.identifier = identifier; + /** @type {string | null | undefined} */ this.etag = etag; + /** @type {number} */ this.location = -1; + /** @type {number} */ this.lastAccess = Date.now(); + /** @type {Data} */ this.freshValue = value; } } diff --git a/lib/serialization/SerializerMiddleware.js b/lib/serialization/SerializerMiddleware.js index 91e8bdff9..4b2507c0e 100644 --- a/lib/serialization/SerializerMiddleware.js +++ b/lib/serialization/SerializerMiddleware.js @@ -96,7 +96,6 @@ class SerializerMiddleware { * @template TLazyOutputValue * @template {LazyTarget} TLazyTarget * @template {Record} TLazyOptions - * @template TLazySerializedValue * @param {LazyFunction} fn lazy function * @returns {LazyOptions | undefined} options */ @@ -123,7 +122,7 @@ class SerializerMiddleware { * @template TLazyOutputValue * @template {LazyTarget} TLazyTarget * @template {LazyOptions} TLazyOptions - * @param {LazyFunction} fn lazy function + * @param {LazyFunction} fn lazy function * @param {TLazyOutputValue} value serialized value * @returns {void} */ @@ -168,7 +167,6 @@ class SerializerMiddleware { /** * @template TLazyInputValue SerializedValue * @template TLazyOutputValue DeserializedValue - * @template SerializedValue * @template {LazyTarget} TLazyTarget * @template {LazyOptions | undefined} TLazyOptions * @param {LazyFunction} lazy lazy function diff --git a/lib/util/StackedCacheMap.js b/lib/util/StackedCacheMap.js index 781aa86d6..ad7cc69c7 100644 --- a/lib/util/StackedCacheMap.js +++ b/lib/util/StackedCacheMap.js @@ -5,8 +5,6 @@ "use strict"; -new Map().entries(); - /** * The StackedCacheMap is a data structure designed as an alternative to a Map * in situations where you need to handle multiple item additions and