зеркало из https://github.com/github/codeql.git
JS: Handle .d.mts files when generating module bindings
This commit is contained in:
Родитель
a5f2c949d3
Коммит
039a7ba828
|
@ -670,6 +670,12 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
|
||||||
if (file.endsWith(".d.ts")) {
|
if (file.endsWith(".d.ts")) {
|
||||||
return pathlib.basename(file, ".d.ts");
|
return pathlib.basename(file, ".d.ts");
|
||||||
}
|
}
|
||||||
|
if (file.endsWith(".d.mts") || file.endsWith(".d.cts")) {
|
||||||
|
// We don't extract d.mts or d.cts files, but their symbol can coincide with that of a d.ts file,
|
||||||
|
// which means any module bindings we generate for it will ultimately be visible in QL.
|
||||||
|
let base = pathlib.basename(file);
|
||||||
|
return base.substring(0, base.length - '.d.mts'.length);
|
||||||
|
}
|
||||||
let base = pathlib.basename(file);
|
let base = pathlib.basename(file);
|
||||||
let dot = base.lastIndexOf('.');
|
let dot = base.lastIndexOf('.');
|
||||||
return dot === -1 || dot === 0 ? base : base.substring(0, dot);
|
return dot === -1 || dot === 0 ? base : base.substring(0, dot);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче