Skip to content

Commit

Permalink
fix: Fix function parameters to strings and add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RSeidelsohn committed Apr 12, 2023
1 parent 817d7e0 commit 369f1d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const recursivelyCollectAllDependencies = (options) => {
}

if (mustInclude('url')) {
// TODO: Figure out where the check for json.url.web comes from. It's in the original license-checker,
// but I can't find any documentation on it.
let url = helpers.getFirstNotUndefinedOrUndefined(clarification?.url, json?.url?.web);
/*istanbul ignore next*/
if (url) {
Expand All @@ -87,15 +89,17 @@ const recursivelyCollectAllDependencies = (options) => {
if (typeof json.author === 'object') {
const { publisher, email, url } = helpers.getAuthorDetails({ clarification, author: json?.author });

if (mustInclude(publisher) && publisher) {
if (mustInclude('publisher') && publisher) {
moduleInfo.publisher = publisher;
}

if (mustInclude(email) && email) {
if (mustInclude('email') && email) {
moduleInfo.email = email;
}

if (typeof moduleInfo.url !== 'undefined' && mustInclude(url) && url) {
// moduleInfo.url can for some reason already be set to json.url.web further up in the code,
// so we only set it if it's not already set.
if (typeof moduleInfo.url !== 'undefined' && mustInclude('url') && url) {
moduleInfo.url = url;
}
}
Expand Down

0 comments on commit 369f1d4

Please sign in to comment.