UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

14 lines (13 loc) • 403 B
// src/internal/isValidAmount.ts /** * Type guard to check if a value is a valid amount (finite number). * * @param value number candidate * @example isValidAmount(10) // true * @example isValidAmount(-5) // true * @returns boolean indicating whether the value is a valid amount */ function isValidAmount(value) { return typeof value === "number" && Number.isFinite(value); } export { isValidAmount };