diff --git a/lib/routing.js b/lib/routing.js index 7492893..e71605c 100644 --- a/lib/routing.js +++ b/lib/routing.js @@ -50,11 +50,13 @@ const reverseMappings = mappings.map(mapping => ) export const serializeState = state => { - const stateString = encodeURIComponent(JSON.stringify(state)) + const stateString = JSON.stringify(state) - return typeof window !== 'undefined' - ? btoa(stateString) - : Buffer.from(stateString).toString('base64') + return encodeURIComponent( + typeof window !== 'undefined' + ? btoa(stateString) + : Buffer.from(stateString).toString('base64') + ) } export const deserializeState = serializedState => {