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

Function areSameModule

test/fixtures/snapshot/typescript.js:141292–141297  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

141290 // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.
141291 // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!
141292 function areSameModule(a, b) {
141293 if (!a.body || !b.body) {
141294 return a.body === b.body;
141295 }
141296 return a.body.kind === b.body.kind && (a.body.kind !== 261 /* SyntaxKind.ModuleDeclaration */ || areSameModule(a.body, b.body));
141297 }
141298 /** Merge source into target. Source should be thrown away after this is called. */
141299 function merge(target, source) {
141300 var _a;

Callers 1

shouldReallyMergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected