@bytekit/autofetch
Version:
A TypeScript-first, decorator-based HTTP client for building elegant and modular API clients with fetch under the hood. Inspired by Spring's `@RestClient` and OpenFeign.
11 lines (10 loc) • 518 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const constants_ts_1 = require("./constants.js");
const QueryParam = (options) => (target, propertyKey, parameterIndex) => {
const queryParams = Reflect.getMetadata(constants_ts_1.ClientConstants.QueryParams, target, propertyKey) ??
new Map();
queryParams.set(parameterIndex, options);
Reflect.defineMetadata(constants_ts_1.ClientConstants.QueryParams, queryParams, target, propertyKey);
};
exports.default = QueryParam;