snyk 1.871.0 → 1.872.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/245.index.js
CHANGED
|
@@ -5619,6 +5619,7 @@ async function analyzeFolders(options) {
|
|
|
5619
5619
|
const fileBundle = await (0, bundles_1.createBundleFromFolders)({
|
|
5620
5620
|
...options.connection,
|
|
5621
5621
|
...options.fileOptions,
|
|
5622
|
+
languages: options.languages,
|
|
5622
5623
|
});
|
|
5623
5624
|
if (fileBundle === null)
|
|
5624
5625
|
return null;
|
|
@@ -5903,15 +5904,25 @@ exports.remoteBundleFactory = remoteBundleFactory;
|
|
|
5903
5904
|
* @param source
|
|
5904
5905
|
* @returns
|
|
5905
5906
|
*/
|
|
5906
|
-
async function getSupportedFiles(baseURL, source, requestId) {
|
|
5907
|
+
async function getSupportedFiles(baseURL, source, requestId, languages) {
|
|
5907
5908
|
emitter_1.emitter.supportedFilesLoaded(null);
|
|
5908
5909
|
const resp = await (0, http_1.getFilters)(baseURL, source, undefined, requestId);
|
|
5909
5910
|
if (resp.type === 'error') {
|
|
5910
5911
|
throw resp.error;
|
|
5911
5912
|
}
|
|
5912
|
-
const
|
|
5913
|
-
|
|
5914
|
-
|
|
5913
|
+
const supportedFilesFromApi = resp.value;
|
|
5914
|
+
//Given supported languages from 'registy'
|
|
5915
|
+
if (languages) {
|
|
5916
|
+
let supportedFiles = {};
|
|
5917
|
+
supportedFiles.configFiles = supportedFilesFromApi.configFiles;
|
|
5918
|
+
supportedFiles.extensions = languages;
|
|
5919
|
+
//For verification only
|
|
5920
|
+
supportedFiles.extensions = supportedFiles.extensions.filter(langExtension => supportedFilesFromApi.extensions.includes(langExtension));
|
|
5921
|
+
emitter_1.emitter.supportedFilesLoaded(supportedFiles);
|
|
5922
|
+
return supportedFiles;
|
|
5923
|
+
}
|
|
5924
|
+
emitter_1.emitter.supportedFilesLoaded(supportedFilesFromApi);
|
|
5925
|
+
return supportedFilesFromApi;
|
|
5915
5926
|
}
|
|
5916
5927
|
/**
|
|
5917
5928
|
* Creates a remote bundle and returns response from the bundle API
|
|
@@ -5923,7 +5934,7 @@ async function createBundleFromFolders(options) {
|
|
|
5923
5934
|
const baseDir = (0, files_1.determineBaseDir)(options.paths);
|
|
5924
5935
|
const [supportedFiles, fileIgnores] = await Promise.all([
|
|
5925
5936
|
// Fetch supporte files to save network traffic
|
|
5926
|
-
getSupportedFiles(options.baseURL, options.source, options.requestId),
|
|
5937
|
+
getSupportedFiles(options.baseURL, options.source, options.requestId, options.languages),
|
|
5927
5938
|
// Scan for custom ignore rules
|
|
5928
5939
|
(0, files_1.collectIgnoreRules)(options.paths, options.symlinksEnabled, options.defaultFileIgnores),
|
|
5929
5940
|
]);
|