docs: function flatten(obj) {
    var params = {};
  
    forEach(obj || {}, function (val, key) {
      if (val && typeof val === 'object') {
        forEach(flatten(val), function (sub_val, sub_key) {
          params[key + '.' + sub_key] = sub_val;
        });
        return;
      }
  
      params[key] = val;
    });
  
    return params;
  }