src/deparam.js
/**
 * Converts query string to JavaScript object
 * @param {string} qs query string argument (defaults to url query string)
 */
Converts query string to JavaScript object
@param {string} qs query string argument (defaults to url query string)
Converts query string to JavaScript object @param { string } qs query string argument ( defaults to url query string )
function deparam(qs, coerce) {
    qs = setDefault(qs, (isBrowser ? location.search : '')).trim();
    coerce = setDefault(coerce, true);
    qs = qs.substring(qs.charAt(0) === '?');
    const queryParamList = qs.split('&');
    const queryObject = {};
    if (qs) {
        queryParamList.forEach((qq) => {
            const qArr = qq.split('=').map(part => decodeURIComponent(part));
            if (ifComplex(qArr[0])) {
                complex.apply(this, [].concat(qArr).concat([queryObject, coerce]));
            } else {
                simple.apply(this, [qArr, queryObject, false, coerce]);
            }
        });
    }
    return queryObject;
}
function deparam ( qs , coerce ) { qs = setDefault ( qs , ( isBrowser ? location . search : '' ) ) . trim ( ) ; coerce = setDefault ( coerce , true ) ; qs = qs . substring ( qs . charAt ( 0 ) === '?' ) ; const queryParamList = qs . split ( '&' ) ; const queryObject = { } ; if ( qs ) { queryParamList . forEach ( ( qq ) => { const qArr = qq . split ( '=' ) . map ( part => decodeURIComponent ( part ) ) ; if ( ifComplex ( qArr [ 0 ] ) ) { complex . apply ( this , [ ] . concat ( qArr ) . concat ( [ queryObject , coerce ] ) ) ; } else { simple . apply ( this , [ qArr , queryObject , false , coerce ] ) ; } } ) ; } return queryObject ; }
Converts query string to JavaScript object
 @param {string} qs query string argument (defaults to url query string)
Converts query string to JavaScript object @param { string } qs query string argument ( defaults to url query string )