MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / propagate

Function propagate

lib/web/CodeMirror/src/model/document_data.js:76–85  ·  view source on GitHub ↗
(doc, skip, sharedHist)

Source from the content-addressed store, hash-verified

74// Call f for all linked documents.
75export function linkedDocs(doc, f, sharedHistOnly) {
76 function propagate(doc, skip, sharedHist) {
77 if (doc.linked) for (let i = 0; i < doc.linked.length; ++i) {
78 let rel = doc.linked[i]
79 if (rel.doc == skip) continue
80 let shared = sharedHist && rel.sharedHist
81 if (sharedHistOnly && !shared) continue
82 f(rel.doc, shared)
83 propagate(rel.doc, doc, shared)
84 }
85 }
86 propagate(doc, null, true)
87}
88

Callers 1

linkedDocsFunction · 0.70

Calls 1

fFunction · 0.50

Tested by

no test coverage detected