function cache(target, key, descriptor) {
  if (descriptor.get) {
    var get = descriptor.get;
    descriptor.get = function () {
      var value = get.call(this);
      _Object$defineProperty(this, key, { value: value });
      return value;
    };
  } else if (typeof descriptor.value === 'function') {
    var fn = descriptor.value;

    return {
      get: function get() {
        var cache = new _Map();
        function memoized() {
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }

          var key = args.length > 0 ? args[0] : 'value';
          if (cache.has(key)) {
            return cache.get(key);
          }

          var result = fn.apply(this, args);
          cache.set(key, result);
          return result;
        };

        _Object$defineProperty(this, key, { value: memoized });
        return memoized;
      }
    };
  }
}
/**
 * This decorator caches the results of a getter or method such that
 * the results are lazily computed once, and then cached.
 * @private
 */
This decorator caches the results of a getter or method such that
the results are lazily computed once, and then cached.
@private
This decorator caches the results of a getter or method such that the results are lazily computed once and then cached . @private
function cache(target, key, descriptor) {
  if (descriptor.get) {
    var get = descriptor.get;
    descriptor.get = function () {
      var value = get.call(this);
      _Object$defineProperty(this, key, { value: value });
      return value;
    };
  } else if (typeof descriptor.value === 'function') {
    var fn = descriptor.value;
    return {
      get: function get() {
        var cache = new _Map();
        function memoized() {
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          var key = args.length > 0 ? args[0] : 'value';
          if (cache.has(key)) {
            return cache.get(key);
          }
          var result = fn.apply(this, args);
          cache.set(key, result);
          return result;
        };
        _Object$defineProperty(this, key, { value: memoized });
        return memoized;
      }
    };
  }
}
function cache ( target , key , descriptor ) { if ( descriptor . get ) { var get = descriptor . get ; descriptor . get = function ( ) { var value = get . call ( this ) ; _Object$defineProperty ( this , key , { value : value } ) ; return value ; } ; } else if ( typeof descriptor . value === 'function' ) { var fn = descriptor . value ; return { get : function get ( ) { var cache = new _Map ( ) ; function memoized ( ) { for ( var _len = arguments . length , args = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) { args [ _key ] = arguments [ _key ] ; } var key = args . length > 0 ? args [ 0 ] : 'value' ; if ( cache . has ( key ) ) { return cache . get ( key ) ; } var result = fn . apply ( this , args ) ; cache . set ( key , result ) ; return result ; } ; _Object$defineProperty ( this , key , { value : memoized } ) ; return memoized ; } } ; } }
This decorator caches the results of a getter or method such that
 the results are lazily computed once, and then cached.
This decorator caches the results of a getter or method such that the results are lazily computed once and then cached .