snyk 1.861.0 → 1.862.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/293.index.js +9 -2
- package/dist/cli/293.index.js.map +1 -1
- package/dist/cli/917.index.js +206 -28
- package/dist/cli/917.index.js.map +1 -1
- package/dist/cli/commands/test/iac-local-execution/file-loader.d.ts +1 -0
- package/dist/cli/commands/test/iac-local-execution/handle-terraform-files-utils.d.ts +18 -0
- package/dist/cli/commands/test/iac-local-execution/handle-terraform-files.d.ts +35 -0
- package/dist/cli/commands/test/iac-local-execution/types.d.ts +1 -0
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/293.index.js
CHANGED
|
@@ -2954,8 +2954,15 @@ const config_1 = __webpack_require__(22541);
|
|
|
2954
2954
|
const debug = debugLib('snyk-detect');
|
|
2955
2955
|
const requiredK8SObjectFields = ['apiVersion', 'kind', 'metadata'];
|
|
2956
2956
|
function getFileType(filePath) {
|
|
2957
|
-
|
|
2958
|
-
|
|
2957
|
+
try {
|
|
2958
|
+
const index = filePath.lastIndexOf('.'); // it will be -1 if it doesn't contain a dot
|
|
2959
|
+
if (index !== -1)
|
|
2960
|
+
return filePath.slice(index + 1).toLowerCase();
|
|
2961
|
+
}
|
|
2962
|
+
catch (e) {
|
|
2963
|
+
// ignore errors if we can't extract the filetype
|
|
2964
|
+
}
|
|
2965
|
+
return '';
|
|
2959
2966
|
}
|
|
2960
2967
|
exports.getFileType = getFileType;
|
|
2961
2968
|
function parseFileContent(fileContent, filePath) {
|