MCPcopy
hub / github.com/mongodb/node-mongodb-native / buildParams

Function buildParams

docs/2.2/js/jquery.js:7527–7553  ·  view source on GitHub ↗
( prefix, obj, traditional, add )

Source from the content-addressed store, hash-verified

7525};
7526
7527function buildParams( prefix, obj, traditional, add ) {
7528 var name;
7529
7530 if ( jQuery.isArray( obj ) ) {
7531 // Serialize array item.
7532 jQuery.each( obj, function( i, v ) {
7533 if ( traditional || rbracket.test( prefix ) ) {
7534 // Treat each array item as a scalar.
7535 add( prefix, v );
7536
7537 } else {
7538 // Item is non-scalar (array or object), encode its numeric index.
7539 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7540 }
7541 });
7542
7543 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
7544 // Serialize object item.
7545 for ( name in obj ) {
7546 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7547 }
7548
7549 } else {
7550 // Serialize scalar item.
7551 add( prefix, obj );
7552 }
7553}
7554jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
7555 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7556 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {

Callers 1

jquery.jsFile · 0.70

Calls 2

testMethod · 0.80
addFunction · 0.70

Tested by

no test coverage detected