Skip to content

Commit b23c925

Browse files
committed
Add license information
1 parent ef7a512 commit b23c925

File tree

4 files changed

+8126
-65
lines changed

4 files changed

+8126
-65
lines changed

repository/convertFormat.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function largerThan(a, b, name) {
1717
function convertToOldFormat(
1818
input,
1919
includeQueries = false,
20-
includeBackdoored = false
20+
includeBackdoored = false,
21+
includeLicenses = false
2122
) {
2223
const result = {};
2324
Object.entries(input).forEach(([key, value]) => {
@@ -59,6 +60,9 @@ function convertToOldFormat(
5960
vulnerabilities: vulns,
6061
extractors,
6162
};
63+
if (!includeLicenses) {
64+
delete result[key].licenses;
65+
}
6266
});
6367

6468
if (!includeQueries) return result;

repository/convertToOldFormat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ fs.writeFileSync("jsrepository-v2.json", JSON.stringify(resultV2, null, 2));
1111

1212
const resultV3 = convert(data, true, true);
1313
fs.writeFileSync("jsrepository-v3.json", JSON.stringify(resultV3, null, 2));
14+
15+
const resultV4 = convert(data, true, false, true);
16+
fs.writeFileSync("jsrepository-v4.json", JSON.stringify(resultV4, null, 2));

0 commit comments

Comments
 (0)