Skip to content

Commit

Permalink
Run prettier on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Nov 27, 2022
1 parent c4045a0 commit 1c6eab9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/inferno-router/__tests__/NavLink.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ describe('NavLink', () => {
key: '1',
pathname: '/the/path',
search: 'the=query',
state: null,
state: null
};

render(
Expand All @@ -477,7 +477,7 @@ describe('NavLink', () => {

it('accepts an object `to` prop with state', async () => {
const memoryHistoryFoo = createMemoryHistory({
initialEntries: ["/foo"]
initialEntries: ['/foo']
});
memoryHistoryFoo.push = jasmine.createSpy();

Expand Down Expand Up @@ -517,7 +517,7 @@ describe('NavLink', () => {
tmpNode
);

const a = tmpNode.querySelector("a");
const a = tmpNode.querySelector('a');
a.click();

expect(clickHandler).toHaveBeenCalledTimes(1);
Expand Down
4 changes: 1 addition & 3 deletions packages/inferno-router/src/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { invariant } from './utils';
import { combineFrom, isString } from 'inferno-shared';
import type { Location } from 'history';
import { parsePath } from 'history';
import { splitLocation, normalizeToLocation } from "./locationUtils";

import { splitLocation, normalizeToLocation } from './locationUtils';

const isModifiedEvent = (event: InfernoMouseEvent<any>): boolean => Boolean(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);

Expand Down Expand Up @@ -36,7 +35,6 @@ function handleClick({ props, context }, event: InfernoMouseEvent<any>) {
const { replace = false, to: toPropIn } = props;
const { to, state } = splitLocation(normalizeToLocation(toPropIn));


if (replace) {
history.replace(to, state);
} else {
Expand Down
10 changes: 5 additions & 5 deletions packages/inferno-router/src/locationUtils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { To, Location, parsePath } from "history";
import { To, Location, parsePath } from 'history';
import { isString } from 'inferno-shared';

export const normalizeToLocation = (to) => {
return isString(to) ? parsePath(to) : to;
};

export const splitLocation = (location: Location): { to: To, state: any} => {
const { key = '', state, ...to } = location;
return { to, state };
}
export const splitLocation = (location: Location): { to: To; state: any } => {
const { key = '', state, ...to } = location;
return { to, state };
};

0 comments on commit 1c6eab9

Please sign in to comment.