function decode(encodedData) {
  let dataBytes = base64.decode(encodedData)
  let dataText = utf8.decode(dataBytes)
  let data = null
  try {
    data = JSON.parse(dataText)
  } catch (e) {}

  return data
}
Decodes data encoded with base64 and utf8 encodings.

@param {String} encodedData
@return {Any}