]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add parentheses around multiple spread conditions
authorXhmikosR <xhmikosr@gmail.com>
Tue, 14 Jul 2020 14:46:55 +0000 (17:46 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 21 Sep 2020 11:58:34 +0000 (14:58 +0300)
js/src/collapse.js
js/src/dropdown.js
js/src/modal.js
js/src/scrollspy.js
js/src/toast.js
js/src/tooltip.js

index 605299515370ac9c060de12c5db674fee18a6487..3d00c4965939cfa1ac087d31b7ba3e48fd63ff48 100644 (file)
@@ -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)) {
index 5e3ed4c56e64637d88cf9112888f44d1276d2cf0..1f2b03877c0a9078f0a05caaa173b43038019c0f 100644 (file)
@@ -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
index a694cb780fa0343a67294b75a8e3c9bfe2db797c..53d8923c25e7735176aef3da5b6a1cf2c7d84345 100644 (file)
@@ -552,7 +552,7 @@ class Modal {
       const _config = {
         ...Default,
         ...$(this).data(),
-        ...typeof config === 'object' && config ? config : {}
+        ...(typeof config === 'object' && config ? config : {})
       }
 
       if (!data) {
index fbfc50043fbbcec63f4f7fbdc36053466d97f7da..6ceefbe0795bfc46e4f8e38add9516803de56a4b 100644 (file)
@@ -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)) {
index 1959e72a61b28143f0e4cdb410c089afe0c4d49d..955c2fe2fee5bd71a138d14916e666f5945baddb 100644 (file)
@@ -151,7 +151,7 @@ class Toast {
     config = {
       ...Default,
       ...$(this._element).data(),
-      ...typeof config === 'object' && config ? config : {}
+      ...(typeof config === 'object' && config ? config : {})
     }
 
     Util.typeCheckConfig(
index e2a554014d5e733e66b3560f05253e349d724a96..b53dc3f098de40b4ce3f4eb65e5d9fa3d5003fb3 100644 (file)
@@ -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') {