Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return keyValues.reduce((acc, curr, i) => {
const val = keyValues[i].split('=')
const key = val[0].split('.').pop()
if (keyMap[key]) {
acc[`${keyMap[key]}`] = decodeUri(val[1])
} else if (typeof curr[key] === 'undefined') {
acc[key] = decodeUri(val[1])
}
return acc
}, {})
}