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
21 lines (20 loc) • 870 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidQueryParamObjectError = exports.InvalidQueryParamError = void 0;
class InvalidQueryParamError extends Error {
constructor(key, value) {
super(`Invalid query parameter value for key "${key}": "${value}". Only strings, numbers, or arrays of these are allowed.`);
this.name = "InvalidQueryParamError";
this.key = key;
this.value = value;
}
}
exports.InvalidQueryParamError = InvalidQueryParamError;
class InvalidQueryParamObjectError extends Error {
constructor(params) {
super(`Invalid argument pased to validateQueryParams: "${params}". Only plain objects allowed.`);
this.name = "InvalidQueryParamObjectError";
this.params = params;
}
}
exports.InvalidQueryParamObjectError = InvalidQueryParamObjectError;