| 236 | // takes an interface name and follows all the interfaces dependencies to |
| 237 | // see if the interface changed as a result of a dependency changing |
| 238 | function followInvertedDependencies(iname, deps) { |
| 239 | let visited = new Set(); |
| 240 | let affectedInterfaces = []; |
| 241 | function visit(iname) { |
| 242 | if (visited.has(iname)) { |
| 243 | return; |
| 244 | } |
| 245 | visited.add(iname); |
| 246 | if (deps.has(iname)) { |
| 247 | let affected = deps.get(iname); |
| 248 | if (affected && affected.length > 0) { |
| 249 | for (let dep of affected) { |
| 250 | affectedInterfaces.push(dep); |
| 251 | visit(dep); |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | visit(iname); |
| 257 | return affectedInterfaces; |
| 258 | } |
| 259 | |
| 260 | function getAPI(filePath) { |
| 261 | let json = readJsonSync(filePath); |