encodeReservedChars = function (str, encodeEquals) {
        if (!str) {
            return str;
        }

        // eslint-disable-next-line lodash/prefer-includes
        str.indexOf(AMPERSAND) !== -1 && (str = str.replace(REGEX_AMPERSAND, '%26'));

        // eslint-disable-next-line lodash/prefer-includes
        str.indexOf(HASH) !== -1 && (str = str.replace(REGEX_HASH, '%23'));

        // eslint-disable-next-line lodash/prefer-includes
        encodeEquals && str.indexOf(EQUALS) !== -1 && (str = str.replace(REGEX_EQUALS, '%3D'));

        return str;
    }
Percent encode reserved chars (&, = and #) in the given string.

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