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) 374 B
import { ClientConstants } from "./constants.js"; const Init = (target, propertyKey, parameterIndex) => { const initOptions = Reflect.getMetadata(ClientConstants.InitOptions, target, propertyKey) ?? new Set(); initOptions.add(parameterIndex); Reflect.defineMetadata(ClientConstants.InitOptions, initOptions, target, propertyKey); }; export default Init;