diff --git a/app/soapbox/__tests__/compare_id.test.ts b/app/soapbox/__tests__/compare_id.test.ts index 583b4a1eb..1afbe0da3 100644 --- a/app/soapbox/__tests__/compare_id.test.ts +++ b/app/soapbox/__tests__/compare_id.test.ts @@ -1,4 +1,4 @@ -import compareId from '../compare_id'; +import { compareId } from '../utils/comparators'; test('compareId', () => { expect(compareId('3', '3')).toBe(0); diff --git a/app/soapbox/actions/notifications.ts b/app/soapbox/actions/notifications.ts index 8ef0e5715..068e65dc4 100644 --- a/app/soapbox/actions/notifications.ts +++ b/app/soapbox/actions/notifications.ts @@ -3,9 +3,9 @@ import 'intl-pluralrules'; import { defineMessages } from 'react-intl'; import api, { getLinks } from 'soapbox/api'; -import compareId from 'soapbox/compare_id'; import { getFilters, regexFromFilters } from 'soapbox/selectors'; import { isLoggedIn } from 'soapbox/utils/auth'; +import { compareId } from 'soapbox/utils/comparators'; import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features'; import { unescapeHTML } from 'soapbox/utils/html'; import { EXCLUDE_TYPES, NOTIFICATION_TYPES } from 'soapbox/utils/notification'; diff --git a/app/soapbox/features/admin/components/latest_accounts_panel.tsx b/app/soapbox/features/admin/components/latest_accounts_panel.tsx index 07b3c3f9d..f8a9fc04f 100644 --- a/app/soapbox/features/admin/components/latest_accounts_panel.tsx +++ b/app/soapbox/features/admin/components/latest_accounts_panel.tsx @@ -4,10 +4,10 @@ import { defineMessages, useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; import { fetchUsers } from 'soapbox/actions/admin'; -import compareId from 'soapbox/compare_id'; import { Widget } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { compareId } from 'soapbox/utils/comparators'; const messages = defineMessages({ title: { id: 'admin.latest_accounts_panel.title', defaultMessage: 'Latest Accounts' }, diff --git a/app/soapbox/reducers/conversations.ts b/app/soapbox/reducers/conversations.ts index 622d11a23..57c907448 100644 --- a/app/soapbox/reducers/conversations.ts +++ b/app/soapbox/reducers/conversations.ts @@ -9,7 +9,7 @@ import { CONVERSATIONS_UPDATE, CONVERSATIONS_READ, } from '../actions/conversations'; -import compareId from '../compare_id'; +import { compareId } from '../utils/comparators'; import type { AnyAction } from 'redux'; import type { APIEntity } from 'soapbox/types/entities'; diff --git a/app/soapbox/compare_id.ts b/app/soapbox/utils/comparators.ts similarity index 86% rename from app/soapbox/compare_id.ts rename to app/soapbox/utils/comparators.ts index b92a44cf1..14c3ba4df 100644 --- a/app/soapbox/compare_id.ts +++ b/app/soapbox/utils/comparators.ts @@ -9,7 +9,7 @@ * - `1`: id1 > id2 * - `-1`: id1 < id2 */ -export default function compareId(id1: string, id2: string) { +function compareId(id1: string, id2: string) { if (id1 === id2) { return 0; } @@ -19,3 +19,5 @@ export default function compareId(id1: string, id2: string) { return id1.length > id2.length ? 1 : -1; } } + +export { compareId }; \ No newline at end of file