mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-26 05:42:22 +00:00
UsersService: Remove null from toUserDto return type
toUserDto won't return null, as TS's strict mode prevents user from being nullish Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a453344205
commit
87eb099d34
1 changed files with 2 additions and 6 deletions
|
@ -108,13 +108,9 @@ export class UsersService {
|
|||
/**
|
||||
* Build UserInfoDto from a user.
|
||||
* @param {User=} user - the user to use
|
||||
* @return {(UserInfoDto|null)} the built UserInfoDto
|
||||
* @return {(UserInfoDto)} the built UserInfoDto
|
||||
*/
|
||||
toUserDto(user: User | null | undefined): UserInfoDto | null {
|
||||
if (!user) {
|
||||
this.logger.warn(`Recieved ${String(user)} argument!`, 'toUserDto');
|
||||
return null;
|
||||
}
|
||||
toUserDto(user: User): UserInfoDto {
|
||||
return {
|
||||
userName: user.userName,
|
||||
displayName: user.displayName,
|
||||
|
|
Loading…
Reference in a new issue