signal-desktop/ts/util/clearTimeoutIfNecessary.ts
2022-02-25 10:37:15 -08:00

10 lines
244 B
TypeScript

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function clearTimeoutIfNecessary(
timeout: undefined | null | ReturnType<typeof setTimeout>
): void {
if (timeout) {
clearTimeout(timeout);
}
}