UNPKG

nats-micro

Version:

NATS micro compatible extra-lightweight microservice library

13 lines 573 B
/* eslint-disable @typescript-eslint/no-explicit-any */ import { storage } from './storage.js'; export function method(options) { return (target, key, descriptor) => { if (!descriptor.value) throw new Error('Use method decorators only on class methods'); const storedMethod = storage.ensureClassMethodAdded(target, descriptor.value); // storedMethod.name = methodName; storedMethod.config = Object.assign(Object.assign({}, storedMethod.config), options); return descriptor; }; } //# sourceMappingURL=method.js.map