chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:32:57 +08:00
commit cd420f9332
4811 changed files with 884702 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import type { User as DBUser } from "~/models/user.server";
type User = Pick<DBUser, "name" | "displayName">;
// remove `null` from username
export function getUsername(user?: User): string | undefined {
if (!user) {
return;
}
// user.displayName is of type `string | null`
if (user.displayName) {
return user.displayName;
}
// user.name is of type `string | null`
if (user.name) {
return user.name;
}
return;
}