API reference@evolu/commonType › FiniteNumber

type FiniteNumber = number & Brand<"Finite">;

Defined in: packages/common/src/Type.ts:2322

Finite number.

This Type ensures that a number is finite.

Why is this important?

JSON.stringify serializes JavaScript numbers into null if they are not finite (e.g., Infinity, -Infinity, or NaN). Using FiniteNumber helps prevent these unexpected behaviors when working with JSON serialization.