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](/doc/en/lb4/apidocs.metadata.metadatakey.html)<S, DT> Metadata key
spec S Metadata object from the decorator function
options [DecoratorOptions](/doc/en/lb4/apidocs.metadata.decoratoroptions.html) _(Optional)_ Options for the decorator

Returns:

DT