MCPcopy
hub / github.com/loopbackio/loopback-next / decorate

Method decorate

packages/metadata/src/reflect.ts:163–179  ·  view source on GitHub ↗
(
    decorators: (PropertyDecorator | MethodDecorator)[] | ClassDecorator[],
    target: Object,
    targetKey?: string | symbol,
    descriptor?: PropertyDescriptor,
  )

Source from the content-addressed store, hash-verified

161 ): PropertyDescriptor | Function;
162
163 decorate(
164 decorators: (PropertyDecorator | MethodDecorator)[] | ClassDecorator[],
165 target: Object,
166 targetKey?: string | symbol,
167 descriptor?: PropertyDescriptor,
168 ): PropertyDescriptor | Function {
169 if (targetKey) {
170 return Reflect.decorate(
171 <(PropertyDecorator | MethodDecorator)[]>decorators,
172 target,
173 targetKey,
174 descriptor,
175 );
176 } else {
177 return Reflect.decorate(<ClassDecorator[]>decorators, <Function>target);
178 }
179 }
180
181 metadata(
182 metadataKey: string,

Callers 1

reflect.unit.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected