From 70bb8d37e949fc718443d63ee74d2b75c2bb84a0 Mon Sep 17 00:00:00 2001 From: Alexander Varney Date: Wed, 2 Dec 2020 12:40:34 -0500 Subject: [PATCH] fix formatting --- packages/url-persistence/src/index.test.ts | 16 ++++++++-------- packages/url-persistence/src/index.ts | 5 +---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/url-persistence/src/index.test.ts b/packages/url-persistence/src/index.test.ts index 492b029..3e2bd81 100644 --- a/packages/url-persistence/src/index.test.ts +++ b/packages/url-persistence/src/index.test.ts @@ -165,14 +165,14 @@ describe('with URL persistence', () => { ); }); - it('should read state from query params with special chars', async () => { - window.location.hash = - '/work?activity=%25%2B-%2F!%40%23%24%5E%26*()%20text'; - await ms(10); - expect(stateMachineRouter.currentState.params.activity).toBe( - '%+-/!@#$^&*() text' - ); - }); + it('should read state from query params with special chars', async () => { + window.location.hash = + '/work?activity=%25%2B-%2F!%40%23%24%5E%26*()%20text'; + await ms(10); + expect(stateMachineRouter.currentState.params.activity).toBe( + '%+-/!@#$^&*() text' + ); + }); it('should nullify query params', () => { stateMachineRouter.emit(ACTION.goToWork); diff --git a/packages/url-persistence/src/index.ts b/packages/url-persistence/src/index.ts index 16d0d95..bf903d5 100644 --- a/packages/url-persistence/src/index.ts +++ b/packages/url-persistence/src/index.ts @@ -68,10 +68,7 @@ function URLPersistence( const params = parse(location.search); const name = decodeURIComponent(location.pathname); const paramsObject = deserialize(params, options?.serializers); - API.currentState = { - name: name as S, - params: (paramsObject) as P, - }; + API.currentState = { name: name as S, params: paramsObject as P }; }); const API = observable(