signal-desktop/ts/util/isNormalNumber.ts

9 lines
247 B
TypeScript
Raw Normal View History

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