From 31eb1088112567035d27c82649a9b909b392daf9 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 14 Jul 2020 17:46:55 +0300 Subject: [PATCH] Add parentheses around multiple spread conditions --- js/src/collapse.js | 2 +- js/src/dropdown.js | 2 +- js/src/modal.js | 2 +- js/src/scrollspy.js | 2 +- js/src/toast.js | 2 +- js/src/tooltip.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/src/collapse.js b/js/src/collapse.js index 6052995153..3d00c49659 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -329,7 +329,7 @@ class Collapse { const _config = { ...Default, ...$element.data(), - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 5e3ed4c56e..1f2b03877c 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -308,7 +308,7 @@ class Dropdown { offset.fn = data => { data.offsets = { ...data.offsets, - ...this._config.offset(data.offsets, this._element) || {} + ...(this._config.offset(data.offsets, this._element) || {}) } return data diff --git a/js/src/modal.js b/js/src/modal.js index a694cb780f..53d8923c25 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -552,7 +552,7 @@ class Modal { const _config = { ...Default, ...$(this).data(), - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } if (!data) { diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index fbfc50043f..6ceefbe079 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -155,7 +155,7 @@ class ScrollSpy { _getConfig(config) { config = { ...Default, - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } if (typeof config.target !== 'string' && Util.isElement(config.target)) { diff --git a/js/src/toast.js b/js/src/toast.js index 1959e72a61..955c2fe2fe 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -151,7 +151,7 @@ class Toast { config = { ...Default, ...$(this._element).data(), - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } Util.typeCheckConfig( diff --git a/js/src/tooltip.js b/js/src/tooltip.js index e2a554014d..b53dc3f098 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -473,7 +473,7 @@ class Tooltip { offset.fn = data => { data.offsets = { ...data.offsets, - ...this.config.offset(data.offsets, this.element) || {} + ...(this.config.offset(data.offsets, this.element) || {}) } return data @@ -657,7 +657,7 @@ class Tooltip { config = { ...this.constructor.Default, ...dataAttributes, - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } if (typeof config.delay === 'number') {