mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-04 17:26:43 -06:00
9f0e0dc8ce
* Fix type errors in packages/sw * mouhitotsu * @typesは越境しない * Update packages/sw/src/scripts/create-notification.ts --------- Co-authored-by: tamaina <tamaina@hotmail.co.jp>
7 lines
387 B
TypeScript
7 lines
387 B
TypeScript
export default function(user: { name?: string | null, username: string }): string {
|
|
// Show username if name is empty.
|
|
// XXX: typescript-eslint has no configuration to allow using `||` against string.
|
|
// https://github.com/typescript-eslint/typescript-eslint/issues/4906
|
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
return user.name || user.username;
|
|
}
|