MCPcopy Index your code
hub / github.com/nodejs/node / getSomeTargetNameFromDeclarations

Function getSomeTargetNameFromDeclarations

test/fixtures/snapshot/typescript.js:54826–54846  ·  view source on GitHub ↗
(declarations)

Source from the content-addressed store, hash-verified

54824 /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures, true), staticMembers, true), constructors, true), publicProperties, true), privateProperties, true)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags);
54825 }
54826 function getSomeTargetNameFromDeclarations(declarations) {
54827 return ts.firstDefined(declarations, function (d) {
54828 if (ts.isImportSpecifier(d) || ts.isExportSpecifier(d)) {
54829 return ts.idText(d.propertyName || d.name);
54830 }
54831 if (ts.isBinaryExpression(d) || ts.isExportAssignment(d)) {
54832 var expression = ts.isExportAssignment(d) ? d.expression : d.right;
54833 if (ts.isPropertyAccessExpression(expression)) {
54834 return ts.idText(expression.name);
54835 }
54836 }
54837 if (isAliasSymbolDeclaration(d)) {
54838 // This is... heuristic, at best. But it's probably better than always printing the name of the shorthand ambient module.
54839 var name = ts.getNameOfDeclaration(d);
54840 if (name && ts.isIdentifier(name)) {
54841 return ts.idText(name);
54842 }
54843 }
54844 return undefined;
54845 });
54846 }
54847 function serializeAsAlias(symbol, localName, modifierFlags) {
54848 var _a, _b, _c, _d, _e;
54849 // synthesize an alias, eg `export { symbolName as Name }`

Callers 1

serializeAsAliasFunction · 0.85

Calls 1

isAliasSymbolDeclarationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…