fix(phone/getLocationFromUrl): fix type mismatch

This commit is contained in:
Taso committed 2021-07-27 17:04:28 -04:00
1 parent 9d7ddbca6f
commit 1566bb0fdb
1 file changed
+6 -1
+6 -1
View File
@@ -1,6 +1,11 @@
import parseUrl from 'parse-url';
export const getLocationFromUrl = (url: String) => {
interface GetLocationFromUrlValue {
pathname: string;
search: string;
}
export const getLocationFromUrl = (url: string): GetLocationFromUrlValue => {
const { pathname, search } = parseUrl(url);
const searchStr = '?' + (search || '');
return { pathname, search: searchStr };