signal-desktop/ts/util/dropNull.ts
2021-06-22 09:46:42 -05:00

11 lines
242 B
TypeScript

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