Page Contents

Home > @loopback/metadata > DecoratorFactory > _createDecorator

DecoratorFactory._createDecorator() method

Create a decorator function

Signature:

protected static _createDecorator<S, MT extends S | MetadataMap<S> | MetadataMap<S[]>, DT extends DecoratorType>(key: MetadataKey<S, DT>, spec: S, options?: DecoratorOptions): DT;

Parameters

Parameter Type Description
key MetadataKey<S, DT> Metadata key
spec S Metadata object from the decorator function
options DecoratorOptions (Optional) Options for the decorator

Returns:

DT