diff options
| author | XhmikosR <[email protected]> | 2021-07-30 09:28:51 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2021-10-05 19:52:11 +0300 |
| commit | 666fe596bf4629777f995dd79046b1db632ffdfb (patch) | |
| tree | 9e14fcf9c5d325e668d75d2b313242e16e7fbec3 /js/src/util/index.js | |
| parent | 2b4d0d166b58cabfb0384a2081d84e51df84e37f (diff) | |
| download | bootstrap-666fe596bf4629777f995dd79046b1db632ffdfb.tar.xz bootstrap-666fe596bf4629777f995dd79046b1db632ffdfb.zip | |
Enable `unicorn/no-array-for-each` rule
Diffstat (limited to 'js/src/util/index.js')
| -rw-r--r-- | js/src/util/index.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js index b99496301..9cee979df 100644 --- a/js/src/util/index.js +++ b/js/src/util/index.js @@ -125,7 +125,7 @@ const getElement = obj => { } const typeCheckConfig = (componentName, config, configTypes) => { - Object.keys(configTypes).forEach(property => { + for (const property of Object.keys(configTypes)) { const expectedTypes = configTypes[property] const value = config[property] const valueType = value && isElement(value) ? 'element' : toType(value) @@ -135,7 +135,7 @@ const typeCheckConfig = (componentName, config, configTypes) => { `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".` ) } - }) + } } const isVisible = element => { @@ -217,7 +217,9 @@ const onDOMContentLoaded = callback => { // add listener on the first call when the document is in loading state if (!DOMContentLoadedCallbacks.length) { document.addEventListener('DOMContentLoaded', () => { - DOMContentLoadedCallbacks.forEach(callback => callback()) + for (const callback of DOMContentLoadedCallbacks) { + callback() + } }) } |
