import { EnvVars } from '../../core/env' ; export interface Env { readonly vars : ReadonlyArray < [ string , string ] > ; } const MAX_NAME_LENGTH = 16 ; export function validateNewEnvName ( name , nameList ) { return MAX_NAME_LENGTH > name . length && name . length > 0 && ! nameList . includes ( name ) ; } export function validateEnvName ( newName , currentName , nameList ) { return currentName === newName || validateNewEnvName ( newName , nameList ) ; } export function toVarMap ( env ) { return env . vars . reduce ( ( acc , [ k , v ] ) => Object . assign ( acc , { [ k ] : v } ) , { } ) ; }