blob: 243d9c5658fbf14007f9446fb739c3c64c47ec42 [file] [log] [blame]
/**
* Takes a URL-encoded search query and returns that query with newlines between each of the
* terms. This returned value should be easier for a human to understand.
* @param queryStr {string} URL-encoded query.
* @return {string} a human readable version of the input.
*/
export function humanReadableQuery(queryStr) {
if (!queryStr) {
return '';
}
return queryStr.split('&').map(decodeURIComponent).join('\n');
}