Skip to content

Commit e99571b

Browse files
asgerferik-krogh
andauthored
Update javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModelsSpecific.qll
Co-authored-by: Erik Krogh Kristensen <[email protected]>
1 parent abf0c0f commit e99571b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ import semmle.javascript.frameworks.data.internal.AccessPathSyntax as AccessPath
3131
import JS::DataFlow as DataFlow
3232
private import AccessPathSyntax
3333

34+
/**
35+
* Holds if `rawType` represents the JavaScript npm `package` with type `qualifiedName`.
36+
* The `qualifiedName` is everything after the first ".".
37+
* So e.g. `rawType = "foo.bar"` will parse to `package = "foo" and qualifiedName = "bar"`.
38+
* `package´ can be enclosed in single-quotes if the package name includes dots,
39+
* e.g. `'my.package'.type` parses to `package = "my.package" and qualifiedName = "type"`.
40+
*/
3441
bindingset[rawType]
3542
predicate parseTypeString(string rawType, string package, string qualifiedName) {
3643
exists(string regexp |

0 commit comments

Comments
 (0)