|
|
@@ -1,5 +1,7 @@
|
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
|
|
|
|
+import { IUser } from '~/interfaces';
|
|
|
+
|
|
|
import { isValidObjectId } from '../objectid-utils';
|
|
|
import { addTrailingSlash } from '../path-utils';
|
|
|
|
|
|
@@ -124,9 +126,8 @@ export const isCreatablePage = (path: string): boolean => {
|
|
|
* return user's homepage path
|
|
|
* @param user
|
|
|
*/
|
|
|
-// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
|
-export const userHomepagePath = (user: any): string => {
|
|
|
- if (!user || !user.username) {
|
|
|
+export const userHomepagePath = (user: IUser | null | undefined): string => {
|
|
|
+ if (user?.username == null) {
|
|
|
return '';
|
|
|
}
|
|
|
return `/user/${user.username}`;
|