diff options
Diffstat (limited to '')
-rw-r--r-- | docusaurus/static/ajax/libs/wolfree/23.7.8/js/AJAX.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/docusaurus/static/ajax/libs/wolfree/23.7.8/js/AJAX.js b/docusaurus/static/ajax/libs/wolfree/23.7.8/js/AJAX.js deleted file mode 100644 index 465787d..0000000 --- a/docusaurus/static/ajax/libs/wolfree/23.7.8/js/AJAX.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - */ - -// @ts-check - -import SearchParams from "./SearchParams.js"; - -export default class AJAX { - ajax = async ({ - input = String(), - i2d = Boolean(), - extraPodstates = Array(), - } = {}) => { - try { - const data = new SearchParams().getSearchParams({ - input, - extraPodstates, - i2d, - }); - - const options = { - url: "https://api.wolframalpha.com/v2/query", - dataType: "jsonp", - traditional: true, - data, - }; - - try { - /** - * https://www.npmjs.com/package/@types/jquery - * @type {import('jQuery')} - */ - const response = await jQuery.ajax(options); - return ( - console.assert(response instanceof Object), - console.assert(response.hasOwnProperty("queryresult")), - { response } - ); - } catch (error) { - return ( - console.error( - { error }, - "We encountered an issue while attempting to retrieve a response from the Wolfram Alpha API using the jQuery library." - ), - { error } - ); - } - } catch (error) { - return console.error({ error }), { error }; - } - }; -} |