By which I mean, when npm decides it needs to upgrade an existing module, this changes how it does that. This applies to both npm install foo@newversion and updating a package.json and running npm install. In either case, it does a better job of cleaning out the older deps, which means that the resulting tree is flatter!
npm install foo@newversion
See also #9633.
I don't feel like this got enough of a review, so I'm pushing it out a week. Plus CI was being weird with it and that concerns me.
deps: Refactor module matchers into stand alone functions
deps: When we replace/upgrade a dep, remove all its deps too
deps: Move adding of modules to sets of modules into a function
deps: Move adding to a set of module names to a function
This landed in 3.3.10