@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) • 505 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const constants_ts_1 = require("./constants.js");
const PathParam = (name) => (target, propertyKey, parameterIndex) => {
const pathParams = Reflect.getMetadata(constants_ts_1.ClientConstants.PathParams, target, propertyKey) ??
new Map();
pathParams.set(parameterIndex, name);
Reflect.defineMetadata(constants_ts_1.ClientConstants.PathParams, pathParams, target, propertyKey);
};
exports.default = PathParam;