sforkowany z mirror/soapbox
Move 'compareId' to comparators utils
rodzic
a202fe68d1
commit
db5d0d6400
|
@ -1,4 +1,4 @@
|
|||
import compareId from '../compare_id';
|
||||
import { compareId } from '../utils/comparators';
|
||||
|
||||
test('compareId', () => {
|
||||
expect(compareId('3', '3')).toBe(0);
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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' },
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 };
|
Ładowanie…
Reference in New Issue