docs: function resolveType(type) {
  
      if (typeof type !== 'object') {
        throw new Error('Type definition must be an object. Illegal value: ' + type);
      }
  
      var parent = types[type.type];
  
      while (parent && !type.resolved) {
        resolveType(parent);
  
        _.defaults(type, JSON.parse(JSON.stringify(parent)));
        type.write = type.write || parent.write;
        type.read = type.read || parent.read;
        type.type = parent.type; // Always switch to the parent's type.
        parent = types[type.type];
      }
  
    }