Skip to content

Commit

Permalink
Rename variable and compare with correct value
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Seidelsohn committed Nov 24, 2023
1 parent c523274 commit 52cbb7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
21 changes: 11 additions & 10 deletions customFormatExample.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "",
"version": "",
"description": "",
"licenses": "",
"copyright": "",
"licenseFile": "none",
"licenseText": "none",
"licenseModified": "no"
}
{
"name": "",
"version": "",
"description": "",
"licenses": "",
"copyright": "",
"licenseFile": "none",
"licenseText": "none",
"licenseModified": "no",
"customAttribute": "customValue"
}
14 changes: 7 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ const recursivelyCollectAllDependencies = (options) => {

/*istanbul ignore next*/
if (options.customFormat) {
Object.keys(options.customFormat).forEach((item) => {
if (mustInclude(item) && moduleInfo[item] == null) {
moduleInfo[item] = helpers.getFirstNotUndefinedOrUndefined(
clarification?.[item],
typeof currentExtendedPackageJson[item] === 'string'
? currentExtendedPackageJson[item]
: options.customFormat[item],
Object.keys(options.customFormat).forEach((customFormatKey) => {
if (mustInclude(customFormatKey) && moduleInfo[customFormatKey] === undefined) {
moduleInfo[customFormatKey] = helpers.getFirstNotUndefinedOrUndefined(
clarification?.[customFormatKey],
typeof currentExtendedPackageJson[customFormatKey] === 'string'
? currentExtendedPackageJson[customFormatKey]
: options.customFormat[customFormatKey],
);
}
});
Expand Down

0 comments on commit 52cbb7c

Please sign in to comment.