Skip to content

Commit 85d805d

Browse files
cmrnclshortfuse
authored andcommitted
add type to missingSupportCache
1 parent 010ce5c commit 85d805d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/BrowserSelection.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default class BrowserSelection {
166166
return result;
167167
}
168168

169-
/** @readonly */
169+
/** @type {Map<string, MissingSupportResult>} @readonly */
170170
static #missingSupportCache = new Map();
171171

172172
/**
@@ -179,7 +179,7 @@ export default class BrowserSelection {
179179
// browserslist only uses `path` if `query` is not provided.
180180
const key = query ? JSON.stringify(query) : path;
181181

182-
if (this.#missingSupportCache.has(key)) {
182+
if (key && this.#missingSupportCache.has(key)) {
183183
return this.#missingSupportCache.get(key);
184184
}
185185

@@ -188,7 +188,7 @@ export default class BrowserSelection {
188188
browsers: selection.list(),
189189
features: selection.compileBrowserSupport(),
190190
};
191-
this.#missingSupportCache.set(key, result);
191+
if (key) this.#missingSupportCache.set(key, result);
192192
return result;
193193
}
194194
}

0 commit comments

Comments
 (0)