0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-26 23:54:23 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}