diff options
| author | olekstomek <olekstomek@gmail.com> | 2021-07-27 00:46:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-26 15:46:21 -0700 |
| commit | cd2bc2e3c2117638a79b71791a415d9f77df2fc6 (patch) | |
| tree | fec413de91f82c64c3d181bdada1093698621195 /src/components | |
| parent | 981bbac7ff97127ae073fb410b52859fcc11b79b (diff) | |
fix for loop to for-of - SonarLint warning (#112)
* fix for loop to for-of - SonarLint warning
* just remove empty line
* improvement the loop that builds values for qr code
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Card.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/Card.js b/src/components/Card.js index 4e7b0de..f0943e2 100644 --- a/src/components/Card.js +++ b/src/components/Card.js | |||
| @@ -18,14 +18,13 @@ export const Card = ({ direction = 'ltr' }) => { | |||
| 18 | const needsEscape = ['"', ';', ',', ':', '\\']; | 18 | const needsEscape = ['"', ';', ',', ':', '\\']; |
| 19 | 19 | ||
| 20 | let escaped = ''; | 20 | let escaped = ''; |
| 21 | for (let i = 0; i < v.length; i++) { | 21 | for (const c of v) { |
| 22 | let c = v[i]; | ||
| 23 | if (needsEscape.includes(c)) { | 22 | if (needsEscape.includes(c)) { |
| 24 | c = '\\' + c; | 23 | escaped += `\\${c}`; |
| 24 | } else { | ||
| 25 | escaped += c; | ||
| 25 | } | 26 | } |
| 26 | escaped += c; | ||
| 27 | } | 27 | } |
| 28 | |||
| 29 | return escaped; | 28 | return escaped; |
| 30 | }; | 29 | }; |
| 31 | 30 | ||
