feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -36,7 +36,7 @@ const getConnectionsByOriginModule = set => {
/** @type {Module | 0} */
let lastModule = 0;
/** @type {ModuleGraphConnection[] | undefined} */
let lastList = undefined;
let lastList;
for (const connection of set) {
const { originModule } = connection;
if (lastModule === originModule) {
@@ -67,7 +67,7 @@ const getConnectionsByModule = set => {
/** @type {Module | 0} */
let lastModule = 0;
/** @type {ModuleGraphConnection[] | undefined} */
let lastList = undefined;
let lastList;
for (const connection of set) {
const { module } = connection;
if (lastModule === module) {
@@ -445,7 +445,7 @@ class ModuleGraph {
}
}
this._dependencyMap.set(dependency, null);
return undefined;
return;
}
return connection === null ? undefined : connection;
}
@@ -851,12 +851,13 @@ class ModuleGraph {
const moduleGraph = moduleGraphForModuleMap.get(module);
if (!moduleGraph)
throw new Error(
deprecateMessage +
"There was no ModuleGraph assigned to the Module for backward-compat (Use the new API)"
`${
deprecateMessage
}There was no ModuleGraph assigned to the Module for backward-compat (Use the new API)`
);
return moduleGraph;
},
deprecateMessage + ": Use new ModuleGraph API",
`${deprecateMessage}: Use new ModuleGraph API`,
deprecationCode
);
deprecateMap.set(deprecateMessage, newFn);