lib/collection/query-param.js
function (param, idx, all) {
        // helps handle weird edge cases such as "/get?a=b&&"
        if (param === EMPTY && // if param is empty
            _.isNumber(idx) && // this and the next condition ensures that this is part of a map call
            _.isArray(all) &&
            idx !== (all && (all.length - 1))) { // not last parameter in the array
            return { key: null, value: null };
        }

        var index = (typeof param === STRING) ? param.indexOf(EQUALS) : -1,
            paramObj = {};

        // this means that there was no value for this key (not even blank, so we store this info) and the value is set
        // to null
        if (index < 0) {
            paramObj.key = param.substr(0, param.length);
            paramObj.value = null;
        }
        else {
            paramObj.key = param.substr(0, index);
            paramObj.value = param.substr(index + 1);
        }

        return paramObj;
    }
function (param, idx, all) {
        // helps handle weird edge cases such as "/get?a=b&&"
        if (param === EMPTY && // if param is empty
            _.isNumber(idx) && // this and the next condition ensures that this is part of a map call
            _.isArray(all) &&
            idx !== (all && (all.length - 1))) { // not last parameter in the array
            return { key: null, value: null };
        }

        var index = (typeof param === STRING) ? param.indexOf(EQUALS) : -1,
            paramObj = {};

        // this means that there was no value for this key (not even blank, so we store this info) and the value is set
        // to null
        if (index < 0) {
            paramObj.key = param.substr(0, param.length);
            paramObj.value = null;
        }
        else {
            paramObj.key = param.substr(0, index);
            paramObj.value = param.substr(index + 1);
        }

        return paramObj;
    }
function ( param , idx , all ) { // helps handle weird edge cases such as "/get?a=b&&" if ( param === EMPTY && // if param is empty _ . isNumber ( idx ) && // this and the next condition ensures that this is part of a map call _ . isArray ( all ) && idx !== ( all && ( all . length - 1 ) ) ) { // not last parameter in the array return { key : null , value : null } ; } var index = ( typeof param === STRING ) ? param . indexOf ( EQUALS ) : - 1 , paramObj = { } ; // this means that there was no value for this key (not even blank, so we store this info) and the value is set // to null if ( index < 0 ) { paramObj . key = param . substr ( 0 , param . length ) ; paramObj . value = null ; } else { paramObj . key = param . substr ( 0 , index ) ; paramObj . value = param . substr ( index + 1 ) ; } return paramObj ; }
Parses a single query parameter.

@param {String} param
@param {Number} idx
@param {String[]} all - array of all params, in case this is being called while parsing multiple params.
@returns {{key: string|null, value: string|null}}
Parses a single query parameter .