MCPcopy Create free account
hub / github.com/TruthHun/BookStack / buildParams

Function buildParams

static/wangEditor/js/lib/jquery-2.2.1.js:8924–8960  ·  view source on GitHub ↗
( prefix, obj, traditional, add )

Source from the content-addressed store, hash-verified

8922 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8923
8924function buildParams( prefix, obj, traditional, add ) {
8925 var name;
8926
8927 if ( jQuery.isArray( obj ) ) {
8928
8929 // Serialize array item.
8930 jQuery.each( obj, function( i, v ) {
8931 if ( traditional || rbracket.test( prefix ) ) {
8932
8933 // Treat each array item as a scalar.
8934 add( prefix, v );
8935
8936 } else {
8937
8938 // Item is non-scalar (array or object), encode its numeric index.
8939 buildParams(
8940 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8941 v,
8942 traditional,
8943 add
8944 );
8945 }
8946 } );
8947
8948 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
8949
8950 // Serialize object item.
8951 for ( name in obj ) {
8952 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8953 }
8954
8955 } else {
8956
8957 // Serialize scalar item.
8958 add( prefix, obj );
8959 }
8960}
8961
8962// Serialize an array of form elements or a set of
8963// key/values into a query string

Callers 1

jquery-2.2.1.jsFile · 0.70

Calls 1

addFunction · 0.70

Tested by

no test coverage detected