mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
refactor: drop eslint config love (#1341)
* Drop eslint config love * More eqeqeq * Even more
This commit is contained in:
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}return"function"==typeof SuppressedError&&SuppressedError,e.fetch=async function(e,r){const n=r?.maxRedirections,a=r?.connectTimeout,i=r?.proxy;null!=r&&(delete r.maxRedirections,delete r.connectTimeout,delete r.proxy);const s=r?.signal,o=(null==r?.headers?[]:r.headers instanceof Headers?Array.from(r.headers.entries()):Array.isArray(r.headers)?r.headers:Object.entries(r.headers)).map((([e,t])=>[e,"string"==typeof t?t:t.toString()])),d=new Request(e,r),u=await d.arrayBuffer(),c=0!==u.byteLength?Array.from(new Uint8Array(u)):null,_=await t("plugin:http|fetch",{clientConfig:{method:d.method,url:d.url,headers:o,data:c,maxRedirections:n,connectTimeout:a,proxy:i}});s?.addEventListener("abort",(()=>{t("plugin:http|fetch_cancel",{rid:_})}));const{status:l,statusText:f,url:h,headers:p,rid:y}=await t("plugin:http|fetch_send",{rid:_}),T=await t("plugin:http|fetch_read_body",{rid:y}),w=new Response(T instanceof ArrayBuffer&&0!==T.byteLength?T:T instanceof Array&&T.length>0?new Uint8Array(T):null,{headers:p,status:l,statusText:f});return Object.defineProperty(w,"url",{value:h}),w},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}return"function"==typeof SuppressedError&&SuppressedError,e.fetch=async function(e,r){const n=r?.maxRedirections,a=r?.connectTimeout,i=r?.proxy;r&&(delete r.maxRedirections,delete r.connectTimeout,delete r.proxy);const s=r?.signal,o=(r?.headers?r.headers instanceof Headers?Array.from(r.headers.entries()):Array.isArray(r.headers)?r.headers:Object.entries(r.headers):[]).map((([e,t])=>[e,"string"==typeof t?t:t.toString()])),d=new Request(e,r),c=await d.arrayBuffer(),u=0!==c.byteLength?Array.from(new Uint8Array(c)):null,_=await t("plugin:http|fetch",{clientConfig:{method:d.method,url:d.url,headers:o,data:u,maxRedirections:n,connectTimeout:a,proxy:i}});s?.addEventListener("abort",(()=>{t("plugin:http|fetch_cancel",{rid:_})}));const{status:f,statusText:h,url:p,headers:l,rid:y}=await t("plugin:http|fetch_send",{rid:_}),T=await t("plugin:http|fetch_read_body",{rid:y}),w=new Response(T instanceof ArrayBuffer&&0!==T.byteLength?T:T instanceof Array&&T.length>0?new Uint8Array(T):null,{headers:l,status:f,statusText:h});return Object.defineProperty(w,"url",{value:p}),w},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})}
|
||||
|
||||
@@ -107,7 +107,7 @@ export async function fetch(
|
||||
const proxy = init?.proxy;
|
||||
|
||||
// Remove these fields before creating the request
|
||||
if (init != null) {
|
||||
if (init) {
|
||||
delete init.maxRedirections;
|
||||
delete init.connectTimeout;
|
||||
delete init.proxy;
|
||||
@@ -115,14 +115,13 @@ export async function fetch(
|
||||
|
||||
const signal = init?.signal;
|
||||
|
||||
const headers =
|
||||
init?.headers == null
|
||||
? []
|
||||
: init.headers instanceof Headers
|
||||
? Array.from(init.headers.entries())
|
||||
: Array.isArray(init.headers)
|
||||
? init.headers
|
||||
: Object.entries(init.headers);
|
||||
const headers = init?.headers
|
||||
? init.headers instanceof Headers
|
||||
? Array.from(init.headers.entries())
|
||||
: Array.isArray(init.headers)
|
||||
? init.headers
|
||||
: Object.entries(init.headers)
|
||||
: [];
|
||||
|
||||
const mappedHeaders: Array<[string, string]> = headers.map(([name, val]) => [
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user