UNPKG

simple-fetch-ts

Version:

`simple-fetch-ts` is a TypeScript library designed to simplify HTTP requests using a builder-pattern approach. It provides a fluent API for creating, configuring, and executing various HTTP methods (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) with type safet

11 lines (10 loc) 453 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.simpleFetch = void 0; const fetch_1 = require("../methods/fetch"); const simpleFetch = async (url, requestHeaders = {}) => { var _a; const response = await (0, fetch_1.tsFetch)(url, requestHeaders); return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : null; }; exports.simpleFetch = simpleFetch;