Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvarney committed Dec 2, 2020
1 parent 5aab429 commit 70bb8d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 8 additions & 8 deletions packages/url-persistence/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions packages/url-persistence/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ function URLPersistence<S extends string, P, A extends string>(
const params = parse(location.search);
const name = decodeURIComponent(location.pathname);
const paramsObject = deserialize(params, options?.serializers);
API.currentState = {
name: name as S,
params: (<unknown>paramsObject) as P,
};
API.currentState = { name: name as S, params: <unknown>paramsObject as P };
});

const API = observable(
Expand Down

0 comments on commit 70bb8d3

Please sign in to comment.