mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
Various fixes; allow direct import from URL
This commit is contained in:
@@ -58,3 +58,21 @@ export function shallowEqual(objA, objB) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.replace(/\\/g, '-').replace(/\+/g, '_');
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a URL-safe base-64 encoded string in to a normal version
|
||||
* @param {string} data the string
|
||||
* @return {string} the converted string
|
||||
*/
|
||||
export function fromUrlSafe(data) {
|
||||
return data.replace(/-/g, '/').replace(/_/g, '+');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user