Unified · Split
| @@ -1,13 +1,3 @@ | ||
| 1 | −// TODO: This file was created by bulk-decaffeinate. | |
| 2 | −// Sanity-check the conversion and remove this comment. | |
| 3 | −/* | |
| 4 | − * decaffeinate suggestions: | |
| 5 | − * DS101: Remove unnecessary use of Array.from | |
| 6 | − * DS102: Remove unnecessary code created because of implicit returns | |
| 7 | − * DS206: Consider reworking classes to avoid initClass | |
| 8 | − * DS207: Consider shorter variations of null checks | |
| 9 | − * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md | |
| 10 | − */ | |
| 11 | 1 | // Intentionally called CookiesStore instead of CookieStore |
| 12 | 2 | // Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome |
| 13 | 3 | // Related issue: https://github.com/freeCodeCamp/devdocs/issues/932 |
| @@ -53,7 +43,7 @@ class CookiesStore { · 39 unmodified lines | ||
| 53 | 43 | |
| 54 | 44 | reset() { |
| 55 | 45 | try { |
| 56 | − for (var cookie of Array.from(document.cookie.split(/;\s?/))) { | |
| 46 | + for (var cookie of document.cookie.split(/;\s?/)) { | |
| 57 | 47 | Cookies.expire(cookie.split("=")[0]); |
| 58 | 48 | } |
| 59 | 49 | return; |
| @@ -62,7 +52,7 @@ class CookiesStore { · 2 unmodified lines | ||
| 62 | 52 | |
| 63 | 53 | dump() { |
| 64 | 54 | const result = {}; |
| 65 | − for (var cookie of Array.from(document.cookie.split(/;\s?/))) { | |
| 55 | + for (var cookie of document.cookie.split(/;\s?/)) { | |
| 66 | 56 | if (cookie[0] !== "_") { |
| 67 | 57 | cookie = cookie.split("="); |
| 68 | 58 | result[cookie[0]] = cookie[1]; |