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

Function shouldReallyMerge

test/fixtures/snapshot/typescript.js:141264–141280  ·  view source on GitHub ↗

a and b have the same name, but they may not be mergeable.

(a, b, parent)

Source from the content-addressed store, hash-verified

141262 }
141263 /** a and b have the same name, but they may not be mergeable. */
141264 function shouldReallyMerge(a, b, parent) {
141265 if (a.kind !== b.kind || a.parent !== b.parent && !(isOwnChild(a, parent) && isOwnChild(b, parent))) {
141266 return false;
141267 }
141268 switch (a.kind) {
141269 case 167 /* SyntaxKind.PropertyDeclaration */:
141270 case 169 /* SyntaxKind.MethodDeclaration */:
141271 case 172 /* SyntaxKind.GetAccessor */:
141272 case 173 /* SyntaxKind.SetAccessor */:
141273 return ts.isStatic(a) === ts.isStatic(b);
141274 case 261 /* SyntaxKind.ModuleDeclaration */:
141275 return areSameModule(a, b)
141276 && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b);
141277 default:
141278 return true;
141279 }
141280 }
141281 function isSynthesized(node) {
141282 return !!(node.flags & 8 /* NodeFlags.Synthesized */);
141283 }

Callers 1

tryMergeFunction · 0.85

Calls 3

isOwnChildFunction · 0.85
areSameModuleFunction · 0.85

Tested by

no test coverage detected