Page Contents
Home > @loopback/metadata > MetadataInspector > getPropertyMetadata
MetadataInspector.getPropertyMetadata() method
Get the metadata associated with the given key for a given property of the target class or prototype
Signature:
static getPropertyMetadata<T>(key: MetadataKey<T, PropertyDecorator>, target: Object, propertyName: string, options?: InspectionOptions): T | undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | [MetadataKey](/doc/en/lb4/apidocs.metadata.metadatakey.html)<T, PropertyDecorator> | Metadata key |
| target | Object | Class for static properties or prototype for instance properties |
| propertyName | string | Property name |
| options | [InspectionOptions](/doc/en/lb4/apidocs.metadata.inspectionoptions.html) | _(Optional)_ Options for inspection |
Returns:
T | undefined