normalizeParam = function (str, encodeEquals) {
        // bail out if the given sting is null or empty
        if (!(str && typeof str === STRING)) {
            return str;
        }

        // bail out if the given string does not include reserved chars
        // eslint-disable-next-line lodash/prefer-includes
        if (str.indexOf(AMPERSAND) === -1 && str.indexOf(HASH) === -1) {
            // eslint-disable-next-line lodash/prefer-includes
            if (!(encodeEquals && str.indexOf(EQUALS) !== -1)) {
                return str;
            }
        }

        var normalizedString = '',
            pointer = 0,
            variable,
            match,
            index;

        // find all the instances of {{<variable>}} which includes reserved chars
        while ((match = REGEX_EXTRACT_VARS.exec(str)) !== null) {
            variable = match[0];
            index = match.index;

            // [pointer, index) string is normalized + the matched variable
            normalizedString += encodeReservedChars(str.slice(pointer, index), encodeEquals) + variable;

            // update the pointer
            pointer = index + variable.length;
        }

        // whatever left in the string is normalized as well
        if (pointer < str.length) {
            normalizedString += encodeReservedChars(str.slice(pointer), encodeEquals);
        }

        return normalizedString;
    }
Normalize the given param string by percent-encoding the reserved chars
such that it won't affect the re-parsing.

@note `&`, `=` and `#` needs to be percent-encoded otherwise re-parsing
the same URL string will generate different output

@private
@param {String} str -
@param {Boolean} encodeEquals -
@returns {String}