signal-desktop/ts/util/dropNull.ts

12 lines
242 B
TypeScript
Raw Normal View History

2021-06-22 14:46:42 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function dropNull<T>(
value: NonNullable<T> | null | undefined
): T | undefined {
if (value === null) {
return undefined;
}
return value;
}