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

Predicate NameResolution::nodeRefersToModule

Holds if node is a reference to the given module, or a qualified name rooted in that module.

If qualifiedName is empty, node refers to the module itself.

If mod is the string "global", node refers to a global access path.

Unlike trackModule, this is intended to track uses of external packages.

Import path

import semmle.javascript.internal.NameResolution
predicate nodeRefersToModule(Node node, string mod, string qualifiedName)