MCPcopy Create free account
hub / github.com/nodejs/node / merge

Function merge

test/fixtures/snapshot/typescript.js:141299–141311  ·  view source on GitHub ↗

Merge source into target. Source should be thrown away after this is called.

(target, source)

Source from the content-addressed store, hash-verified

141297 }
141298 /** Merge source into target. Source should be thrown away after this is called. */
141299 function merge(target, source) {
141300 var _a;
141301 target.additionalNodes = target.additionalNodes || [];
141302 target.additionalNodes.push(source.node);
141303 if (source.additionalNodes) {
141304 (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);
141305 }
141306 target.children = ts.concatenate(target.children, source.children);
141307 if (target.children) {
141308 mergeChildren(target.children, target);
141309 sortChildren(target.children);
141310 }
141311 }
141312 /** Recursively ensure that each NavNode's children are in sorted order. */
141313 function sortChildren(children) {
141314 children.sort(compareChildren);

Callers 15

markedFunction · 0.70
marked.jsFile · 0.70
tryMergeFunction · 0.70
testMergeTwoSourcesFunction · 0.50
testMergeSingleSourceFunction · 0.50
testMergeEmptyFunction · 0.50
testMergeWithAbortSignalFunction · 0.50
testMergeSyncSourcesFunction · 0.50
testMergeSourceErrorFunction · 0.50
testMergeConsumerBreakFunction · 0.50
testMergeStringSourcesFunction · 0.50

Calls 4

mergeChildrenFunction · 0.85
sortChildrenFunction · 0.85
pushMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected