Module TypeGraphExport
Wrapper around GraphExport
that also exports information about re-exported types.
JavaScript example 1
For example, suppose shouldContainType("foo")
holds, and the following is the entry point for a package bar
:
// bar.js
module.exports.xxx = require('foo');
then this would generate the following type model:
foo; bar; Member[xxx]
JavaScript example 2
For a more complex case, suppose the following type model exists:
foo.XYZ; foo; Member[x].Member[y].Member[z]
And the package exports something that matches a prefix of the access path above:
module.exports.blah = require('foo').x.y;
This would result in the following type model:
foo.XYZ; bar; Member[blah].Member[z]
Notice that the access path Member[blah].Member[z]
consists of an access path generated from the API
graph, with pieces of the access path from the original type model appended to it.
Import path
import semmle.javascript.frameworks.data.internal.ApiGraphModelsExport
Imports
GraphExport<Locations::Location, ApiGraphs::API::Node, ApiGraphModelsExport::TypeGraphExport::Config> | Module for exporting an arbitrary graph as models-as-data rows. |
Predicates
typeModel | Holds if |