refactor(backend): Array.prototype.filterでの非null確認ではisNotNull関数を使うように (#13442)

* `Array.prototype.filter`での非null確認では`isNotNull`関数を使うように

* `{}` -> `NonNullable<unknown>`
This commit is contained in:
okayurisotto
2024-02-23 14:12:57 +09:00
committed by GitHub
parent 080a3c20bd
commit 64953fadc9
16 changed files with 29 additions and 18 deletions

View File

@@ -3,8 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
// we are using {} as "any non-nullish value" as expected
// eslint-disable-next-line @typescript-eslint/ban-types
export function isNotNull<T extends {}>(input: T | undefined | null): input is T {
export function isNotNull<T extends NonNullable<unknown>>(input: T | undefined | null): input is T {
return input != null;
}