Skip to content

Commit

Permalink
refactor: non-alias imports
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansberg committed Nov 8, 2023
1 parent 99677f2 commit 103ac67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/page-modules/assistant/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './types';
export * from './utils';
export { parseTripQuery, createTripQuery } from './utils';
export type { AssistantLayoutProps } from './layout';
export { default as AssistantLayout } from './layout';
12 changes: 6 additions & 6 deletions src/page-modules/assistant/trip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import {
TripData,
type TripPattern,
} from '@atb/page-modules/assistant/server/journey-planner/validators';
} from '../server/journey-planner/validators';
import style from './trip.module.css';
import { PageText, useTranslation } from '@atb/translations';
import { Typo } from '@atb/components/typography';
Expand All @@ -17,21 +17,21 @@ import { MonoIcon } from '@atb/components/icon';
import { TransportIconWithLabel } from '@atb/components/transport-mode/transport-icon';
import { GeocoderFeature } from '@atb/page-modules/departures';
import { TransportModeFilterOption } from '@atb/components/transport-mode-filter/types';
import { nextTripPatterns } from '@atb/page-modules/assistant/client';
import { nextTripPatterns } from '../client';
import {
NonTransitTripData,
createTripQuery,
filterOutDuplicates,
getCursorBySearchMode,
} from '@atb/page-modules/assistant';
} from '../utils';
import { NonTransitTripData } from '../types';
import { useEffect, useState } from 'react';
import { getInitialTransportModeFilter } from '@atb/components/transport-mode-filter/utils';
import { Button } from '@atb/components/button';
import { NonTransitTrip } from '../non-transit-pill';
import { isSameDay } from 'date-fns';
import { capitalize } from 'lodash';
import { TripPatternHeader } from '@atb/page-modules/assistant/trip/trip-pattern-header';
import { tripSummary } from '@atb/page-modules/assistant/trip/utils';
import { TripPatternHeader } from '../trip/trip-pattern-header';
import { tripSummary } from '../trip/utils';
import EmptySearchResults from '@atb/components/empty-search-results';
import { SearchTime } from '@atb/modules/search-time';

Expand Down
10 changes: 5 additions & 5 deletions src/page-modules/assistant/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ const featuresToFromToQuery = (from: GeocoderFeature, to: GeocoderFeature) => {
};
};

export const createTripQuery = (
export function createTripQuery(
fromFeature: GeocoderFeature,
toFeature: GeocoderFeature,
searchTime: SearchTime,
transportModeFilter?: TransportModeFilterState,
cursor?: string,
): TripQuery => {
): TripQuery {
let transportModeFilterQuery = {};
if (transportModeFilter) {
const filterQueryString = filterToQueryString(transportModeFilter);
Expand All @@ -69,9 +69,9 @@ export const createTripQuery = (
...cursorQuery,
...fromToQuery,
};
};
}

export const parseTripQuery = (query: any): TripQuery | undefined => {
export function parseTripQuery(query: any): TripQuery | undefined {
const requiredNumericFields = ['fromLat', 'fromLon', 'toLat', 'toLon'];
requiredNumericFields.forEach((field) => {
if (typeof query[field] === 'string')
Expand All @@ -89,4 +89,4 @@ export const parseTripQuery = (query: any): TripQuery | undefined => {
return undefined;
}
return parsed.data;
};
}

0 comments on commit 103ac67

Please sign in to comment.