MCPcopy
hub / github.com/webpack/webpack / getUsedNamesInScopeInfo

Function getUsedNamesInScopeInfo

lib/util/concatenate.js:235–251  ·  view source on GitHub ↗
(usedNamesInScopeInfo, module, id)

Source from the content-addressed store, hash-verified

233 * @returns {ScopeInfo} info
234 */
235const getUsedNamesInScopeInfo = (usedNamesInScopeInfo, module, id) => {
236 // nested maps avoid building a `${module}-${id}` key string per lookup
237 let byId = usedNamesInScopeInfo.get(module);
238 if (byId === undefined) {
239 byId = new Map();
240 usedNamesInScopeInfo.set(module, byId);
241 }
242 let info = byId.get(id);
243 if (info === undefined) {
244 info = {
245 usedNames: new Set(),
246 alreadyCheckedScopes: new Set()
247 };
248 byId.set(id, info);
249 }
250 return info;
251};
252
253module.exports = {
254 DEFAULT_EXPORT,

Callers 4

codeGenerationMethod · 0.85
_findNewNameMethod · 0.85

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected