@loopback/docs
Version:
Documentation for LoopBack 4
39 lines (25 loc) • 1.54 kB
Markdown
---
lang: en
title: 'API docs: metadata.decoratorfactory.mergewithinherited'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.metadata.decoratorfactory.mergewithinherited.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/metadata](./metadata.md) > [DecoratorFactory](./metadata.decoratorfactory.md) > [mergeWithInherited](./metadata.decoratorfactory.mergewithinherited.md)
## DecoratorFactory.mergeWithInherited() method
This method is called by the default implementation of the decorator function to merge the spec argument from the decoration with the inherited metadata for a class, all properties, all methods, or all method parameters that are decorated by this decorator.
It MUST be overridden by subclasses to process inherited metadata.
<b>Signature:</b>
```typescript
protected mergeWithInherited(inheritedMetadata: M, target: Object, member?: string | symbol, descriptorOrIndex?: TypedPropertyDescriptor<any> | number): M;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| inheritedMetadata | <code>M</code> | Metadata inherited from the base classes |
| target | <code>Object</code> | Decoration target |
| member | <code>string | symbol</code> | Optional property or method |
| descriptorOrIndex | <code>TypedPropertyDescriptor<any> | number</code> | Optional parameter index or method descriptor |
<b>Returns:</b>
`M`