Page Contents

Home > @loopback/metadata > DecoratorFactory > mergeWithInherited

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.

Signature:

protected mergeWithInherited(inheritedMetadata: M, target: Object, member?: string | symbol, descriptorOrIndex?: TypedPropertyDescriptor<any> | number): M;

Parameters

Parameter Type Description
inheritedMetadata M Metadata inherited from the base classes
target Object Decoration target
member string | symbol (Optional) Optional property or method
descriptorOrIndex TypedPropertyDescriptor<any> | number (Optional) Optional parameter index or method descriptor

Returns:

M