@@ -15,7 +15,7 @@ const toolkit = require('@github/dependency-submission-toolkit');
1515 * @param {string } fileName - The name of the file from which the SPDX document was extracted.
1616 * @returns {Object } A manifest object containing the processed package data, including direct and indirect dependencies.
1717 */
18- module . exports . getManifestFromSpdxFile = ( document , fileName ) => {
18+ function getManifestFromSpdxFile ( document , fileName ) {
1919 core . debug ( `getManifestFromSpdxFile processing ${ fileName } ` ) ;
2020
2121 let manifest = new toolkit . Manifest ( document . name , fileName ) ;
@@ -65,7 +65,7 @@ module.exports.getManifestFromSpdxFile = (document, fileName) => {
6565 * @param {string[] } files - An array of file paths pointing to SPDX files.
6666 * @returns {Object[] } An array of manifest objects extracted from the SPDX files.
6767 */
68- module . exports . getManifestsFromSpdxFiles = ( files ) => {
68+ function getManifestsFromSpdxFiles ( files ) {
6969 core . debug ( `Processing ${ files . length } files` ) ;
7070 let manifests = [ ] ;
7171 files ?. forEach ( file => {
@@ -81,7 +81,7 @@ module.exports.getManifestsFromSpdxFiles = (files) => {
8181 *
8282 * @returns {string[] } An array of strings representing the paths of files that match the given pattern within the specified path.
8383 */
84- module . exports . searchFiles = ( ) => {
84+ function searchFiles ( ) {
8585 let filePath = core . getInput ( 'filePath' ) ;
8686 let filePattern = core . getInput ( 'filePattern' ) ;
8787
@@ -96,7 +96,7 @@ module.exports.searchFiles = () => {
9696 * @param {string } purl - The package URL to be processed.
9797 * @returns {string } The processed package URL with the necessary characters escaped or unescaped.
9898 */
99- module . exports . replaceVersionEscape = ( purl ) => {
99+ function replaceVersionEscape ( purl ) {
100100 // Some tools are failing to escape the namespace, so we will escape it to work around that
101101 // @ -> %40
102102 // ^ -> %5E
@@ -110,4 +110,12 @@ module.exports.replaceVersionEscape = (purl) => {
110110 }
111111 }
112112 return purl ;
113- }
113+ }
114+
115+ // Exports
116+ module . exports = {
117+ getManifestFromSpdxFile,
118+ getManifestsFromSpdxFiles,
119+ searchFiles,
120+ replaceVersionEscape
121+ }
0 commit comments