function _(key: string, value: any | null | undefined = undefined): any | null { const x = window; if (value !== undefined) { x[key] = value; } return x[key]; } function $(id: string): HTMLElement | null { return document.getElementById(id); } async function authorizedFetch(method: string, uri: string, body: any): Promise { const headers = new Headers() headers.set('Authorization', 'Bearer ' + _("skey")) return await fetch(uri, { method: method, headers: headers, body: body, }) } export default { _, $, authorizedFetch }