decryptQueryParams help needed

function decryptQueryParams(req, res, next)
{

for (let q in req.query) {

    let data = req.query[q]
    data = data.replace(/([a-z]+)|([A-Z]+)/g, function(match, chr) {
        return chr ? match.toUpperCase() : match.toLowerCase();
    })
}
next()

}

I wrote this. But this doesn’t seem to work. Can you help?
Encryption works fine. Unable to decrypt in middleware

Please send the encryption function

Oh I fixed it myself. Thank you anyway!