UNPKG

@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.

9 lines (8 loc) 395 B
import { ClientConstants } from "./constants.js"; const PathParam = (name) => (target, propertyKey, parameterIndex) => { const pathParams = Reflect.getMetadata(ClientConstants.PathParams, target, propertyKey) ?? new Map(); pathParams.set(parameterIndex, name); Reflect.defineMetadata(ClientConstants.PathParams, pathParams, target, propertyKey); }; export default PathParam;