aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/dist/dom/data.js
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twbs/bootstrap/js/dist/dom/data.js')
-rw-r--r--vendor/twbs/bootstrap/js/dist/dom/data.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/vendor/twbs/bootstrap/js/dist/dom/data.js b/vendor/twbs/bootstrap/js/dist/dom/data.js
index a134743d8..8ea436b1e 100644
--- a/vendor/twbs/bootstrap/js/dist/dom/data.js
+++ b/vendor/twbs/bootstrap/js/dist/dom/data.js
@@ -1,5 +1,5 @@
/*!
- * Bootstrap data.js v5.2.2 (https://getbootstrap.com/)
+ * Bootstrap data.js v5.3.0-alpha1 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@@ -11,7 +11,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.2.2): dom/data.js
+ * Bootstrap (v5.3.0-alpha1): dom/data.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -19,46 +19,42 @@
/**
* Constants
*/
+
const elementMap = new Map();
const data = {
set(element, key, instance) {
if (!elementMap.has(element)) {
elementMap.set(element, new Map());
}
+ const instanceMap = elementMap.get(element);
- const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
+ // make it clear we only want one instance per element
// can be removed later when multiple key/instances are fine to be used
-
if (!instanceMap.has(key) && instanceMap.size !== 0) {
// eslint-disable-next-line no-console
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
return;
}
-
instanceMap.set(key, instance);
},
-
get(element, key) {
if (elementMap.has(element)) {
return elementMap.get(element).get(key) || null;
}
-
return null;
},
-
remove(element, key) {
if (!elementMap.has(element)) {
return;
}
-
const instanceMap = elementMap.get(element);
- instanceMap.delete(key); // free up element references if there are no instances left for an element
+ instanceMap.delete(key);
+ // free up element references if there are no instances left for an element
if (instanceMap.size === 0) {
elementMap.delete(element);
}
}
-
};
return data;