Skip to content

Commit 59c9ac7

Browse files
authored
Merge pull request github#15295 from asgerf/js/type-model-export
JS: Include sink nodes as base-case when resolving types
2 parents 8b464fb + 82cee61 commit 59c9ac7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModelsSpecific.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ predicate parseTypeString(string rawType, string package, string qualifiedName)
4848
predicate isPackageUsed(string package) {
4949
exists(DataFlow::moduleImport(package))
5050
or
51+
exists(JS::PackageJson json | json.getPackageName() = package)
52+
or
5153
package = "global"
5254
or
5355
any(DataFlow::SourceNode sn).hasUnderlyingType(package, _)
@@ -124,7 +126,7 @@ API::Node getExtraNodeFromType(string type) {
124126
parseRelevantTypeString(type, package, qualifiedName)
125127
|
126128
qualifiedName = "" and
127-
result = API::moduleImport(package)
129+
result = [API::moduleImport(package), API::moduleExport(package)]
128130
or
129131
// Access instance of a type based on type annotations
130132
result = API::Internal::getANodeOfTypeRaw(package, qualifiedName)

0 commit comments

Comments
 (0)