Rename resolveQuerySuiteAlias parameter
This commit is contained in:
parent
79049d92c6
commit
768fc170da
3 changed files with 15 additions and 15 deletions
14
lib/analyze.js
generated
14
lib/analyze.js
generated
|
|
@ -395,18 +395,18 @@ exports.defaultSuites = new Set([
|
|||
"code-scanning",
|
||||
]);
|
||||
/**
|
||||
* If `query` is the name of a default query suite, it is resolved into the corresponding
|
||||
* query suite name for the given `language`. Otherwise, `query` is returned as is.
|
||||
* If `maybeSuite` is the name of a default query suite, it is resolved into the corresponding
|
||||
* query suite name for the given `language`. Otherwise, `maybeSuite` is returned as is.
|
||||
*
|
||||
* @param language The language for which to resolve the default query suite name.
|
||||
* @param query The string that potentially contains the name of a default query suite.
|
||||
* @param maybeSuite The string that potentially contains the name of a default query suite.
|
||||
* @returns Returns the resolved query suite name, or the unmodified input.
|
||||
*/
|
||||
function resolveQuerySuiteAlias(language, query) {
|
||||
if (exports.defaultSuites.has(query)) {
|
||||
return `${language}-${query}.qls`;
|
||||
function resolveQuerySuiteAlias(language, maybeSuite) {
|
||||
if (exports.defaultSuites.has(maybeSuite)) {
|
||||
return `${language}-${maybeSuite}.qls`;
|
||||
}
|
||||
return query;
|
||||
return maybeSuite;
|
||||
}
|
||||
// Runs queries and creates sarif files in the given folder
|
||||
async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, cleanupLevel, diffRangePackDir, automationDetailsId, config, logger, features) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -571,22 +571,22 @@ export const defaultSuites: Set<string> = new Set([
|
|||
]);
|
||||
|
||||
/**
|
||||
* If `query` is the name of a default query suite, it is resolved into the corresponding
|
||||
* query suite name for the given `language`. Otherwise, `query` is returned as is.
|
||||
* If `maybeSuite` is the name of a default query suite, it is resolved into the corresponding
|
||||
* query suite name for the given `language`. Otherwise, `maybeSuite` is returned as is.
|
||||
*
|
||||
* @param language The language for which to resolve the default query suite name.
|
||||
* @param query The string that potentially contains the name of a default query suite.
|
||||
* @param maybeSuite The string that potentially contains the name of a default query suite.
|
||||
* @returns Returns the resolved query suite name, or the unmodified input.
|
||||
*/
|
||||
export function resolveQuerySuiteAlias(
|
||||
language: Language,
|
||||
query: string,
|
||||
maybeSuite: string,
|
||||
): string {
|
||||
if (defaultSuites.has(query)) {
|
||||
return `${language}-${query}.qls`;
|
||||
if (defaultSuites.has(maybeSuite)) {
|
||||
return `${language}-${maybeSuite}.qls`;
|
||||
}
|
||||
|
||||
return query;
|
||||
return maybeSuite;
|
||||
}
|
||||
|
||||
// Runs queries and creates sarif files in the given folder
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue