From: GeoSot Date: Thu, 10 Jun 2021 07:52:35 +0000 (+0300) Subject: `_getDelegateConfig()`: add a comment and remove an unneeded config check X-Git-Tag: v5.1.0~64 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=92c7056619293a581626c37ef2c0095c6f1abceb;p=thirdparty%2Fbootstrap.git `_getDelegateConfig()`: add a comment and remove an unneeded config check --- diff --git a/js/src/tooltip.js b/js/src/tooltip.js index cdc9b1e5d5..d69a80e275 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -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 }