(obj, links, usedLinks = {})
| 28 | } |
| 29 | |
| 30 | export function getUsedLinks(obj, links, usedLinks = {}) { |
| 31 | walk(obj, (t, k, recurse) => { |
| 32 | // don't follow the link if it's already in links, that's circular |
| 33 | if (t && t.type === 'link' && !usedLinks[t.id]) { |
| 34 | usedLinks[t.id] = links[t.id]; |
| 35 | getUsedLinks(links[t.id], links, usedLinks); |
| 36 | } |
| 37 | |
| 38 | return recurse(t); |
| 39 | }); |
| 40 | |
| 41 | return usedLinks; |
| 42 | } |
| 43 | |
| 44 | const BASE_URL = { |
| 45 | dev: { |