signal-desktop/ts/util/isNormalNumber.ts

8 lines
247 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function isNormalNumber(value: unknown): value is number {
return (
typeof value === 'number' && !Number.isNaN(value) && Number.isFinite(value)
);
}