From 6fd4ab88c0bcdb0544fcac8f2320ac1649b6d0d2 Mon Sep 17 00:00:00 2001 From: ekhaled Date: Wed, 8 Sep 2021 16:57:57 +0100 Subject: [PATCH] merge default values --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 7b8d287..e4dff7c 100644 --- a/index.js +++ b/index.js @@ -77,6 +77,10 @@ function mergeItems(itemType, currentItem, newItem, ignoreLocations) { currentItem.description = newItem.description; } + if (!currentItem.defaultValue && newItem.defaultValue) { + currentItem.defaultValue = newItem.defaultValue; + } + if (!currentItem.type || currentItem.type.type === 'any') { if (newItem.type && newItem.type.type !== 'any') { currentItem.type = newItem.type;