aboutsummaryrefslogtreecommitdiff
path: root/js/src/tooltip.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-05-02 16:56:23 +0300
committerXhmikosR <[email protected]>2020-11-14 15:54:50 +0200
commit6d7bc54d222709275b0eb73bd6b974509332247a (patch)
tree311222b691df1d7d6b237cd6fc74bae721911cd2 /js/src/tooltip.js
parent2e758f64cf7da4a8612992a027704d9f10686b20 (diff)
downloadbootstrap-6d7bc54d222709275b0eb73bd6b974509332247a.tar.xz
bootstrap-6d7bc54d222709275b0eb73bd6b974509332247a.zip
Switch to `Set#has()`
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r--js/src/tooltip.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index e4616f1f1..7b115a69b 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -39,7 +39,7 @@ const DATA_KEY = 'bs.tooltip'
const EVENT_KEY = `.${DATA_KEY}`
const CLASS_PREFIX = 'bs-tooltip'
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
-const DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn']
+const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])
const DefaultType = {
animation: 'boolean',
@@ -679,7 +679,7 @@ class Tooltip {
const dataAttributes = Manipulator.getDataAttributes(this.element)
Object.keys(dataAttributes).forEach(dataAttr => {
- if (DISALLOWED_ATTRIBUTES.includes(dataAttr)) {
+ if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
delete dataAttributes[dataAttr]
}
})