From ddad4072a2fc288553b854a650e1c9b8a4b8be7b Mon Sep 17 00:00:00 2001 From: Isidoro Ghezzi Date: Sat, 23 Mar 2024 15:27:42 +0100 Subject: [PATCH 1/4] xo --fix version 0.32.1 --- index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 0ce35d5..9db30fa 100644 --- a/index.js +++ b/index.js @@ -11,30 +11,30 @@ let gController = null; } }, keys: theObject => { - const ret = []; + const returnValue = []; for (const aProperty in theObject) { if (theObject.hasOwnProperty(aProperty)) { // eslint-disable-line no-prototype-builtins - ret.push(aProperty); + returnValue.push(aProperty); } } - return ret; + return returnValue; }, createElement(theTag, theProperties, theClassList) { - const ret = document.createElement(theTag); + const returnValue = document.createElement(theTag); if ((typeof undefined !== typeof theProperties) && (theProperties !== null)) { this.keys(theProperties).forEach(theProperty => { - ret[theProperty] = theProperties[theProperty]; + returnValue[theProperty] = theProperties[theProperty]; }); } if ((typeof undefined !== typeof theClassList) && (theClassList !== null)) { theClassList.forEach(theClass => { - ret.classList.add(theClass); + returnValue.classList.add(theClass); }); } - return ret; + return returnValue; } }; From 5608acf592e513758a194c77588be9a4bc8dc283 Mon Sep 17 00:00:00 2001 From: Isidoro Ghezzi Date: Sat, 23 Mar 2024 15:32:25 +0100 Subject: [PATCH 2/4] pm2-serve.sh --- pm2-serve.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 pm2-serve.sh diff --git a/pm2-serve.sh b/pm2-serve.sh new file mode 100644 index 0000000..1596c09 --- /dev/null +++ b/pm2-serve.sh @@ -0,0 +1 @@ +pm2 serve . 8081 --name satoshieuro-eurobitcoin_converter-8081 From 6058ea101f60f6e4e10684829581891d66352099 Mon Sep 17 00:00:00 2001 From: Isidoro Ghezzi Date: Sat, 23 Mar 2024 15:36:32 +0100 Subject: [PATCH 3/4] xo --fix version 0.58.0 --- index.js | 20 ++++++++++++-------- package.json | 8 ++++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 9db30fa..06eeba2 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,7 @@ let gController = null; alert('assertion failed'); // eslint-disable-line no-alert } }, - keys: theObject => { + keys(theObject) { const returnValue = []; for (const aProperty in theObject) { if (theObject.hasOwnProperty(aProperty)) { // eslint-disable-line no-prototype-builtins @@ -35,7 +35,7 @@ let gController = null; } return returnValue; - } + }, }; self.buttonDisable = function (theButton) { @@ -49,7 +49,7 @@ let gController = null; }; self.model = { - enabled: true + enabled: true, }; self.show = function () { @@ -60,12 +60,16 @@ let gController = null; aDOMLink.append(aDOMHref); const aAddress = '1ig1p1awfjS5bQxy2s33AD8sVspy4YFMD'; const aDOMBitcoin = self.util.createElement('div', {textContent: aAddress}, ['bitcoin']); - const aDOMQR = self.util.createElement('img', {src: aAddress + '.png', alt: aAddress, width: '200', height: '200'}); + const aDOMQR = self.util.createElement('img', { + src: aAddress + '.png', alt: aAddress, width: '200', height: '200', + }); [aDOMLink, aDOMQR, aDOMBitcoin].forEach(theDOM => { aDOMFooter.append(theDOM); }); - const aDOMInputSatoshiEuro = self.util.createElement('input', {type: 'text', value: '', maxlength: 30, size: 30}, ['input_text']); + const aDOMInputSatoshiEuro = self.util.createElement('input', { + type: 'text', value: '', maxlength: 30, size: 30, + }, ['input_text']); const aDOMWrapResult = self.util.createElement('div', null, ['wrap-result']); const aDOMLabelResult = self.util.createElement('span', {textContent: 'Result:'}); @@ -81,17 +85,17 @@ let gController = null; if (self.model.enabled === true) { self.model.enabled = false; self.buttonDisable(aDOMButtonConvert); - aDOMValueResult.textContent = 100000000 / aDOMInputSatoshiEuro.value; + aDOMValueResult.textContent = 100_000_000 / aDOMInputSatoshiEuro.value; setTimeout(() => { self.buttonEnable(aDOMButtonConvert); self.model.enabled = true; }, 1000); } - } + }, }, ['ig_button', 'normal']); [ - aDOMInputSatoshiEuro, aDOMButtonConvert, aDOMWrapResult, aDOMFooter + aDOMInputSatoshiEuro, aDOMButtonConvert, aDOMWrapResult, aDOMFooter, ].forEach(theDOM => { aDOMContainer.append(theDOM); }); diff --git a/package.json b/package.json index 27fbc79..88e225b 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,16 @@ "test": "xo" }, "devDependencies": { - "xo": "^0.32.1" + "xo": "^0.58.0" }, "xo": { "esnext": true, "space": false, - "rules": {}, + "rules": { + "unicorn/no-array-for-each": 0, + "unicorn/prefer-module": 0, + "unicorn/no-this-assignment": 0 + }, "semicolon": true, "envs": [ "browser", From e9f8146e65162132d3de9a07810d384c1646a135 Mon Sep 17 00:00:00 2001 From: Isidoro Ghezzi Date: Sat, 23 Mar 2024 15:39:00 +0100 Subject: [PATCH 4/4] Object.keys --- index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/index.js b/index.js index 06eeba2..f4c595e 100644 --- a/index.js +++ b/index.js @@ -11,14 +11,7 @@ let gController = null; } }, keys(theObject) { - const returnValue = []; - for (const aProperty in theObject) { - if (theObject.hasOwnProperty(aProperty)) { // eslint-disable-line no-prototype-builtins - returnValue.push(aProperty); - } - } - - return returnValue; + return Object.keys(theObject); }, createElement(theTag, theProperties, theClassList) { const returnValue = document.createElement(theTag);