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 FormParam = (name) => (target, propertyKey, parameterIndex) => { const formParams = Reflect.getMetadata(ClientConstants.FormParams, target, propertyKey) ?? new Map(); formParams.set(parameterIndex, name); Reflect.defineMetadata(ClientConstants.FormParams, formParams, target, propertyKey); }; export default FormParam;