mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-08-02 09:01:52 +00:00
Migrated to typescript the most complex reducer in the project
This commit is contained in:
11
src/short-urls/helpers/index.ts
Normal file
11
src/short-urls/helpers/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { isNil } from 'ramda';
|
||||
import { ShortUrl } from '../data';
|
||||
import { OptionalString } from '../../utils/utils';
|
||||
|
||||
export const shortUrlMatches = (shortUrl: ShortUrl, shortCode: string, domain: OptionalString): boolean => {
|
||||
if (isNil(domain)) {
|
||||
return shortUrl.shortCode === shortCode && !shortUrl.domain;
|
||||
}
|
||||
|
||||
return shortUrl.shortCode === shortCode && shortUrl.domain === domain;
|
||||
};
|
||||
Reference in New Issue
Block a user