]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Remove useless check for null object with spread operator
authorJohann-S <johann.servoire@gmail.com>
Wed, 14 Aug 2019 16:02:41 +0000 (18:02 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Sun, 18 Aug 2019 14:19:36 +0000 (17:19 +0300)
js/src/dropdown/dropdown.js
js/src/tooltip/tooltip.js

index 26bcf2aa3ac416082a81feaf9f2786b3767d7b98..fbf782a0e1a5eac0eb821271d24f071e24b575ef 100644 (file)
@@ -341,7 +341,7 @@ class Dropdown {
   }
 
   _getPopperConfig() {
-    let popperConfig = {
+    const popperConfig = {
       placement: this._getPlacement(),
       modifiers: {
         offset: this._getOffset(),
@@ -361,14 +361,10 @@ class Dropdown {
       }
     }
 
-    if (this._config.popperConfig) {
-      popperConfig = {
-        ...popperConfig,
-        ...this._config.popperConfig
-      }
+    return {
+      ...popperConfig,
+      ...this._config.popperConfig
     }
-
-    return popperConfig
   }
 
   // Static
index 8bf998468c79dc3d69c17f214dc4f8c934a2be62..99ac29af6fa32f38be3f36da345c409a4caf3997 100644 (file)
@@ -483,15 +483,10 @@ class Tooltip {
       onUpdate: data => this._handlePopperPlacementChange(data)
     }
 
-    let resultConfig = defaultBsConfig
-    if (this.config.popperConfig) {
-      resultConfig = {
-        ...defaultBsConfig,
-        ...this.config.popperConfig
-      }
+    return {
+      ...defaultBsConfig,
+      ...this.config.popperConfig
     }
-
-    return resultConfig
   }
 
   _addAttachmentClass(attachment) {