UNPKG

snyk-docker-plugin

Version:
31 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUsrLibJarFileContentAction = exports.getJarFileContentAction = void 0; const path = require("path"); const stream_utils_1 = require("../../stream-utils"); const usrLibPath = "/usr/lib"; const ignoredPaths = [usrLibPath, "gradle/cache"]; const javaArchiveFileFormats = [".jar", ".war"]; function filePathMatches(filePath) { const dirName = path.dirname(filePath); const fileExtension = filePath.slice(-4); return (javaArchiveFileFormats.includes(fileExtension) && !ignoredPaths.some((ignorePath) => dirName.includes(path.normalize(ignorePath)))); } exports.getJarFileContentAction = { actionName: "jar", filePathMatches, callback: stream_utils_1.streamToBuffer, }; function usrLibFilePathMatches(filePath) { const dirName = path.dirname(filePath); const fileExtension = filePath.slice(-4); return (javaArchiveFileFormats.includes(fileExtension) && dirName.includes(path.normalize(usrLibPath))); } exports.getUsrLibJarFileContentAction = { actionName: "jar", filePathMatches: usrLibFilePathMatches, callback: stream_utils_1.streamToBuffer, }; //# sourceMappingURL=static.js.map