mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
TS: Document nodeModulesRex
This commit is contained in:
@@ -245,6 +245,12 @@ function parseSingleFile(filename: string): {ast: ts.SourceFile, code: string} {
|
||||
return {ast, code};
|
||||
}
|
||||
|
||||
/**
|
||||
* Matches a path segment referencing a package in a node_modules folder, and extracts
|
||||
* two capture groups: the package name, and the relative path in the package.
|
||||
*
|
||||
* For example `lib/node_modules/@foo/bar/src/index.js` extracts the capture groups [`@foo/bar`, `src/index.js`].
|
||||
*/
|
||||
const nodeModulesRex = /[/\\]node_modules[/\\]((?:@[\w.-]+[/\\])?\w[\w.-]*)[/\\](.*)/;
|
||||
|
||||
function handleOpenProjectCommand(command: OpenProjectCommand) {
|
||||
|
||||
Reference in New Issue
Block a user