Skip to content

Commit

Permalink
refactor: Simplify tests and comply with StandardJS style (#5026)
Browse files Browse the repository at this point in the history
* refactor: Simplify tests and comply with StandardJS style

Use === instead of ==, except where it's used to match both null and
undefined.

* style: further tweaks
  • Loading branch information
jennifer-richards committed Jan 25, 2023
1 parent 61f7984 commit 040af97
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ietf/static/js/document_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ document.addEventListener("DOMContentLoaded", function (event) {

const val = in_localStorage.includes(btn.name) ?
localStorage.getItem(btn.name) : cookies.get(btn.name);
if (val == id || ((val == undefined || val == null) &&
btn_pref[btn.name] == id)) {
if (val === id || (val === null && btn_pref[btn.name] === id)) {
btn.checked = true;
}

Expand Down

0 comments on commit 040af97

Please sign in to comment.