Skip to content

Commit cf69103

Browse files
committed
Add missing semicolons for 'const' and 'let'
Ideally these files would conform to the coding standards.
1 parent 32b3b58 commit cf69103

File tree

7 files changed

+189
-189
lines changed

7 files changed

+189
-189
lines changed

lib/web/jquery/bootstrap/collapse.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,40 @@ define([
2929
* ------------------------------------------------------------------------
3030
*/
3131

32-
const VERSION = '5.1.3'
33-
const NAME = 'collapse'
34-
const DATA_KEY = 'bs.collapse'
35-
const EVENT_KEY = `.${DATA_KEY}`
36-
const DATA_API_KEY = '.data-api'
32+
const VERSION = '5.1.3';
33+
const NAME = 'collapse';
34+
const DATA_KEY = 'bs.collapse';
35+
const EVENT_KEY = `.${DATA_KEY}`;
36+
const DATA_API_KEY = '.data-api';
3737

3838
const Default = {
3939
toggle: true,
4040
parent: null
41-
}
41+
};
4242

4343
const DefaultType = {
4444
toggle: 'boolean',
4545
parent: '(null|element)'
46-
}
46+
};
4747

48-
const EVENT_SHOW = `show${EVENT_KEY}`
49-
const EVENT_SHOWN = `shown${EVENT_KEY}`
50-
const EVENT_HIDE = `hide${EVENT_KEY}`
51-
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
52-
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
48+
const EVENT_SHOW = `show${EVENT_KEY}`;
49+
const EVENT_SHOWN = `shown${EVENT_KEY}`;
50+
const EVENT_HIDE = `hide${EVENT_KEY}`;
51+
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
52+
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
5353

54-
const CLASS_NAME_SHOW = 'show'
55-
const CLASS_NAME_COLLAPSE = 'collapse'
56-
const CLASS_NAME_COLLAPSING = 'collapsing'
57-
const CLASS_NAME_COLLAPSED = 'collapsed'
58-
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`
59-
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'
54+
const CLASS_NAME_SHOW = 'show';
55+
const CLASS_NAME_COLLAPSE = 'collapse';
56+
const CLASS_NAME_COLLAPSING = 'collapsing';
57+
const CLASS_NAME_COLLAPSED = 'collapsed';
58+
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
59+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
6060

61-
const WIDTH = 'width'
62-
const HEIGHT = 'height'
61+
const WIDTH = 'width';
62+
const HEIGHT = 'height';
6363

64-
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'
65-
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]'
64+
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
65+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]';
6666

6767
/**
6868
* ------------------------------------------------------------------------
@@ -84,13 +84,13 @@ define([
8484
this._config = this._getConfig(config)
8585
this._triggerArray = []
8686

87-
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)
87+
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
8888

8989
for (let i = 0, len = toggleList.length; i < len; i++) {
90-
const elem = toggleList[i]
91-
const selector = getSelectorFromElement(elem)
90+
const elem = toggleList[i];
91+
const selector = getSelectorFromElement(elem);
9292
const filterElement = SelectorEngine.find(selector)
93-
.filter(foundElem => foundElem === this._element)
93+
.filter(foundElem => foundElem === this._element);
9494

9595
if (selector !== null && filterElement.length) {
9696
this._selector = selector
@@ -149,25 +149,25 @@ define([
149149
return
150150
}
151151

152-
let actives = []
153-
let activesData
152+
let actives = [];
153+
let activesData;
154154

155155
if (this._config.parent) {
156-
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)
156+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
157157
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)) // remove children if greater depth
158158
}
159159

160-
const container = SelectorEngine.findOne(this._selector)
160+
const container = SelectorEngine.findOne(this._selector);
161161
if (actives.length) {
162-
const tempActiveData = actives.find(elem => container !== elem)
162+
const tempActiveData = actives.find(elem => container !== elem);
163163
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null
164164

165165
if (activesData && activesData._isTransitioning) {
166166
return
167167
}
168168
}
169169

170-
const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)
170+
const startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
171171
if (startEvent.defaultPrevented) {
172172
return
173173
}
@@ -182,7 +182,7 @@ define([
182182
}
183183
})
184184

185-
const dimension = this._getDimension()
185+
const dimension = this._getDimension();
186186

187187
this._element.classList.remove(CLASS_NAME_COLLAPSE)
188188
this._element.classList.add(CLASS_NAME_COLLAPSING)
@@ -201,10 +201,10 @@ define([
201201
this._element.style[dimension] = ''
202202

203203
EventHandler.trigger(this._element, EVENT_SHOWN)
204-
}
204+
};
205205

206-
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)
207-
const scrollSize = `scroll${capitalizedDimension}`
206+
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
207+
const scrollSize = `scroll${capitalizedDimension}`;
208208

209209
this._queueCallback(complete, this._element, true)
210210
this._element.style[dimension] = `${this._element[scrollSize]}px`
@@ -215,12 +215,12 @@ define([
215215
return
216216
}
217217

218-
const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)
218+
const startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
219219
if (startEvent.defaultPrevented) {
220220
return
221221
}
222222

223-
const dimension = this._getDimension()
223+
const dimension = this._getDimension();
224224

225225
this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`
226226

@@ -229,10 +229,10 @@ define([
229229
this._element.classList.add(CLASS_NAME_COLLAPSING)
230230
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
231231

232-
const triggerArrayLength = this._triggerArray.length
232+
const triggerArrayLength = this._triggerArray.length;
233233
for (let i = 0; i < triggerArrayLength; i++) {
234-
const trigger = this._triggerArray[i]
235-
const elem = getElementFromSelector(trigger)
234+
const trigger = this._triggerArray[i];
235+
const elem = getElementFromSelector(trigger);
236236

237237
if (elem && !this._isShown(elem)) {
238238
this._addAriaAndCollapsedClass([trigger], false)
@@ -246,7 +246,7 @@ define([
246246
this._element.classList.remove(CLASS_NAME_COLLAPSING)
247247
this._element.classList.add(CLASS_NAME_COLLAPSE)
248248
EventHandler.trigger(this._element, EVENT_HIDDEN)
249-
}
249+
};
250250

251251
this._element.style[dimension] = ''
252252

@@ -280,10 +280,10 @@ define([
280280
return
281281
}
282282

283-
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)
283+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
284284
SelectorEngine.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem))
285285
.forEach(element => {
286-
const selected = getElementFromSelector(element)
286+
const selected = getElementFromSelector(element);
287287

288288
if (selected) {
289289
this._addAriaAndCollapsedClass([element], this._isShown(selected))
@@ -319,12 +319,12 @@ define([
319319

320320
Collapse.jQueryInterface = function(config) {
321321
return this.each(function () {
322-
const _config = {}
322+
const _config = {};
323323
if (typeof config === 'string' && /show|hide/.test(config)) {
324324
_config.toggle = false
325325
}
326326

327-
const data = Collapse.getOrCreateInstance(this, _config)
327+
const data = Collapse.getOrCreateInstance(this, _config);
328328

329329
if (typeof config === 'string') {
330330
if (typeof data[config] === 'undefined') {
@@ -348,8 +348,8 @@ define([
348348
event.preventDefault()
349349
}
350350

351-
const selector = getSelectorFromElement(this)
352-
const selectorElements = SelectorEngine.find(selector)
351+
const selector = getSelectorFromElement(this);
352+
const selectorElements = SelectorEngine.find(selector);
353353

354354
selectorElements.forEach(element => {
355355
Collapse.getOrCreateInstance(element, {toggle: false}).toggle()

lib/web/jquery/bootstrap/dom/data.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ define([], function() {
1414
* ------------------------------------------------------------------------
1515
*/
1616

17-
const elementMap = new Map()
17+
const elementMap = new Map();
1818

1919
return {
2020
set: function (element, key, instance) {
2121
if (!elementMap.has(element)) {
2222
elementMap.set(element, new Map())
2323
}
2424

25-
const instanceMap = elementMap.get(element)
25+
const instanceMap = elementMap.get(element);
2626

2727
// make it clear we only want one instance per element
2828
// can be removed later when multiple key/instances are fine to be used
@@ -48,7 +48,7 @@ define([], function() {
4848
return
4949
}
5050

51-
const instanceMap = elementMap.get(element)
51+
const instanceMap = elementMap.get(element);
5252

5353
instanceMap.delete(key)
5454

0 commit comments

Comments
 (0)