Skip to main content

Function: createMethodDecorator()

createMethodDecorator(fn: MethodDecorator): MethodDecorator

Defined in: utils.ts:34

Utility to make a method decorator with lighter syntax and inferred types.

// Enumerable function
function enumerableMethod(value: boolean) {
return createMethodDecorator((_target, _propertyKey, descriptor) => {
descriptor.enumerable = value;
});
}

Parameters

ParameterTypeDescription
fnMethodDecoratorThe method to decorate

Returns

MethodDecorator