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

Function isOwnChild

test/fixtures/snapshot/typescript.js:141286–141289  ·  view source on GitHub ↗
(n, parent)

Source from the content-addressed store, hash-verified

141284 // We want to merge own children like `I` in in `module A { interface I {} } module A { interface I {} }`
141285 // We don't want to merge unrelated children like `m` in `const o = { a: { m() {} }, b: { m() {} } };`
141286 function isOwnChild(n, parent) {
141287 var par = ts.isModuleBlock(n.parent) ? n.parent.parent : n.parent;
141288 return par === parent.node || ts.contains(parent.additionalNodes, par);
141289 }
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) {

Callers 1

shouldReallyMergeFunction · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected