2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-15 11:59:39 +03: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
+1 -1
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
}