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) 224 B
export default function nullThrows<T>( x: T | null | undefined, error: string | Error ): T { if (typeof x === "undefined" || x === null) { throw error instanceof Error ? error : new Error(error); } return x; }