Skip to content

Instantly share code, notes, and snippets.

@arcanis
Created July 26, 2019 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arcanis/eae0223f341072e7992b415d7e0cdad8 to your computer and use it in GitHub Desktop.
Save arcanis/eae0223f341072e7992b415d7e0cdad8 to your computer and use it in GitHub Desktop.
const locator = structUtils.makeLocator(`debug`, `npm:1.0.0`);
for (const pkg of project.storedPackages) {
const dependencies = Array.from(pkg.dependencies.values());
const isDependent = dependencies.some(dependency => {
const resolution = project.storedResolutions.get(dependency.descriptorHash)!;
return resolution === locator.locatorHash;
});
if (isDependent) {
console.log(`- ${structUtils.stringifyLocator(pkg)}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment