Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

workspace-tools

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workspace-tools - npm Package Compare versions

Comparing version 0.7.6 to 0.8.0

lib/__tests__/dependencies.test.d.ts

17

CHANGELOG.json

@@ -5,3 +5,18 @@ {

{
"date": "Tue, 26 May 2020 16:55:38 GMT",
"date": "Fri, 19 Jun 2020 17:53:47 GMT",
"tag": "workspace-tools_v0.8.0",
"version": "0.8.0",
"comments": {
"minor": [
{
"comment": "adding getTransitiveProviders and renamed getTransitiveDependencies to getTransitiveConsumers",
"author": "kchau@microsoft.com",
"commit": "e2148df920bf05ac84425108e0ea3695b0743c9f",
"package": "workspace-tools"
}
]
}
},
{
"date": "Tue, 26 May 2020 16:55:44 GMT",
"tag": "workspace-tools_v0.7.6",

@@ -8,0 +23,0 @@ "version": "0.7.6",

# Change Log - workspace-tools
This log was last generated on Tue, 26 May 2020 16:55:38 GMT and should not be manually modified.
This log was last generated on Fri, 19 Jun 2020 17:53:47 GMT and should not be manually modified.
<!-- Start content -->
## 0.8.0
Fri, 19 Jun 2020 17:53:47 GMT
### Minor changes
- adding getTransitiveProviders and renamed getTransitiveDependencies to getTransitiveConsumers (kchau@microsoft.com)
## 0.7.6
Tue, 26 May 2020 16:55:38 GMT
Tue, 26 May 2020 16:55:44 GMT

@@ -11,0 +19,0 @@ ### Patches

import { PackageInfo, PackageInfos } from "./types/PackageInfo";
export declare function getDependentMap(packages: PackageInfos): Map<string, Set<string>>;
export declare function getTransitiveDependencies(scopedPackages: string[], packages: PackageInfos): string[];
/**
* for a package graph of a->b->c (where b depends on a), transitive consumers of a are b & c and their consumers (or what are the consequences of a)
* @param targets
* @param packages
*/
export declare function getTransitiveConsumers(targets: string[], packages: PackageInfos): string[];
/**
* for a package graph of a->b->c (where b depends on a), transitive providers of c are a & b and their providers (or what is needed to satisfy c)
* @param targets
* @param packages
*/
export declare function getTransitiveProviders(targets: string[], packages: PackageInfos): string[];
/** @deprecated use `getDownstreamDependencies()` instead */
export declare const getTransitiveDependencies: typeof getTransitiveConsumers;
export declare function getInternalDeps(info: PackageInfo, packages: PackageInfos): string[];

@@ -30,5 +30,10 @@ "use strict";

exports.getDependentMap = getDependentMap;
function getTransitiveDependencies(scopedPackages, packages) {
/**
* for a package graph of a->b->c (where b depends on a), transitive consumers of a are b & c and their consumers (or what are the consequences of a)
* @param targets
* @param packages
*/
function getTransitiveConsumers(targets, packages) {
const graph = getPackageGraph(packages);
const pkgQueue = [...scopedPackages];
const pkgQueue = [...targets];
const visited = new Set();

@@ -46,5 +51,30 @@ while (pkgQueue.length > 0) {

}
return [...visited].filter((pkg) => !scopedPackages.includes(pkg));
return [...visited].filter((pkg) => !targets.includes(pkg));
}
exports.getTransitiveDependencies = getTransitiveDependencies;
exports.getTransitiveConsumers = getTransitiveConsumers;
/**
* for a package graph of a->b->c (where b depends on a), transitive providers of c are a & b and their providers (or what is needed to satisfy c)
* @param targets
* @param packages
*/
function getTransitiveProviders(targets, packages) {
const graph = getPackageGraph(packages);
const pkgQueue = [...targets];
const visited = new Set();
while (pkgQueue.length > 0) {
const pkg = pkgQueue.shift();
if (!visited.has(pkg)) {
visited.add(pkg);
for (const [from, to] of graph) {
if (to === pkg) {
pkgQueue.push(from);
}
}
}
}
return [...visited].filter((pkg) => !targets.includes(pkg));
}
exports.getTransitiveProviders = getTransitiveProviders;
/** @deprecated use `getDownstreamDependencies()` instead */
exports.getTransitiveDependencies = getTransitiveConsumers;
function getInternalDeps(info, packages) {

@@ -51,0 +81,0 @@ const deps = Object.keys(Object.assign(Object.assign({}, info.dependencies), info.devDependencies));

2

package.json
{
"name": "workspace-tools",
"version": "0.7.6",
"version": "0.8.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc