From 04d167c9e0c046bbaa33412f91d16ad604f65773 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 6 Jan 2024 15:50:23 +0100 Subject: [PATCH] Sanity-check decaffeinate ajax --- assets/javascripts/lib/ajax.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/assets/javascripts/lib/ajax.js b/assets/javascripts/lib/ajax.js index 20e420eb..2445cc96 100644 --- a/assets/javascripts/lib/ajax.js +++ b/assets/javascripts/lib/ajax.js @@ -1,19 +1,9 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS205: Consider reworking code to avoid use of IIFEs - * DS207: Consider shorter variations of null checks - * DS208: Avoid top-level this - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ const MIME_TYPES = { json: "application/json", html: "text/html", }; -this.ajax = function (options) { +function ajax(options) { applyDefaults(options); serializeData(options); @@ -30,7 +20,7 @@ this.ajax = function (options) { } else { return parseResponse(xhr, options); } -}; +} ajax.defaults = { async: true,