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

Predicate parseTypeString

Holds if rawType represents the JavaScript type qualifiedName from the given NPM package.

Type names have form package.type or just package if referring to the package export object. If package contains a . character it must be enclosed in single quotes, such as 'package'.type.

A type name of form (package) may also be used when refering to the package export object. We allow this syntax as an alternative to the above, so models generated based on EndpointNaming look more consistent. However, access paths are deliberately not parsed here, as we can not handle aliasing at this stage. The model generator must explicitly generate the step between (package) and (package).foo, for example.

Import path

import semmle.javascript.frameworks.data.internal.ApiGraphModelsSpecific
predicate parseTypeString(string rawType, string package, string qualifiedName)