Skip to content

Commit

Permalink
style: refactor negated condition
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandopasik committed Oct 2, 2024
1 parent fab0fae commit 4dda627
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const noRouteActive = ({ router: { routes } }: State): boolean =>
);

export const isRouteActive = (state: State, route?: string): boolean =>
typeof route !== 'undefined' ? Boolean(getRoute(state, route)?.active) : noRouteActive(state);
typeof route === 'undefined' ? noRouteActive(state) : Boolean(getRoute(state, route)?.active);

export const getRouteParams = (state: State, route?: string): NonNullable<Route['params']> =>
getRoute(state, route)?.params ?? {};

0 comments on commit 4dda627

Please sign in to comment.