1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1× 1× 1× 6× 3× 3× 3× | import "reflect-metadata"; import { TIMEOUT } from "./_metadata-keys"; export function Timeout(timeoutInMs: number) { if (timeoutInMs <= 0) { throw new RangeError("Timeout period must be greater than 0."); } return (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) => { Reflect.defineMetadata(TIMEOUT, timeoutInMs, target, propertyKey); }; } |