if ( val === undefined || val === null || val === '' ) {
return '';
}
+ /* jshint latedef:false */
return pre + ( raw ? val : mw.Uri.encode( val ) ) + post;
+ /* jshint latedef:true */
}
/**
* @param {boolean} [options.overrideKeys=false] Whether to let duplicate query parameters
* override each other (`true`) or automagically convert them to an array (`false`).
*/
+ /* jshint latedef:false */
function Uri( uri, options ) {
var prop,
defaultUri = getDefaultUri();
// Only copy direct properties, not inherited ones
if ( uri.hasOwnProperty( prop ) ) {
// Deep copy object properties
- if ( $.isArray( uri[prop] ) || $.isPlainObject( uri[prop] ) ) {
- this[prop] = $.extend( true, {}, uri[prop] );
+ if ( $.isArray( uri[ prop ] ) || $.isPlainObject( uri[ prop ] ) ) {
+ this[ prop ] = $.extend( true, {}, uri[ prop ] );
} else {
- this[prop] = uri[prop];
+ this[ prop ] = uri[ prop ];
}
}
}
this.port = defaultUri.port;
}
}
- if ( this.path && this.path[0] !== '/' ) {
+ if ( this.path && this.path[ 0 ] !== '/' ) {
// A real relative URL, relative to defaultUri.path. We can't really handle that since we cannot
// figure out whether the last path component of defaultUri.path is a directory or a file.
throw new Error( 'Bad constructor arguments' );