MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getUsedLinks

Function getUsedLinks

packages/dev/docs/src/utils.js:30–42  ·  view source on GitHub ↗
(obj, links, usedLinks = {})

Source from the content-addressed store, hash-verified

28}
29
30export 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
44const BASE_URL = {
45 dev: {

Callers 2

types.jsFile · 0.90
TypeLinkFunction · 0.90

Calls 2

walkFunction · 0.70
recurseFunction · 0.70

Tested by

no test coverage detected