Page Contents

Home > @loopback/metadata > MetadataInspector > getMethodMetadata

MetadataInspector.getMethodMetadata() method

Get the metadata associated with the given key for a given method of the target class or prototype


static getMethodMetadata<T>(key: MetadataKey<T, MethodDecorator>, target: Object, methodName?: string, options?: InspectionOptions): T | undefined;


Parameter Type Description
key MetadataKey<T, MethodDecorator> Metadata key
target Object Class for static methods or prototype for instance methods
methodName string (Optional) Method name. If not present, default to ‘’ to use the constructor
options InspectionOptions (Optional) Options for inspection


T | undefined