import { fetch } from '../vendor/fetch' import { Api, api as defaultApi } from '../api' const fetchAbstraction = (url: string, api: Api = defaultApi): Promise => { const headers: Headers = new Headers() headers.append('Content-Type', 'application/json') if (api.token) headers.append('X-Auth-Token', api.token) return fetch(url, { headers, }) } export { fetchAbstraction as fetch, }