function inviteUserByName(username: string, db: Database): void {
const user = findUserByName(username, db);
if (user === null) throw new Error("userNotFound")
if (user.age > 18) {
inviteUser(user, db);
return true
} else {
return false
}
}