CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.14 (changelog, source)
Search

Member predicate ReExportDefaultSpecifier::getLocalName

Gets the local name of the exported symbol, that is, the name of the exported local variable, or the imported name in a re-export.

For example, consider these six exports:

export { x }
export { y as z }
export function f() {}
export default 42
export * from 'd'
export default from 'm'

The local names for the first three of them are, respectively, x, y and f; the fourth one exports an un-named value, and hence has no local name; the fifth one does not export a unique name, and hence also does not have a local name.

The sixth one (unlike the fourth one) does have a local name (that is, default), since it is a re-export.

string getLocalName()