Socket
Socket
Sign inDemoInstall

@lerna/package-graph

Package Overview
Dependencies
2
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-beta.14 to 3.0.0-beta.18

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

<a name="3.0.0-beta.18"></a>
# [3.0.0-beta.18](https://github.com/lerna/lerna/compare/v3.0.0-beta.17...v3.0.0-beta.18) (2018-04-24)
### Features
* **filters:** Add `--include-filtered-dependents` flag ([#1393](https://github.com/lerna/lerna/issues/1393)) ([2838260](https://github.com/lerna/lerna/commit/2838260))
<a name="3.0.0-beta.14"></a>

@@ -8,0 +20,0 @@ # [3.0.0-beta.14](https://github.com/lerna/lerna/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2018-04-03)

29

index.js

@@ -110,4 +110,29 @@ "use strict";

addDependencies(filteredPackages) {
return this.extendList(filteredPackages, "localDependencies");
}
/**
* Takes a list of Packages and returns a list of those same Packages with any Packages
* that depend on them. i.e if packageC depended on packageD `graph.addDependents([packageD])`
* would return [packageD, packageC].
*
* @param {!Array.<Package>} filteredPackages The packages to include dependents for.
* @return {Array.<Package>} The packages with any dependents that weren't already included.
*/
addDependents(filteredPackages) {
return this.extendList(filteredPackages, "localDependents");
}
/**
* Extends a list of packages by traversing on a given property, which must refer to a
* `PackageGraphNode` property that is a collection of `PackageGraphNode`s
*
* @param {!Array.<Package>} packageList The list of packages to extend
* @param {!String} nodeProp The property on `PackageGraphNode` used to traverse
* @return {Array.<Package>} The packages with any additional packages found by traversing
* nodeProp
*/
extendList(packageList, nodeProp) {
// the current list of packages we are expanding using breadth-first-search
const search = new Set(filteredPackages.map(({ name }) => this.get(name)));
const search = new Set(packageList.map(({ name }) => this.get(name)));

@@ -121,3 +146,3 @@ // an intermediate list of matched PackageGraphNodes

currentNode.localDependencies.forEach((meta, depName) => {
currentNode[nodeProp].forEach((meta, depName) => {
const depNode = this.get(depName);

@@ -124,0 +149,0 @@

4

package.json
{
"name": "@lerna/package-graph",
"version": "3.0.0-beta.14",
"version": "3.0.0-beta.18",
"description": "TODO",

@@ -36,3 +36,3 @@ "keywords": [

},
"gitHead": "4c4aceee84b39eb399e968a0c87241ee59edce4f"
"gitHead": "7995561e8d010d9fa2e59109b57b9ad8573baba1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc