signal-desktop/ts/util/isNotNil.ts
2021-03-19 16:53:52 -04:00

9 lines
240 B
TypeScript

// 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;
}