UNPKG

hypertune

Version:

[Hypertune](https://www.hypertune.com/) is the most flexible platform for feature flags, A/B testing, analytics and app configuration. Built with full end-to-end type-safety, Git-style version control and local, synchronous, in-memory flag evaluation. Opt

10 lines (9 loc) 237 B
export default function nanThrows<T extends number | Date>( x: T, error: string | Error ): T { if (Number.isNaN(x instanceof Date ? x.getTime() : x)) { throw error instanceof Error ? error : new Error(error); } return x; }