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

14 lines (13 loc) 489 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.simple = void 0; const builder_1 = require("../builder"); const url_validation_error_1 = require("../errors/url-validation-error"); const url_helpers_1 = require("../utility/url-helpers"); const simple = (url) => { if (!(0, url_helpers_1.isValidURL)(url)) { throw new url_validation_error_1.InvalidURLError(url); } return new builder_1.SimpleBuilder(url); }; exports.simple = simple;