mirror of
https://github.com/github/codeql-action.git
synced 2026-05-21 07:10:07 +00:00
Use nullish conversion for packs
Slightly simplifies the `parsePacks` function.
This commit is contained in:
Generated
+2
-4
@@ -441,6 +441,7 @@ exports.getDefaultConfig = getDefaultConfig;
|
||||
* Load the config from the given file.
|
||||
*/
|
||||
async function loadConfig(languagesInput, queriesInput, configFile, dbLocation, repository, tempDir, toolCacheDir, codeQL, checkoutPath, gitHubVersion, apiDetails, logger) {
|
||||
var _a;
|
||||
let parsedYAML;
|
||||
if (isLocal(configFile)) {
|
||||
// Treat the config file as relative to the workspace
|
||||
@@ -522,7 +523,7 @@ async function loadConfig(languagesInput, queriesInput, configFile, dbLocation,
|
||||
paths.push(validateAndSanitisePath(includePath, PATHS_PROPERTY, configFile, logger));
|
||||
}
|
||||
}
|
||||
const packs = parsePacks(parsedYAML[PACKS_PROPERTY], languages, configFile);
|
||||
const packs = parsePacks((_a = parsedYAML[PACKS_PROPERTY], (_a !== null && _a !== void 0 ? _a : {})), languages, configFile);
|
||||
return {
|
||||
languages,
|
||||
queries,
|
||||
@@ -550,9 +551,6 @@ const PACK_IDENTIFIER_PATTERN = (function () {
|
||||
// Exported for testing
|
||||
function parsePacks(packsByLanguage, languages, configFile) {
|
||||
const packs = {};
|
||||
if (!packsByLanguage) {
|
||||
return packs;
|
||||
}
|
||||
if (Array.isArray(packsByLanguage)) {
|
||||
if (languages.length === 1) {
|
||||
// single language analysis, so language is implicit
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user