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

Function walkLinks

packages/dev/parcel-packager-docs/DocsPackager.js:224–240  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

222 walkLinks(result);
223
224 function walkLinks(obj) {
225 let fn = t => {
226 // don't follow the link if it's already in links, that's circular
227 if (t && t.type === 'link' && !links[t.id]) {
228 links[t.id] = nodes[t.id];
229 recurse(nodes[t.id], fn);
230 }
231
232 if (t != null) {
233 return recurse(t, fn);
234 }
235 };
236
237 for (let k in obj) {
238 fn(obj[k]);
239 }
240 }
241
242 return {contents: JSON.stringify({exports: result, links}, false, 2)};
243 }

Callers 1

packageFunction · 0.85

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected