Skip to content

Commit 793a7dc

Browse files
committed
feat(server): add fetchLicense arg
Signed-off-by: Adam Setch <[email protected]>
1 parent 5f6b5d2 commit 793a7dc

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ import {
134134
parseSwiftResolved,
135135
parseYarnLock,
136136
readZipEntry,
137+
shouldFetchLicense,
137138
splitOutputByGradleProjects,
138-
shouldFetchLicense
139139
} from "./utils.js";
140140
let url = import.meta.url;
141141
if (!url.startsWith("file://")) {

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const parseQueryString = (q, body, options = {}) => {
9292
"includeFormulation",
9393
"includeCrypto",
9494
"standard",
95-
"fetchLicense"
95+
"fetchLicense",
9696
];
9797

9898
for (const param of queryParams) {
@@ -117,7 +117,7 @@ const parseQueryString = (q, body, options = {}) => {
117117
applyProfileOptions(options);
118118
}
119119
if (options.fetchLicense) {
120-
process.env.FETCH_LICENSE = options.fetchLicense
120+
process.env.FETCH_LICENSE = options.fetchLicense;
121121
}
122122
return options;
123123
};

utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ export const PREFER_MAVEN_DEPS_TREE =
129129

130130
// Whether license information should be fetched
131131
export function shouldFetchLicense() {
132-
return process.env.FETCH_LICENSE && ["true", "1"].includes(process.env.FETCH_LICENSE);
132+
return (
133+
process.env.FETCH_LICENSE &&
134+
["true", "1"].includes(process.env.FETCH_LICENSE)
135+
);
133136
}
134137

135138
// Whether search.maven.org will be used to identify jars without maven metadata; default, if unset shall be 'true'
@@ -791,7 +794,6 @@ export async function getNpmMetadata(pkgList) {
791794
p.homepage = { url: body.homepage };
792795
}
793796
cdepList.push(p);
794-
795797
} catch (err) {
796798
cdepList.push(p);
797799
if (DEBUG_MODE) {

0 commit comments

Comments
 (0)