ConnectedFiles returns all files connected to the given file (imports + importers)
(path string)
| 360 | |
| 361 | // ConnectedFiles returns all files connected to the given file (imports + importers) |
| 362 | func (fg *FileGraph) ConnectedFiles(path string) []string { |
| 363 | seen := make(map[string]bool) |
| 364 | |
| 365 | for _, f := range fg.Imports[path] { |
| 366 | seen[f] = true |
| 367 | } |
| 368 | for _, f := range fg.Importers[path] { |
| 369 | seen[f] = true |
| 370 | } |
| 371 | |
| 372 | var result []string |
| 373 | for f := range seen { |
| 374 | if f != path { |
| 375 | result = append(result, f) |
| 376 | } |
| 377 | } |
| 378 | return result |
| 379 | } |
| 380 | |
| 381 | // tsConfig represents the structure of tsconfig.json we care about |
| 382 | type tsConfig struct { |
no outgoing calls