diff --git a/js/src/collapse.js b/js/src/collapse.js index 693e7ee2c8..e569d99819 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -342,7 +342,7 @@ class Collapse { const _config = { ...Default, ...Manipulator.getDataAttributes(element), - ...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 539f9e7a44..4af48cadb8 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -303,7 +303,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 8c6617650d..1285793f36 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -544,7 +544,7 @@ class Modal { const _config = { ...Default, ...Manipulator.getDataAttributes(this), - ...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 6f7dd04f27..108b6f067b 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -160,7 +160,7 @@ class ScrollSpy { _getConfig(config) { config = { ...Default, - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } if (typeof config.target !== 'string' && isElement(config.target)) { diff --git a/js/src/toast.js b/js/src/toast.js index fd9976fb97..30f90c2957 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -170,7 +170,7 @@ class Toast { config = { ...Default, ...Manipulator.getDataAttributes(this._element), - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } typeCheckConfig(NAME, config, this.constructor.DefaultType) diff --git a/js/src/tooltip.js b/js/src/tooltip.js index d8d92f57d1..9ad73328be 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -491,7 +491,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 @@ -689,7 +689,7 @@ class Tooltip { config = { ...this.constructor.Default, ...dataAttributes, - ...typeof config === 'object' && config ? config : {} + ...(typeof config === 'object' && config ? config : {}) } if (typeof config.delay === 'number') {