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

Signature:

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

Parameters

Parameter Type Description
key [MetadataKey](/doc/en/lb4/apidocs.metadata.metadatakey.html)<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](/doc/en/lb4/apidocs.metadata.inspectionoptions.html) _(Optional)_ Options for inspection

Returns:

T | undefined