summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc/is-not-null.ts
blob: 584a09d35aee55aa78d29f9c72890458dcd8c758 (plain)
1
2
3
4
5
6
7
8
9
10
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * 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 {
	return input != null;
}