import 'reflect-metadata'; /** * Automatically execute method on plugin initialization */ export function Auto() { return ( target: any, propertyKey: string, descriptor: PropertyDescriptor, ) => { let autorunners: Array = Reflect.getMetadata('sb:autorunners', target); if (!autorunners) { Reflect.defineMetadata('sb:autorunners', autorunners = [], target); } autorunners.push(propertyKey); return descriptor; }; }