Decorator When Simple decorator for short-cutting method execution. Installation npm install decorator-when --save Usage import { when } from "decorator-when"; class Demo { @when(Demo.prototype.should) method() { s.apply(this, arguments); } should() { return Math.random() > 0.5; }} new Demo().method(); License MIT