1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 07:06:36 +02:00

collapse: don't rely on implicit conversion (#30566)

`config` can be an `Object` and we only need to test for `hide` or `show` if it's a `String`
This commit is contained in:
XhmikosR
2020-04-17 15:09:51 +03:00
committed by GitHub
parent 6b5f055a7d
commit 8547ab149a

View File

@@ -346,7 +346,7 @@ class Collapse {
...typeof config === 'object' && config ? config : {}
}
if (!data && _config.toggle && /show|hide/.test(config)) {
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
_config.toggle = false
}