@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
37 lines (24 loc) • 1.03 kB
Markdown
lang: en
title: 'API docs: metadata.namespacedreflect.hasmetadata'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/metadata
permalink: /doc/en/lb4/apidocs.metadata.namespacedreflect.hasmetadata.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/metadata](./metadata.md) > [NamespacedReflect](./metadata.namespacedreflect.md) > [hasMetadata](./metadata.namespacedreflect.hasmetadata.md)
## NamespacedReflect.hasMetadata() method
Check if the target has corresponding metadata
<b>Signature:</b>
```typescript
hasMetadata(metadataKey: string, target: Object, propertyKey?: string): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| metadataKey | string | Key |
| target | Object | Target |
| propertyKey | string | Optional property key |
<b>Returns:</b>
boolean