code: function hash_serializer(result, key, value) {
    var matches = key.match(brackets);
  
    // Has brackets? Use the recursive assignment function to walk the keys,
    // construct any missing objects in the result tree and make the assignment
    // at the end of the chain.
    if (matches) {
      var keys = parse_keys(key);
      hash_assign(result, keys, value);
    }
    else {
      // Non bracket notation can make assignments directly.
      var existing = result[key];
  
      // If the value has been assigned already (for instance when a radio and
      // a checkbox have the same name attribute) convert the previous value
      // into an array before pushing into it.
      //
      // NOTE: If this requirement were removed all hash creation and
      // assignment could go through `hash_assign`.
      if (existing) {
        if (!Array.isArray(existing)) {
          result[key] = [ existing ];
        }
  
        result[key].push(value);
      }
      else {
        result[key] = value;
      }
    }
  
    return result;
  }
docs: Object/hash encoding serializer.