@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) • 379 B
JavaScript
import { ClientConstants } from "./constants.js";
const BodyParam = (target, propertyKey, parameterIndex) => {
const bodyParams = Reflect.getMetadata(ClientConstants.BodyParams, target, propertyKey) ??
new Set();
bodyParams.add(parameterIndex);
Reflect.defineMetadata(ClientConstants.BodyParams, bodyParams, target, propertyKey);
};
export default BodyParam;