UNPKG

@moonwell-fi/moonwell-sdk

Version:

TypeScript Interface for Moonwell

25 lines 997 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWithRetry = getWithRetry; exports.postWithRetry = postWithRetry; const axios_1 = __importDefault(require("axios")); const retry_js_1 = require("./retry.js"); function getWithRetry(url, config) { if (config !== undefined) { return (0, retry_js_1.retry)(() => axios_1.default.get(url, config)); } return (0, retry_js_1.retry)(() => axios_1.default.get(url)); } function postWithRetry(url, data, config) { if (config !== undefined) { return (0, retry_js_1.retry)(() => axios_1.default.post(url, data, config)); } if (data !== undefined) { return (0, retry_js_1.retry)(() => axios_1.default.post(url, data)); } return (0, retry_js_1.retry)(() => axios_1.default.post(url)); } //# sourceMappingURL=axiosWithRetry.js.map