UNPKG

@zayne-labs/callapi

Version:

A lightweight wrapper over fetch with quality of life improvements like built-in request cancellation, retries, interceptors and more

28 lines (26 loc) 850 B
//#region src/types/type-helpers.ts const defineEnum = (value) => Object.freeze(value); //#endregion //#region src/constants/defaults.ts const extraOptionDefaults = Object.freeze(defineEnum({ bodySerializer: JSON.stringify, defaultHTTPErrorMessage: "Request failed unexpectedly", dedupeCacheScope: "local", dedupeCacheScopeKey: "default", dedupeStrategy: "cancel", hooksExecutionMode: "parallel", responseParser: JSON.parse, responseType: "json", resultMode: "all", retryAttempts: 0, retryCondition: () => true, retryDelay: 1e3, retryMaxDelay: 1e4, retryMethods: ["GET", "POST"], retryStatusCodes: [], retryStrategy: "linear" })); const requestOptionDefaults = defineEnum({ method: "GET" }); //#endregion export { requestOptionDefaults as n, defineEnum as r, extraOptionDefaults as t }; //# sourceMappingURL=defaults-B-dOt2Dd.js.map