Skip to content

Commit 82d4672

Browse files
committed
fix(pnpm): hotfix for empty component_name
1 parent 9a90356 commit 82d4672

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

module/pnpm/pnpm.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,22 @@ func (Inspector) InspectProject(ctx context.Context) error {
4444
module.ModuleName = fmt.Sprintf("<pnpm-module>/%s", tree.Name)
4545
module.ModulePath = filepath.Join(dir, tree.Name, "<pnpm-module>")
4646
}
47+
// hotfix for empty string
48+
replaceEmptyString(module.Dependencies)
4749
inspectionTask.AddModule(module)
4850
}
49-
5051
return nil
5152
}
5253

54+
func replaceEmptyString(input []model.DependencyItem) {
55+
for i := range input {
56+
if input[i].CompName == "" {
57+
input[i].CompName = "_"
58+
}
59+
replaceEmptyString(input[i].Dependencies)
60+
}
61+
}
62+
5363
func (Inspector) SupportFeature(feature model.InspectorFeature) bool {
5464
return model.InspectorFeatureAllowNested&feature > 0
5565
}

0 commit comments

Comments
 (0)