UNPKG

@bluefin-exchange/bluefin7k-aggregator-sdk

Version:
17 lines (16 loc) 472 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchClient = fetchClient; const index_1 = require("./index"); async function fetchClient(input, init) { const headers = new Headers(init?.headers); const apiKey = (index_1.Config.getApiKey() || "").trim(); if (apiKey) { headers.set("apiKey", apiKey); } const modifiedInit = { ...init, headers, }; return fetch(input, modifiedInit); }