code: function pieceParser (eq, unesc) {
    return function parsePiece (key, val) {
      if (arguments.length !== 2) {
        // key=val, called from the map/reduce
        key = key.split(eq);
        return parsePiece(
          unesc(key.shift()),
          unesc(key.join(eq))
        );
      }
      key = key.replace(/^\s+|\s+$/g, '');
      if (braintree_util.isString(val)) {
        val = val.replace(/^\s+|\s+$/g, '');
        // convert numerals to numbers
        if (!isNaN(val)) {
          var numVal = +val;
          if (val === numVal.toString(10)) val = numVal;
        }
      }
      var sliced = /(.*)\[([^\]]*)\]$/.exec(key);
      if (!sliced) {
        var ret = {};
        if (key) ret[key] = val;
        return ret;
      }
      // ["foo[][bar][][baz]", "foo[][bar][]", "baz"]
      var tail = sliced[2],
        head = sliced[1];
  
      // array: key[]=val
      if (!tail) return parsePiece(head, [val]);
  
      // obj: key[subkey]=val
      var ret = {};
      ret[tail] = val;
      return parsePiece(head, ret);
    };
  }
docs: Parse a key=val string. These can get pretty hairy example flow: parse(foo[bar][][bla]=baz) return parse(foo[bar][][bla],"baz") return parse(foo[bar][], {bla : "baz"}) return parse(foo[bar], [{bla:"baz"}]) return parse(foo, {bar:[{bla:"baz"}]}) return {foo:{bar:[{bla:"baz"}]}}