dist/utilify.esm.js
function unserialize(str) {
        str = !validateHelpers.isString(str) ? window.location.href : str;

        if (str.indexOf('?') < 0) {
            return {};
        }

        str = str.indexOf('?') === 0 ? str.substr(1) : str.slice(str.indexOf('?') + 1);

        var query = {};
        var parts = str.split('&');

        for (var i = 0, len = parts.length; i < len; i += 1) {
            var part = parts[i].split('=');
            query[decodeURIComponent(part[0])] = decodeURIComponent(part[1] || '');
        }

        return query;
    }
function unserialize(str) {
        str = !validateHelpers.isString(str) ? window.location.href : str;

        if (str.indexOf('?') < 0) {
            return {};
        }

        str = str.indexOf('?') === 0 ? str.substr(1) : str.slice(str.indexOf('?') + 1);

        var query = {};
        var parts = str.split('&');

        for (var i = 0, len = parts.length; i < len; i += 1) {
            var part = parts[i].split('=');
            query[decodeURIComponent(part[0])] = decodeURIComponent(part[1] || '');
        }

        return query;
    }
function unserialize ( str ) { str = ! validateHelpers . isString ( str ) ? window . location . href : str ; if ( str . indexOf ( '?' ) < 0 ) { return { } ; } str = str . indexOf ( '?' ) === 0 ? str . substr ( 1 ) : str . slice ( str . indexOf ( '?' ) + 1 ) ; var query = { } ; var parts = str . split ( '&' ) ; for ( var i = 0 , len = parts . length ; i < len ; i += 1 ) { var part = parts [ i ] . split ( '=' ) ; query [ decodeURIComponent ( part [ 0 ] ) ] = decodeURIComponent ( part [ 1 ] || '' ) ; } return query ; }
Unserialize a query string into an object.

@category Global
@param {string} [str = actual url] - The string that will be converted into a object
@return {object}
@example
// str can be '?param1=foo&param2=bar&param3=baz', 'param1=foo&param2=bar&param3=baz' or a full url
// If no provided, will get actual url
var url = 'http://www.site.com?param1=foo&param2=bar&param3=baz';
unserialize(url); // {param1: 'foo', param2: 'bar', param3: 'baz'}
Unserialize a query string into an object .