Skip to content

Commit

Permalink
update merge logic to merge keywords and defaultValue
Browse files Browse the repository at this point in the history
  • Loading branch information
ekhaled committed Sep 8, 2021
1 parent 6fd4ab8 commit edc2739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function mergeItems(itemType, currentItem, newItem, ignoreLocations) {
currentItem.description = newItem.description;
}

if (!currentItem.defaultValue && newItem.defaultValue) {
if (!currentItem.defaultValue && typeof newItem.defaultValue != 'undefined') {
currentItem.defaultValue = newItem.defaultValue;
}

Expand All @@ -87,7 +87,7 @@ function mergeItems(itemType, currentItem, newItem, ignoreLocations) {
}
}

if (!currentItem.keywords && newItem.keywords) {
if ((!currentItem.keywords || currentItem.keywords.length == 0) && newItem.keywords) {
currentItem.keywords = newItem.keywords;
}

Expand Down

0 comments on commit edc2739

Please sign in to comment.