Fix URL strings for query parameter method

This commit is contained in:
Cmdr McDonald
2016-11-21 11:33:34 +00:00
parent 24abd6583f
commit 95b7d60be4
7 changed files with 20 additions and 17 deletions

View File

@@ -60,16 +60,11 @@ export function shallowEqual(objA, objB) {
}
/**
* Turn a base-64 encoded string in to a URL-safe version
* @param {string} data the string
* @return {string} the converted string
*/
export function toUrlSafe(data) {
return data ? data.replace(/\//g, '-').replace(/\+/g, '_') : null;
}
/**
* Turn a URL-safe base-64 encoded string in to a normal version
* Turn a URL-safe base-64 encoded string in to a normal version.
* Coriolis used to use a different encoding system, and some old
* data might be bookmarked or on local storage, so we keep this
* around and use it when decoding data from the old-style URLs to
* be safe.
* @param {string} data the string
* @return {string} the converted string
*/