How to use the analytics-utils.decodeUri function in analytics-utils

To help you get started, we’ve selected a few analytics-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DavidWells / analytics / packages / analytics-plugin-original-source / src / utils.js View on Github external
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
  }, {})
}