demo/script/main.js
function collect(what, which) {
    var res = {};
    while (what) {
      res = Object.assign({}, what[which], res); // Respect prototype priority
      what = Object.getPrototypeOf(what);
    }
    return res;
  }
function collect(what, which) {
    var res = {};
    while (what) {
      res = Object.assign({}, what[which], res); // Respect prototype priority
      what = Object.getPrototypeOf(what);
    }
    return res;
  }
function collect ( what , which ) { var res = { } ; while ( what ) { res = Object . assign ( { } , what [ which ] , res ) ; // Respect prototype priority what = Object . getPrototypeOf ( what ) ; } return res ; }
Merges a property's object value using the defaults way.

@private
@param {Object} what Initial prototype
@param {String} which Property to collect.
@return {Object} the collected values
Merges a property s object value using the defaults way .