Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snyk/code-client

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snyk/code-client - npm Package Compare versions

Comparing version 4.18.4 to 4.18.5

11

dist/bundles.js

@@ -152,7 +152,10 @@ "use strict";

if (languages) {
const supportedFiles = {};
supportedFiles.configFiles = supportedFilesFromApi.configFiles;
supportedFiles.extensions = languages;
const supportedFiles = {
configFiles: supportedFilesFromApi.configFiles,
extensions: languages,
};
//For verification only
supportedFiles.extensions = supportedFiles.extensions.filter(langExtension => supportedFilesFromApi.extensions.includes(langExtension));
// Make sure we compare file extensions between results from `registry` and `deeproxy` without case sensitivity to avoid missing some of supported extensions.
const userSupportedExtensions = supportedFilesFromApi.extensions.map(e => e.toLowerCase());
supportedFiles.extensions = supportedFiles.extensions.filter(langExtension => userSupportedExtensions.includes(langExtension.toLowerCase()));
emitter_1.emitter.supportedFilesLoaded(supportedFiles);

@@ -159,0 +162,0 @@ return supportedFiles;

@@ -147,3 +147,3 @@ "use strict";

return [
...supportedFiles.extensions.map(e => `*${e}`),
...supportedFiles.extensions.map(e => `${generateAllCaseGlobPattern(e)}`),
...supportedFiles.configFiles.filter(e => !constants_1.EXCLUDED_NAMES.includes(e)),

@@ -153,2 +153,28 @@ ];

exports.getGlobPatterns = getGlobPatterns;
// Generates glob patterns for case-insensitive file extension matching.
// E.g. *.[jJ][sS] for matching .js files without case-sensitivity.
function generateAllCaseGlobPattern(fileExtension) {
const chars = Array.from(fileExtension);
if (!chars.length) {
console.log('Invalid file extension pattern: file extension is empty.');
return '';
}
if (chars[0] != '.') {
console.log("Invalid file extension pattern: missing '.' in the beginning of the file extension. Some files may not be included in the analysis.");
return '';
}
const caseInsensitivePatterns = chars.reduce((pattern, extensionChar, i) => {
if (i == 0) {
// first char should always be '.', no need to generate multiple cases for file extension character
return ['*.'];
}
if (extensionChar.toLowerCase() == extensionChar.toUpperCase()) {
// Char doesn't have case variant, return as-is.
return pattern.concat(extensionChar);
}
const globCharPattern = `[${extensionChar.toLowerCase()}${extensionChar.toUpperCase()}]`;
return pattern.concat(globCharPattern);
}, []);
return caseInsensitivePatterns.join('');
}
async function collectIgnoreRules(dirs, symlinksEnabled = false, fileIgnores = constants_1.IGNORES_DEFAULT) {

@@ -155,0 +181,0 @@ const tasks = dirs.map(async (folder) => {

@@ -93,3 +93,3 @@ {

},
"version": "4.18.4"
"version": "4.18.5"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc