MCPcopy
hub / github.com/webpack/webpack / removeConnection

Method removeConnection

lib/ModuleGraph.js:384–396  ·  lib/ModuleGraph.js::ModuleGraph.removeConnection

* Removes connection. * @param {Dependency} dependency the referencing dependency * @returns {void}

(dependency)

Source from the content-addressed store, hash-verified

382 * @returns {void}
383 */
384 removeConnection(dependency) {
385 const connection =
386 /** @type {ModuleGraphConnection} */
387 (this.getConnection(dependency));
388 const targetMgm = this._getModuleGraphModule(connection.module);
389 targetMgm.incomingConnections.delete(connection);
390 const originMgm = this._getModuleGraphModule(
391 /** @type {Module} */ (connection.originModule)
392 );
393 /** @type {OutgoingConnections} */
394 (originMgm.outgoingConnections).delete(connection);
395 this._dependencyMap.set(dependency, null);
396 }
397
398 /**
399 * Adds the provided dependency to the module graph.

Callers 1

Calls 4

getConnectionMethod · 0.95
_getModuleGraphModuleMethod · 0.95
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected