Open waltcow opened 5 years ago
export enum EnvironmentType { development = "development", staging = "staging", production = "production" } export interface EnvironmentConfig { server: string port: number } type EnvironmentConfigMap = Record<EnvironmentType, EnvironmentConfig>
type FlattenIfArray<T> = T extends (infer R)[] ? R : T
Check if our generic Type is the array, If it is array extract the real type from it, If it does not leave it as is
Check if our generic Type is the array, If it is array extract the real type from it, If it does not leave it as is