Skip to content

Commit

Permalink
pnp: remove unused dependencyTreeRoots data
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Aug 14, 2022
1 parent 44a7a61 commit 8a71011
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions internal/resolver/yarnpnp.go
Expand Up @@ -15,11 +15,6 @@ import (
// This file implements the Yarn PnP specification: https://yarnpkg.com/advanced/pnp-spec/

type pnpData struct {
// A list of package locators that are roots of the dependency tree. There
// will typically be one entry for each workspace in the project (always at
// least one, as the top-level package is a workspace by itself).
dependencyTreeRoots map[string]string

// Keys are the package idents, values are sets of references. Combining the
// ident with each individual reference yields the set of affected locators.
fallbackExclusionList map[string]map[string]bool
Expand Down Expand Up @@ -394,24 +389,6 @@ func compileYarnPnPData(absPath string, absDirPath string, json js_ast.Expr) *pn
absDirPath: absDirPath,
}

if value, _, ok := getProperty(json, "dependencyTreeRoots"); ok {
if array, ok := value.Data.(*js_ast.EArray); ok {
data.dependencyTreeRoots = make(map[string]string, len(array.Items))

for _, item := range array.Items {
if name, _, ok := getProperty(item, "name"); ok {
if reference, _, ok := getProperty(item, "reference"); ok {
if name, ok := getString(name); ok {
if reference, ok := getString(reference); ok {
data.dependencyTreeRoots[name] = reference
}
}
}
}
}
}
}

if value, _, ok := getProperty(json, "enableTopLevelFallback"); ok {
if enableTopLevelFallback, ok := getBool(value); ok {
data.enableTopLevelFallback = enableTopLevelFallback
Expand Down

0 comments on commit 8a71011

Please sign in to comment.