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

21 lines (19 loc) 496 B
import { DimensionType, ContinuousDimensionType, DiscreteDimensionType, } from "../types"; export default function toDimensionTypeEnum( type: typeof DiscreteDimensionType | typeof ContinuousDimensionType ): DimensionType { switch (type) { case "discrete": return DimensionType.Discrete; case "continuous": return DimensionType.Continuous; default: { const neverType: never = type; throw new Error(`Unknown dimension type ${neverType}`); } } }