@@ -15,7 +15,7 @@ const toolkit = require('@github/dependency-submission-toolkit');
15
15
* @param {string } fileName - The name of the file from which the SPDX document was extracted.
16
16
* @returns {Object } A manifest object containing the processed package data, including direct and indirect dependencies.
17
17
*/
18
- module . exports . getManifestFromSpdxFile = ( document , fileName ) => {
18
+ function getManifestFromSpdxFile ( document , fileName ) {
19
19
core . debug ( `getManifestFromSpdxFile processing ${ fileName } ` ) ;
20
20
21
21
let manifest = new toolkit . Manifest ( document . name , fileName ) ;
@@ -65,7 +65,7 @@ module.exports.getManifestFromSpdxFile = (document, fileName) => {
65
65
* @param {string[] } files - An array of file paths pointing to SPDX files.
66
66
* @returns {Object[] } An array of manifest objects extracted from the SPDX files.
67
67
*/
68
- module . exports . getManifestsFromSpdxFiles = ( files ) => {
68
+ function getManifestsFromSpdxFiles ( files ) {
69
69
core . debug ( `Processing ${ files . length } files` ) ;
70
70
let manifests = [ ] ;
71
71
files ?. forEach ( file => {
@@ -81,7 +81,7 @@ module.exports.getManifestsFromSpdxFiles = (files) => {
81
81
*
82
82
* @returns {string[] } An array of strings representing the paths of files that match the given pattern within the specified path.
83
83
*/
84
- module . exports . searchFiles = ( ) => {
84
+ function searchFiles ( ) {
85
85
let filePath = core . getInput ( 'filePath' ) ;
86
86
let filePattern = core . getInput ( 'filePattern' ) ;
87
87
@@ -96,7 +96,7 @@ module.exports.searchFiles = () => {
96
96
* @param {string } purl - The package URL to be processed.
97
97
* @returns {string } The processed package URL with the necessary characters escaped or unescaped.
98
98
*/
99
- module . exports . replaceVersionEscape = ( purl ) => {
99
+ function replaceVersionEscape ( purl ) {
100
100
// Some tools are failing to escape the namespace, so we will escape it to work around that
101
101
// @ -> %40
102
102
// ^ -> %5E
@@ -110,4 +110,12 @@ module.exports.replaceVersionEscape = (purl) => {
110
110
}
111
111
}
112
112
return purl ;
113
- }
113
+ }
114
+
115
+ // Exports
116
+ module . exports = {
117
+ getManifestFromSpdxFile,
118
+ getManifestsFromSpdxFiles,
119
+ searchFiles,
120
+ replaceVersionEscape
121
+ }
0 commit comments