daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jan 15th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export function Required(target: object, propertyKey: string) {
  2.   console.log('required ....');
  3.   Object.defineProperty(target, propertyKey, {
  4.     get () {
  5.       throw new Error(`Attribute ${propertyKey} is required`);
  6.     },
  7.     set (value) {
  8.       Object.defineProperty(target, propertyKey, { value, writable: true, configurable: true });
  9.     },
  10.   });
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top