mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Merge pull request #11906 from erik-krogh/moreStem
JS: expand what is parsed as the stem of a pathexpr
This commit is contained in:
@@ -87,7 +87,13 @@ File tryExtensions(Folder dir, string basename, int priority) {
|
||||
* Or `name`, if `name` has no file extension.
|
||||
*/
|
||||
bindingset[name]
|
||||
private string getStem(string name) { result = name.regexpCapture("(.+?)(?:\\.([^.]+))?", 1) }
|
||||
private string getStem(string name) {
|
||||
// everything before the last dot
|
||||
result = name.regexpCapture("(.+?)(?:\\.([^.]+))?", 1)
|
||||
or
|
||||
// everything before the first dot
|
||||
result = name.regexpCapture("^([^.]*)\\..*$", 1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a file that a main module from `pkg` exported as `mainPath` with the given `priority`.
|
||||
|
||||
Reference in New Issue
Block a user