]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
`_getDelegateConfig()`: add a comment and remove an unneeded config check
authorGeoSot <geo.sotis@gmail.com>
Thu, 10 Jun 2021 07:52:35 +0000 (10:52 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 22 Jul 2021 14:20:38 +0000 (17:20 +0300)
js/src/tooltip.js

index cdc9b1e5d59becd000a2f801833f1e90740c71c0..d69a80e275b13526c3ddc3bb9ee773d0ecb43058 100644 (file)
@@ -685,14 +685,15 @@ class Tooltip extends BaseComponent {
   _getDelegateConfig() {
     const config = {}
 
-    if (this._config) {
-      for (const key in this._config) {
-        if (this.constructor.Default[key] !== this._config[key]) {
-          config[key] = this._config[key]
-        }
+    for (const key in this._config) {
+      if (this.constructor.Default[key] !== this._config[key]) {
+        config[key] = this._config[key]
       }
     }
 
+    // In the future can be replaced with:
+    // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
+    // `Object.fromEntries(keysWithDifferentValues)`
     return config
   }