Skip to content

Commit

Permalink
Validation feature
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Jul 4, 2023
1 parent 73b28b5 commit 2e8355a
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,47 +209,6 @@ const determineParentComponent = (options) => {
return parentComponent;
};

/**
* Method to create global external references
*
* @param pkg
* @returns {Array}
*/
function addGlobalReferences(src, filename, format = "xml") {
const externalReferences = [];
if (format === "json") {
externalReferences.push({
type: "other",
url: src,
comment: "Base path"
});
} else {
externalReferences.push({
reference: { "@type": "other", url: src, comment: "Base path" }
});
}
let packageFileMeta = filename;
if (!filename.includes(src)) {
packageFileMeta = join(src, filename);
}
if (format === "json") {
externalReferences.push({
type: "other",
url: packageFileMeta,
comment: "Package file"
});
} else {
externalReferences.push({
reference: {
"@type": "other",
url: packageFileMeta,
comment: "Package file"
}
});
}
return externalReferences;
}

/**
* Function to create the services block
*/
Expand Down Expand Up @@ -926,11 +885,6 @@ const buildBomXml = (
bom.ele("metadata").ele(metadata);
if (components && components.length) {
bom.ele("components").ele(components);
if (context && context.src && context.filename) {
bom
.ele("externalReferences")
.ele(addGlobalReferences(context.src, context.filename, "xml"));
}
if (context) {
if (context.services && context.services.length) {
bom.ele("services").ele(addServices(context.services, "xml"));
Expand Down Expand Up @@ -994,13 +948,6 @@ const buildBomNSData = (options, pkgInfo, ptype, context) => {
components: listComponents(options, allImports, pkgInfo, ptype, "json"),
dependencies
};
if (context && context.src && context.filename) {
jsonTpl.externalReferences = addGlobalReferences(
context.src,
context.filename,
"json"
);
}
bomNSData.bomXml = bomString;
bomNSData.bomJson = jsonTpl;
bomNSData.nsMapping = nsMapping;
Expand Down

0 comments on commit 2e8355a

Please sign in to comment.