pretty.js
/* The search includes the question mark at the start */
The search includes the question mark at the start
The search includes the question mark at the start
function prettySearch(value) {
    var params = new URLSearchParams(value);
    var result = "";
    var previous = false;
    for (var [name, value] of params) {
        if (!value) {
            result += previous ? ` & ${name}` : name;
        } else {
            result += previous ? ` & ${name} = ${value}` : `${name} = ${value}`;
        }
        previous = true;
    }
    return value ? `? ${result}` : "";
}
function prettySearch ( value ) { var params = new URLSearchParams ( value ) ; var result = "" ; var previous = false ; for ( var [ name , value ] of params ) { if ( ! value ) { result += previous ? ` ${ name } ` : name ; } else { result += previous ? ` ${ name } ${ value } ` : ` ${ name } ${ value } ` ; } previous = true ; } return value ? ` ${ result } ` : "" ; }
The search includes the question mark at the start
The search includes the question mark at the start