signal-desktop/ts/util/isNotNil.ts

10 lines
240 B
TypeScript
Raw Normal View History

2021-02-26 23:42:45 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function isNotNil<T>(value: T | null | undefined): value is T {
if (value === null || value === undefined) {
return false;
}
return true;
}