decode = function(str) {
  try {
    return decodeURIComponent(str.replace(/\+/g, ' '));
  } catch (e) {
    return str;
  }
}
Safely decode the string

@param {String} str
@return {String}
@api private