From 32856280b41c34a6dc2d4f782de3bb4d13c22d21 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 11 Feb 2020 21:46:06 +0100 Subject: [PATCH] let in to const in --- Chart/ChartAbstract.js | 2 +- Event/EventManager.js | 4 ++-- Log/Logger.js | 2 +- Message/Request/Request.js | 6 +++--- Model/Action/Dom/GetValue.js | 2 +- Model/Action/Dom/Popup.js | 4 ++-- Model/Action/Dom/Remove.js | 2 +- Model/Action/Dom/RemoveValue.js | 2 +- Model/Action/Dom/SetValue.js | 2 +- Model/Action/Utils/DataCollector.js | 4 ++-- UI/Component/Form.js | 2 +- Uri/UriFactory.js | 6 +++--- Utils/ArrayUtils.js | 2 +- Utils/Debug.js | 2 +- Utils/GeneralUtils.js | 2 +- Utils/oLib.js | 4 ++-- Views/FormView.js | 2 +- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Chart/ChartAbstract.js b/Chart/ChartAbstract.js index 9f28123..8fff76f 100644 --- a/Chart/ChartAbstract.js +++ b/Chart/ChartAbstract.js @@ -224,7 +224,7 @@ jsOMS.Chart.ChartAbstract.prototype.findAxisDomain = function () { - for (let id in this.axis) { + for (const id in this.axis) { if (!this.axis.hasOwnProperty(id)) { continue; } diff --git a/Event/EventManager.js b/Event/EventManager.js index 3245be0..4e5bf56 100644 --- a/Event/EventManager.js +++ b/Event/EventManager.js @@ -56,7 +56,7 @@ export class EventManager */ reset (group) { - for (let id in this.groups[group]) { + for (const id in this.groups[group]) { if (this.groups[group].hasOwnProperty(id)) { this.groups[group][id] = false; } @@ -78,7 +78,7 @@ export class EventManager return false; } - for (let id in this.groups[group]) { + for (const id in this.groups[group]) { if (!this.groups[group].hasOwnProperty(id) || !this.groups[group][id]) { return true; } diff --git a/Log/Logger.js b/Log/Logger.js index b2fe93f..dfa6720 100644 --- a/Log/Logger.js +++ b/Log/Logger.js @@ -62,7 +62,7 @@ export class Logger { message = typeof message === 'undefined' ? Logger.MSG_FULL : message; - for (let replace in context) { + for (const replace in context) { if (context.hasOwnProperty(replace) && typeof message === 'string') { message = message.replace('{' + replace + '}', context[replace]); } diff --git a/Message/Request/Request.js b/Message/Request/Request.js index 76844f4..e211d57 100644 --- a/Message/Request/Request.js +++ b/Message/Request/Request.js @@ -109,7 +109,7 @@ export class Request */ static getOS() { - for (let os in OSType) { + for (const os in OSType) { if (OSType.hasOwnProperty(os)) { /** global: navigator */ if (navigator.appVersion.toLowerCase().indexOf(OSType[os]) !== -1) { @@ -330,7 +330,7 @@ export class Request queryfy(obj) { const str = []; - for (let p in obj) { + for (const p in obj) { if (obj.hasOwnProperty(p)) { str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); } @@ -357,7 +357,7 @@ export class Request if (this.xhr.readyState !== 1) { this.xhr.open(this.method, UriFactory.build(this.uri)); - for (let p in this.requestHeader) { + for (const p in this.requestHeader) { if (this.requestHeader.hasOwnProperty(p) && this.requestHeader[p] !== '') { this.xhr.setRequestHeader(p, this.requestHeader[p]); } diff --git a/Model/Action/Dom/GetValue.js b/Model/Action/Dom/GetValue.js index ff9e4a4..e9136c3 100644 --- a/Model/Action/Dom/GetValue.js +++ b/Model/Action/Dom/GetValue.js @@ -14,7 +14,7 @@ export function domGetValue (action, callback, id) const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector); let value = {}; - for (let i in e) { + for (const i in e) { /** global: HTMLElement */ if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) { continue; diff --git a/Model/Action/Dom/Popup.js b/Model/Action/Dom/Popup.js index 4667c71..4e19d87 100644 --- a/Model/Action/Dom/Popup.js +++ b/Model/Action/Dom/Popup.js @@ -13,7 +13,7 @@ export function popupButtonAction (action, callback, id) const popup = action.base === 'self' ? (action.selector === '' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector); - for (let i in popup) { + for (const i in popup) { /** global: HTMLElement */ if (!popup.hasOwnProperty(i) || !popup[i] || !(popup[i] instanceof HTMLElement)) { continue; @@ -26,7 +26,7 @@ export function popupButtonAction (action, callback, id) document.getElementById('dim').classList.remove('vh'); } - for (let j in clone) { + for (const j in clone) { if (!clone.hasOwnProperty(j) || !(clone[j] instanceof HTMLElement)) { continue; } diff --git a/Model/Action/Dom/Remove.js b/Model/Action/Dom/Remove.js index 8d59112..96dff59 100644 --- a/Model/Action/Dom/Remove.js +++ b/Model/Action/Dom/Remove.js @@ -14,7 +14,7 @@ export function removeButtonAction (action, callback, id) const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector); const dim = document.getElementById('dim'); - for (let i in e) { + for (const i in e) { /** global: HTMLElement */ if (!e.hasOwnProperty(i) || !e[i] || !(e[i] instanceof HTMLElement)) { continue; diff --git a/Model/Action/Dom/RemoveValue.js b/Model/Action/Dom/RemoveValue.js index 5b4d75b..97578da 100644 --- a/Model/Action/Dom/RemoveValue.js +++ b/Model/Action/Dom/RemoveValue.js @@ -13,7 +13,7 @@ export function domRemoveValue (action, callback, id) const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector); - for (let i in e) { + for (const i in e) { /** global: HTMLElement */ if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) { continue; diff --git a/Model/Action/Dom/SetValue.js b/Model/Action/Dom/SetValue.js index 89622a5..89010f2 100644 --- a/Model/Action/Dom/SetValue.js +++ b/Model/Action/Dom/SetValue.js @@ -33,7 +33,7 @@ export function domSetValue (action, callback, id) const fill = action.base === 'self' ? (action.selector === '' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector); - for (let i in fill) { + for (const i in fill) { /** global: HTMLElement */ if (!fill.hasOwnProperty(i) || !(fill[i] instanceof HTMLElement)) { continue; diff --git a/Model/Action/Utils/DataCollector.js b/Model/Action/Utils/DataCollector.js index 209c9b8..ee907d1 100644 --- a/Model/Action/Utils/DataCollector.js +++ b/Model/Action/Utils/DataCollector.js @@ -12,14 +12,14 @@ export function dataCollectionAction (action, callback) let elements, data = {}; - for (let selector in action.collect) { + for (const selector in action.collect) { if (!action.collect.hasOwnProperty(selector)) { continue; } elements = document.querySelectorAll(action.collect[selector]); - for (let e in elements) { + for (const e in elements) { if (!elements.hasOwnProperty(e)) { continue; } diff --git a/UI/Component/Form.js b/UI/Component/Form.js index 53b6d7e..8881554 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -275,7 +275,7 @@ export class Form } // Run all injects first - for (let property in injects) { + for (const property in injects) { if (injects.hasOwnProperty(property)) { ++counter; //this.app.eventManager.addGroup(form.getId(), counter); diff --git a/Uri/UriFactory.js b/Uri/UriFactory.js index 383a248..2e79fc6 100644 --- a/Uri/UriFactory.js +++ b/Uri/UriFactory.js @@ -97,7 +97,7 @@ export class UriFactory let success = false; const regexp = new RegExp(pattern); - for (let key in UriFactory.uri) { + for (const key in UriFactory.uri) { if (UriFactory.uri.hasOwnProperty(key) && regexp.test(key)) { delete UriFactory.uri[key]; success = true; @@ -137,7 +137,7 @@ export class UriFactory } let pars = []; - for (let a in comps) { + for (const a in comps) { if (comps.hasOwnProperty(a)) { pars.push(a + '=' + comps[a]); } @@ -245,7 +245,7 @@ export class UriFactory const query = uri.getQuery(); - for (let key in query) { + for (const key in query) { if (query.hasOwnProperty(key)) { UriFactory.setQuery('?' + key, query[key]); } diff --git a/Utils/ArrayUtils.js b/Utils/ArrayUtils.js index 85d78d7..f01292a 100644 --- a/Utils/ArrayUtils.js +++ b/Utils/ArrayUtils.js @@ -28,7 +28,7 @@ let pathParts = jsOMS.ltrim(path, delim).split(delim); let current = data; - for (let key in pathParts) { + for (const key in pathParts) { if (!pathParts.hasOwnProperty(key)) { continue; } diff --git a/Utils/Debug.js b/Utils/Debug.js index 6b9dafc..d7cb368 100644 --- a/Utils/Debug.js +++ b/Utils/Debug.js @@ -80,7 +80,7 @@ validatePage = function(url) // analyze css usage let cssFound; - for (let i in cssSelectors) { + for (const i in cssSelectors) { try { cssFound = document.querySelectorAll(i.replace(/:hover|:active/gi, '')); cssSelectors[i] = cssFound === null ? 0 : cssFound.length diff --git a/Utils/GeneralUtils.js b/Utils/GeneralUtils.js index 12376cc..8372ab3 100644 --- a/Utils/GeneralUtils.js +++ b/Utils/GeneralUtils.js @@ -45,7 +45,7 @@ { const out = jsOMS.clone(target); - for (let p in source) { + for (const p in source) { if (source.hasOwnProperty(p)) { // Property in destination object set; update its value. if (typeof source[p] === 'object') { diff --git a/Utils/oLib.js b/Utils/oLib.js index ef2747f..6b2468c 100644 --- a/Utils/oLib.js +++ b/Utils/oLib.js @@ -57,7 +57,7 @@ const pathParts = jsOMS.ltrim(path, delim).split(delim); let current = data; - for (let key in pathParts) { + for (const key in pathParts) { if (!pathParts.hasOwnProperty(key)) { continue; } @@ -528,7 +528,7 @@ { const out = jsOMS.clone(target); - for (let p in source) { + for (const p in source) { if (source.hasOwnProperty(p)) { // Property in destination object set; update its value. if (typeof source[p] === 'object') { diff --git a/Views/FormView.js b/Views/FormView.js index 26ea002..9b35618 100644 --- a/Views/FormView.js +++ b/Views/FormView.js @@ -428,7 +428,7 @@ export class FormView } } - for (let key in data) { + for (const key in data) { if (data.hasOwnProperty(key)) { formData.append(key, data[key].constructor === Array ? JSON.stringify(data[key]) : data[key]); }