diff --git a/lib/assets/javascripts/turbograft/csrf_token.js b/lib/assets/javascripts/turbograft/csrf_token.js index 55f0763..6321f4b 100644 --- a/lib/assets/javascripts/turbograft/csrf_token.js +++ b/lib/assets/javascripts/turbograft/csrf_token.js @@ -1,12 +1,6 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ window.CSRFToken = class CSRFToken { static get(doc) { - if (doc == null) { doc = document; } + if (!doc) { doc = document; } const tag = doc.querySelector('meta[name="csrf-token"]'); const object = { @@ -23,7 +17,7 @@ window.CSRFToken = class CSRFToken { static update(latest) { const current = this.get(); if ((current.token != null) && (latest != null) && (current.token !== latest)) { - return current.node.setAttribute('content', latest); + current.node.setAttribute('content', latest); } } };