Migrated to typescript the most complex reducer in the project

This commit is contained in:
Alejandro Celaya
2020-08-27 18:31:56 +02:00
parent f3a2535e2f
commit 83531666de
11 changed files with 182 additions and 133 deletions

View File

@@ -1,6 +1,8 @@
import { isNil } from 'ramda';
import { ShortUrl } from '../data';
import { OptionalString } from '../../utils/utils';
export const shortUrlMatches = (shortUrl, shortCode, domain) => {
export const shortUrlMatches = (shortUrl: ShortUrl, shortCode: string, domain: OptionalString): boolean => {
if (isNil(domain)) {
return shortUrl.shortCode === shortCode && !shortUrl.domain;
}