Skip to content
Permalink
591359cae6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Robert Brignull introduce languages.ts
Latest commit 591359c Aug 10, 2020 History
0 contributors

Users who have contributed to this file

36 lines (36 sloc) 1.2 KB
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// All the languages supported by CodeQL
exports.ALL_LANGUAGES = ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'];
// Additional names for languages
const LANGUAGE_ALIASES = {
'c': 'cpp',
'c++': 'cpp',
'c#': 'csharp',
'typescript': 'javascript',
};
// Translate from user input or GitHub's API names for languages to CodeQL's names for languages
function parseLanguage(language) {
// Normalise to lower case
language = language.toLowerCase();
// See if it's an exact match
const parsedLanguage = exports.ALL_LANGUAGES.find(l => l === language);
if (parsedLanguage !== undefined) {
return parsedLanguage;
}
// Check language aliases
if (language in LANGUAGE_ALIASES) {
return LANGUAGE_ALIASES[language];
}
return undefined;
}
exports.parseLanguage = parseLanguage;
function isTracedLanguage(language) {
return ['cpp', 'java', 'csharp'].includes(language);
}
exports.isTracedLanguage = isTracedLanguage;
function isScannedLanguage(language) {
return !isTracedLanguage(language);
}
exports.isScannedLanguage = isScannedLanguage;
//# sourceMappingURL=languages.js.map