@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.
8 lines (7 loc) • 427 B
JavaScript
import { ClientConstants } from "./constants.js";
const URLEncodedFormParam = (name) => (target, propertyKey, parameterIndex) => {
const formParams = Reflect.getMetadata(ClientConstants.URLEncodedFormParams, target, propertyKey) ?? new Map();
formParams.set(parameterIndex, name);
Reflect.defineMetadata(ClientConstants.URLEncodedFormParams, formParams, target, propertyKey);
};
export default URLEncodedFormParam;